/** * Main for testing. */ public static void main(String[] args) { ConfigurationDialog cf = new ConfigurationDialog(null); cf.pack(); cf.setVisible(true); cf.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); } }
this.getContentPane().setLayout(new GridBagLayout()); this.setTitle("Platform Settings"); this.components = SCollection.createArrayList(); update(); addons.setCaretPosition(0); addons.setDefaultOpenMode(true); int index = this.getContentPane().getComponentCount(); this.getContentPane().add(addons, new GridBagConstraints(0, index, 1, 1, 1, 1, GridBagConstraints.NORTHEAST, GridBagConstraints.HORIZONTAL, new Insets(2, 4, 4, 2), 0, 0)); help.setPreferredSize(pd); index = this.getContentPane().getComponentCount(); this.getContentPane().add(buts, new GridBagConstraints(0, index, 1, 1, 1, 1, GridBagConstraints.NORTHEAST, GridBagConstraints.HORIZONTAL, new Insets(2, 4, 4, 2), 0, 0));
public void actionPerformed(ActionEvent ae) { save(); } });
public void actionPerformed(ActionEvent ae) { dispose(); } });
/** * Update the GUI state by reading the current values from the configuration. */ protected void update() { for(int i=0; i<components.size(); i++) { update((JComponent)components.get(i), true); } }
int index = this.getContentPane().getComponentCount(); this.getContentPane().add(choicepanel, new GridBagConstraints(0, index, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(2, 4, 4, 2), 0, 0)); ButtonGroup bgroup = new ButtonGroup();