Working optionpane tag example?

[email protected] Wed, 20 Apr 2005 15:22:31 -0400
Newsgroups gmane.comp.embedded.carlsbad-cubes
Organization MITRE
Message-ID <[email protected]>
Does anyone have a working example of using the optionpane tag?
I tried the XML at the end of this email but no dialog displays.  In the
Java code, I've tried setVisible(true) and show() on the object returned
from render().  There are no errors or messages that I can tell.  If I
change the optionpane to dialog or frame, I can get the window to appear
with no problem.  

Any help or suggestions is appreciated!
      
	try {
        ScenarioModel sm = new ScenarioModel();
        SwingEngine sw = new SwingEngine( sm );
        Container c = sw.render("newScenario.xml");
        c.setVisible(true);
      } catch (Exception e) {
        e.printStackTrace();
      }

<?xml version="1.0" encoding="UTF-8"?>
<optionpane id="newScenario" layout="BorderLayout" 
  optiontype="JOptionPane.OK_CANCEL_OPTION"
messagetype="JOptionPane.INFORMATION_MESSAGE"
  defaultcloseoperation="WindowConstants.DISPOSE_ON_CLOSE" >
	<panel name="pnl" constraints="BorderLayout.CENTER"
layout="GridBagLayout">
    <label text="Name">
      <gridbagconstraints id="gbc_0" insets="0,0,0,0" gridx="0" gridy="0"
ipadx="0" ipady="0" weightx="1" weighty="1"/>
    </label>
    <textfield id="scenarioName" Columns="20" Text="Scenario name Here">
      <gridbagconstraints use="gbc_0" gridx="1"/>
    </textfield>
    
    <label name="label0" text="Type">
      <gridbagconstraints id="gbc_1" insets="2,2,2,2" gridx="0" gridy="1"
ipadx="0" ipady="0" weightx="1" weighty="1"/>
    </label>
  </panel>
</optionpane>

Thanks in advance,
Michael Los

_______________________________________________
Forum mailing list
[email protected]
http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
smime.p7s (application/x-pkcs7-signature, 2.7 KB) - not displayed