<?xml version="1.0" ?>
<!DOCTYPE gui SYSTEM "gui.dtd">
<gui lf="native">

<script>
function showIt() {
    d=getById("test");
    d.setSize(250,250);
    d.setVisible(true);
}
function hideIt() {
    d=getById("test");
    d.setVisible(false);
}
function makeText() {
    Swing = Package.javax.swing;
    c = new Swing.JTextArea();
    c.setSize(200,200);
    return c;
}
</script>

<JPopupMenu id="pm">
   <JCheckBoxMenuItem text="OnOff"/>
   <JSeparator/>   
   <JRadioButtonMenuItem text="Choice 1" selected="true"/>
   <JRadioButtonMenuItem text="Choice 2"/>
   <JRadioButtonMenuItem text="Choice 3"/>
</JPopupMenu>

<JFrame id="main" popupId="pm" bg="lightGray" title="Test Frame - other"
        script="this.onWindowClosing='java.lang.System.exit(0)'">
  <JPanel layout="BorderLayout()">
      <JPasswordField toolTipText="Enter password" bg="white" columns="20" constraint="Center" />
      <JLabel text="Hello" constraint="South" bg="blue" fg="red"/>
      <JButton text="Dialog!" constraint="East" script="this.onAction=showIt;"/>
      <JToolBar constraint="North">
          <JButton icon="open.gif" text = "open" toolTipText="For open"/>
          <JButton text = "Close" toolTipText="For close"/>
      </JToolBar>
  </JPanel>
</JFrame>

<JDialog id="test" ownerId="main" layout="BorderLayout()">
    <JButton text="Okay" constraint="North" script="this.onAction=hideIt"/>
    <JSplitPane orientation="vertical">
        <JEditorPane text="Hello,\n   world" constraint="top"/>
        <JScrollPane constraint="bottom">
            <JLabel icon="main.gif"/>
        </JScrollPane>
    </JSplitPane>
    <JComponent constraint="South" creationScript="makeText();"/>
</JDialog>

<script>
frame=getById("main");
frame.pack();
// frame.setSize(350,100);
frame.show()
</script>
</gui>