List of usage examples for javax.swing DefaultComboBoxModel DefaultComboBoxModel
public DefaultComboBoxModel(Vector<E> v)
From source file:atlas.kingj.roi.FrmMain.java
private void EnableROIfull() { RoiResults = new ResultSetROI(); RoiResults.set(results);/*from ww w . j a va 2 s . c om*/ cmbMarg1.setEnabled(true); cmbMarg2.setEnabled(true); cmbMargEnergy1.setEnabled(true); cmbMargEnergy2.setEnabled(true); cmbMargMaint1.setEnabled(true); cmbMargMaint2.setEnabled(true); cmbMargWaste1.setEnabled(true); cmbMargWaste2.setEnabled(true); lblMarginalImprovement.setEnabled(true); lblMarginalEnergy.setEnabled(true); lblMarginalMaint.setEnabled(true); lblMarginalWaste.setEnabled(true); // update machine selection combobox int[] indices = listCompareRoi.getSelectedIndices(); String[] machineNames = new String[indices.length]; for (int i = 0; i < indices.length; ++i) { machineNames[i] = ((Machine) listCompareRoi.getModel().getElementAt(indices[i])).model.toString() + ": " + ((Machine) listCompareRoi.getModel().getElementAt(indices[i])).name; } cmbMarg1.setModel(new DefaultComboBoxModel(machineNames)); cmbMarg2.setModel(new DefaultComboBoxModel(machineNames)); cmbMargEnergy1.setModel(new DefaultComboBoxModel(machineNames)); cmbMargEnergy2.setModel(new DefaultComboBoxModel(machineNames)); cmbMargMaint1.setModel(new DefaultComboBoxModel(machineNames)); cmbMargMaint2.setModel(new DefaultComboBoxModel(machineNames)); cmbMargWaste1.setModel(new DefaultComboBoxModel(machineNames)); cmbMargWaste2.setModel(new DefaultComboBoxModel(machineNames)); if (machineNames.length > 1) { cmbMarg2.setSelectedIndex(1); cmbMargEnergy2.setSelectedIndex(1); cmbMargMaint2.setSelectedIndex(1); cmbMargWaste2.setSelectedIndex(1); } lblPerTonne.setText((metric ? "per tonne" : "per ton")); lblM_1.setText((metric ? "m" : "ft")); lblM_2.setText((metric ? "m" : "ft")); }
From source file:ru.apertum.qsystem.client.forms.FAdmin.java
private void buttonRefreshBanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRefreshBanActionPerformed listBan.setModel(new DefaultComboBoxModel(NetCommander.getBanedList(new ServerNetProperty()).toArray())); }
From source file:com.peterbochs.PeterBochsDebugger.java
private JComboBox getJELFComboBox() { if (jELFComboBox == null) { ComboBoxModel jELFComboBoxModel = new DefaultComboBoxModel(new String[] {}); jELFComboBox = new JComboBox(); jELFComboBox.setModel(jELFComboBoxModel); jELFComboBox.setMaximumSize(new java.awt.Dimension(400, 30)); jELFComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jELFComboBoxActionPerformed(evt); }/*from ww w. j a va 2 s.co m*/ }); } return jELFComboBox; }
From source file:atlas.kingj.roi.FrmMain.java
private void UpdateRoiCmbs() { // update machine selection combobox try {//from w w w. ja va 2s .c om String[] allMachineNames = new String[listModel.getSize()]; for (int i = 0; i < listModel.getSize(); ++i) { allMachineNames[i] = ((Machine) listModel.getElementAt(i)).model.toString() + ": " + ((Machine) listModel.getElementAt(i)).name; } cmbMachineEnergy.setModel(new DefaultComboBoxModel(allMachineNames)); cmbMachinesmaintenance.setModel(new DefaultComboBoxModel(allMachineNames)); } catch (Exception e) { cmbMachineEnergy.setModel(new DefaultComboBoxModel()); cmbMachinesmaintenance.setModel(new DefaultComboBoxModel()); } }
From source file:atlas.kingj.roi.FrmMain.java
public void UpdateAnalysis() { //if(tabbedPane.getSelectedIndex() != 3 && tabbedPane.getSelectedIndex() != 4) // return;//from w w w . j a va 2 s . c om //else{ try { ResetStatusLabel(); int[] indices = listCompare.getSelectedIndices(); if (indices.length > 0 && indices.length <= listCompare.getModel().getSize()) { btnNone.setEnabled(true); if (indices.length < listModel.getSize()) btnAll.setEnabled(true); else btnAll.setEnabled(false); Machine[] machines = new Machine[indices.length]; for (int i = 0; i < indices.length; ++i) { machines[i] = (Machine) listModel.elementAt(indices[i]); } environment.update(window); if (environment.isValid()) { // Get analysis comp = new Comparator(machines, environment, MODEL_VERSION); results = comp.getResults(); // TODO: make sure machines in order on chart/results /* chart = results.getTimeGraph(); chart.setTitle("");*/ /*// Display results graph pnlPreview.remove(pnlGraph); pnlGraph = new ChartPanel(chart); pnlGraph.setBounds(2, 2, 312, 199); pnlPreview.add(pnlGraph);*/ breakdown = results.getBreakdownCharts(); UpdateGraph(); // TODO base on cmbGraphType // update form components EnableProdForm(); // update machine selection combobox String[] machineNames = new String[indices.length]; for (int i = 0; i < indices.length; ++i) { machineNames[i] = ((Machine) listModel.elementAt(indices[i])).model.toString() + ": " + ((Machine) listModel.elementAt(indices[i])).name; } DefaultComboBoxModel selectedMachines = new DefaultComboBoxModel(machineNames); cmbMachines.setModel(selectedMachines); if (oldMachineIndex < indices.length) cmbMachines.setSelectedIndex(oldMachineIndex); // triggers update of numerical results display else cmbMachines.setSelectedIndex(0); } else { ShowMessage("Job schedule not valid. Please check valid jobs have been selected."); DisableProdForm(); } } else { ShowMessage("No machines selected."); DisableProdForm(); btnNone.setEnabled(false); if (listModel.size() > 0) btnAll.setEnabled(true); } } catch (NullPointerException e) { // Form isn't initialized // TODO: find a nicer way around this...! //e.printStackTrace(); } //} }
From source file:atlas.kingj.roi.FrmMain.java
private void rdbtnClick(String name) { if (name.equals("ER610") /*&& (listModel.getSize()==1 || !(model == Machine.Model.ER610))*/) { ResetStatusLabel();/*from w w w . ja v a 2 s . c om*/ chckbxSelectAll.setEnabled(true); chckbxAlignmentGuide.setEnabled(Consts.ER_ALIGN_OPTION); chckbxAutoCutoff.setEnabled(Consts.ER_CUTOFF_OPTION); chckbxAutostripping.setEnabled(Consts.ER_AUTOSTRIP_OPTION); chckbxAutoTapeCore.setEnabled(Consts.ER_TAPECORE_OPTION); chckbxAutoTapeTail.setEnabled(Consts.ER_TAPETAIL_OPTION); chckbxExtraRewind.setEnabled(Consts.ER_850MM_OPTION); chckbxFlag.setEnabled(Consts.ER_FLAG_OPTION); chckbxRollConditioning.setEnabled(Consts.ER_ROLL_OPTION); chckbxSpliceTable.setEnabled(Consts.ER_SPLICE_OPTION); chckbxTurretSupport.setEnabled(Consts.ER_TURRET_OPTION); lblKnifeControl.setEnabled(false); cmbKnives.setEnabled(false); //lblCorePositioning.setEnabled(false); //cmbCorepos.setEnabled(false); lblUnloader.setEnabled(false); cmbUnloader.setEnabled(false); lblUnwindDrive.setEnabled(false); cmbUnwindDrive.setEnabled(false); lblRewindControlLoop.setEnabled(false); cmbRewindCtrl.setEnabled(false); lblCorePositioning.setEnabled(true); cmbCorepos.setEnabled(true); lblSpeed.setEnabled(true); cmbSpeed.setEnabled(true); /*chckbxAlignmentGuide.setVisible(true); chckbxAutoCutoff.setVisible(true); chckbxAutostripping.setVisible(true); chckbxAutoTapeCore.setVisible(true); chckbxAutoTapeTail.setVisible(true); chckbxExtraRewind.setVisible(true); chckbxFlag.setVisible(true); chckbxRollConditioning.setVisible(true); chckbxSpliceTable.setVisible(true); chckbxTurretSupport.setVisible(true);*/ //cmbCorepos.setModel(new DefaultComboBoxModel(FrmMain.CoreposER.values())); cmbCorepos.setModel(new DefaultComboBoxModel(new String[] { "Manual", "Laser" })); cmbSpeed.setModel(new DefaultComboBoxModel(new String[] { "450", "550" })); cmbKnives.setSelectedIndex(0); btnCustomMachine.setEnabled(false); btnOverrideDefaultAcceleration.setEnabled(true); model = Machine.Model.ER610; rdbtnER610.setSelected(true); } if (name.equals("SR9DS") /*&& !(model == Machine.Model.SR9DS)*/) { ResetStatusLabel(); chckbxSelectAll.setEnabled(true); chckbxAlignmentGuide.setEnabled(Consts.SRDS_ALIGN_OPTION); chckbxAutoCutoff.setEnabled(Consts.SRDS_CUTOFF_OPTION); chckbxAutostripping.setEnabled(Consts.SRDS_AUTOSTRIP_OPTION); chckbxAutoTapeCore.setEnabled(Consts.SRDS_TAPECORE_OPTION); chckbxAutoTapeTail.setEnabled(Consts.SRDS_TAPETAIL_OPTION); chckbxExtraRewind.setEnabled(Consts.SRDS_850MM_OPTION); chckbxFlag.setEnabled(Consts.SRDS_FLAG_OPTION); chckbxRollConditioning.setEnabled(Consts.SRDS_ROLL_OPTION); chckbxSpliceTable.setEnabled(Consts.SRDS_SPLICE_OPTION); chckbxTurretSupport.setEnabled(Consts.SRDS_TURRET_OPTION); lblKnifeControl.setEnabled(true); cmbKnives.setEnabled(true); lblCorePositioning.setEnabled(true); cmbCorepos.setEnabled(true); lblUnloader.setEnabled(true); cmbUnloader.setEnabled(true); lblUnwindDrive.setEnabled(true); cmbUnwindDrive.setEnabled(true); lblRewindControlLoop.setEnabled(true); cmbRewindCtrl.setEnabled(true); /*chckbxAlignmentGuide.setVisible(true); chckbxAutoCutoff.setVisible(true); chckbxAutostripping.setVisible(true); chckbxAutoTapeCore.setVisible(true); chckbxAutoTapeTail.setVisible(true); chckbxExtraRewind.setVisible(true); chckbxFlag.setVisible(true); chckbxRollConditioning.setVisible(true); chckbxSpliceTable.setVisible(true); chckbxTurretSupport.setVisible(true);*/ lblCorePositioning.setEnabled(true); cmbCorepos.setEnabled(true); lblSpeed.setEnabled(true); cmbSpeed.setEnabled(true); cmbKnives.setSelectedIndex(0); //cmbCorepos.setModel(new DefaultComboBoxModel(FrmMain.CoreposSR.values())); cmbCorepos.setModel(new DefaultComboBoxModel(new String[] { "Manual", "Laser", "Servo" })); cmbSpeed.setModel(new DefaultComboBoxModel(new String[] { "1000" })); btnCustomMachine.setEnabled(false); btnOverrideDefaultAcceleration.setEnabled(true); model = Machine.Model.SR9DS; rdbtnSR9DS.setSelected(true); } if (name.equals("SR9DT")/* && !(model == Machine.Model.SR9DT)*/) { ResetStatusLabel(); chckbxSelectAll.setEnabled(true); chckbxAlignmentGuide.setEnabled(Consts.SRDT_ALIGN_OPTION); chckbxAutoCutoff.setEnabled(Consts.SRDT_CUTOFF_OPTION); chckbxAutostripping.setEnabled(Consts.SRDT_AUTOSTRIP_OPTION); chckbxAutoTapeCore.setEnabled(Consts.SRDT_TAPECORE_OPTION); chckbxAutoTapeTail.setEnabled(Consts.SRDT_TAPETAIL_OPTION); chckbxExtraRewind.setEnabled(Consts.SRDT_850MM_OPTION); chckbxFlag.setEnabled(Consts.SRDT_FLAG_OPTION); chckbxRollConditioning.setEnabled(Consts.SRDT_ROLL_OPTION); chckbxSpliceTable.setEnabled(Consts.SRDT_SPLICE_OPTION); chckbxTurretSupport.setEnabled(Consts.SRDT_TURRET_OPTION); chckbxTurretSupport.setSelected(true); lblKnifeControl.setEnabled(true); cmbKnives.setEnabled(true); lblCorePositioning.setEnabled(true); cmbCorepos.setEnabled(true); lblUnloader.setEnabled(true); cmbUnloader.setEnabled(true); lblUnwindDrive.setEnabled(true); cmbUnwindDrive.setEnabled(true); lblRewindControlLoop.setEnabled(true); cmbRewindCtrl.setEnabled(true); lblCorePositioning.setEnabled(true); cmbCorepos.setEnabled(true); lblSpeed.setEnabled(true); cmbSpeed.setEnabled(true); /*chckbxAlignmentGuide.setVisible(true); chckbxAutoCutoff.setVisible(true); chckbxAutostripping.setVisible(true); chckbxAutoTapeCore.setVisible(true); chckbxAutoTapeTail.setVisible(true); chckbxExtraRewind.setVisible(true); chckbxFlag.setVisible(true); chckbxRollConditioning.setVisible(true); chckbxSpliceTable.setVisible(true); chckbxTurretSupport.setVisible(true);*/ //cmbCorepos.setModel(new DefaultComboBoxModel(FrmMain.CoreposSR.values())); cmbCorepos.setModel(new DefaultComboBoxModel(new String[] { "Manual", "Laser", "Servo" })); cmbSpeed.setModel(new DefaultComboBoxModel(new String[] { "1000" })); cmbKnives.setSelectedIndex(0); btnCustomMachine.setEnabled(false); btnOverrideDefaultAcceleration.setEnabled(true); model = Machine.Model.SR9DT; rdbtnSR9DT.setSelected(true); } if (name.equals("SR800")/* && !(model == Machine.Model.SR800)*/) { ResetStatusLabel(); chckbxSelectAll.setEnabled(true); chckbxAlignmentGuide.setEnabled(Consts.SR800_ALIGN_OPTION); chckbxAutoCutoff.setEnabled(Consts.SR800_CUTOFF_OPTION); chckbxAutostripping.setEnabled(Consts.SR800_AUTOSTRIP_OPTION); chckbxAutoTapeCore.setEnabled(Consts.SR800_TAPECORE_OPTION); chckbxAutoTapeTail.setEnabled(Consts.SR800_TAPETAIL_OPTION); chckbxExtraRewind.setEnabled(Consts.SR800_850MM_OPTION); chckbxFlag.setEnabled(Consts.SR800_FLAG_OPTION); chckbxRollConditioning.setEnabled(Consts.SR800_ROLL_OPTION); chckbxSpliceTable.setEnabled(Consts.SR800_SPLICE_OPTION); chckbxTurretSupport.setEnabled(Consts.SR800_TURRET_OPTION); lblKnifeControl.setEnabled(true); cmbKnives.setEnabled(true); lblCorePositioning.setEnabled(true); cmbCorepos.setEnabled(true); lblUnloader.setEnabled(true); cmbUnloader.setEnabled(true); lblUnwindDrive.setEnabled(true); cmbUnwindDrive.setEnabled(true); lblRewindControlLoop.setEnabled(true); cmbRewindCtrl.setEnabled(true); lblCorePositioning.setEnabled(true); cmbCorepos.setEnabled(true); lblSpeed.setEnabled(true); cmbSpeed.setEnabled(true); cmbKnives.setSelectedIndex(0); cmbCorepos.setModel(new DefaultComboBoxModel(new String[] { "Manual", "Laser" })); cmbSpeed.setModel(new DefaultComboBoxModel(new String[] { "700" })); btnCustomMachine.setEnabled(false); btnOverrideDefaultAcceleration.setEnabled(true); model = Machine.Model.SR800; rdbtnSR800.setSelected(true); } if (name.equals("Custom") /*&& !(model == Machine.Model.OTHER)*/) { chckbxSelectAll.setSelected(false); chckbxSelectAll.setEnabled(false); chckbxAlignmentGuide.setEnabled(false); chckbxAutoCutoff.setEnabled(false); chckbxAutostripping.setEnabled(false); chckbxAutoTapeCore.setEnabled(false); chckbxAutoTapeTail.setEnabled(false); chckbxExtraRewind.setEnabled(false); chckbxFlag.setEnabled(false); chckbxRollConditioning.setEnabled(false); chckbxSpliceTable.setEnabled(false); chckbxTurretSupport.setEnabled(false); lblKnifeControl.setEnabled(false); cmbKnives.setEnabled(false); //lblCorePositioning.setEnabled(false); //cmbCorepos.setEnabled(false); lblUnloader.setEnabled(false); cmbUnloader.setEnabled(false); lblUnwindDrive.setEnabled(false); cmbUnwindDrive.setEnabled(false); lblRewindControlLoop.setEnabled(false); cmbRewindCtrl.setEnabled(false); lblCorePositioning.setEnabled(false); cmbCorepos.setEnabled(false); lblSpeed.setEnabled(false); cmbSpeed.setEnabled(false); cmbKnives.setSelectedIndex(0); //cmbCorepos.setModel(new DefaultComboBoxModel(FrmMain.CoreposER.values())); //cmbCorepos.setModel(new DefaultComboBoxModel(new String[] {"Manual", "Laser"})); //cmbSpeed.setModel(new DefaultComboBoxModel(new String[] {"450", "550"})); /*MachineBuilder newmach = new MachineBuilder(window listMachines, lblStatus, machNames); newmach.setVisible(true);*/ btnCustomMachine.setEnabled(true); btnOverrideDefaultAcceleration.setEnabled(false); model = Machine.Model.CUSTOM; rdbtnCustom.setSelected(true); } if (name.equals("Custom")) { machine.setCustom(true); if (machine.getCustomMachine() == null) machine.setCustomMachine(machine.new CustomMachine()); } else machine.setCustom(false); UpdateSelectAllChckbx(); if (name.equals("Custom")) chckbxSelectAll.setSelected(false); }
From source file:com.peterbochs.PeterBochsDebugger.java
private JComboBox getJMaxRowComboBox() { if (jMaxRowComboBox == null) { ComboBoxModel jMaxRowComboBoxModel = new DefaultComboBoxModel( new String[] { "infinite", "10", "100", "200", "500", "1000", "2000" }); jMaxRowComboBox = new JComboBox(); jMaxRowComboBox.setModel(jMaxRowComboBoxModel); jMaxRowComboBox.setSelectedItem("100"); }//from w w w . j av a 2s. com return jMaxRowComboBox; }
From source file:atlas.kingj.roi.FrmMain.java
private void ResetJobForm() { try {//from ww w . j a v a 2 s . c om ResetStatusLabel(); int selected = 0; int size = 0; try { selected = listJobs.getSelectedIndex(); size = jobModel.getSize(); } catch (NullPointerException e) { jobFormReady = false; } if ((selected < 0) || (size == 0)) jobFormReady = false; //try{ if (metric) { cmbRewindCore.setModel(new DefaultComboBoxModel(Consts.REWIND_CORE_MM)); cmbUnwindCore.setModel(new DefaultComboBoxModel(Consts.UNWIND_CORE_MM)); cmbUnwindType.setModel( new DefaultComboBoxModel(new String[] { "Length (m)", "Weight (kg)", "Diameter (mm)" })); cmbRewindType.setModel( new DefaultComboBoxModel(new String[] { "Length (m)", "Weight (kg)", "Diameter (mm)" })); cmbTargetTotal.setModel( new DefaultComboBoxModel(new String[] { "Length (m)", "Weight (kg)", "Weight (tonnes)" })); } else { cmbRewindCore.setModel(new DefaultComboBoxModel(Consts.REWIND_CORE_IN)); cmbUnwindCore.setModel(new DefaultComboBoxModel(Consts.UNWIND_CORE_IN)); cmbUnwindType.setModel( new DefaultComboBoxModel(new String[] { "Length (ft)", "Weight (ton)", "Diameter (in)" })); cmbRewindType.setModel( new DefaultComboBoxModel(new String[] { "Length (ft)", "Weight (lbs)", "Diameter (in)" })); cmbTargetTotal.setModel(new DefaultComboBoxModel(new String[] { "Length (ft)", "Weight (ton)" })); } //}catch(IllegalStateException e){ //} oldUnwindIndex = 0; oldRewindIndex = 0; oldTotalsIndex = 0; SetReelType = 0; cmbMaterials.setSelectedIndex(0); cmbUnwindCore.setSelectedIndex(0); cmbRewindCore.setSelectedIndex(1); cmbJobDomain.setSelectedIndex(0); cmbUnwindType.setSelectedIndex(0); cmbRewindType.setSelectedIndex(0); cmbTargetTotal.setSelectedIndex(0); cmbKnifeType.setSelectedIndex(0); txtThickness.setText("20"); if (lblGsm.getText().equals("(gsm)")) txtDensity.setText("0.92"); else txtDensity.setText("18.4"); chckbxLimitRunSpeed.setSelected(false); txtUnwindAmount.setText("10000"); txtRewindAmount.setText("1000"); lblTrim.setText("0 mm"); txtLimitRunSpeed.setText("800"); txtSlits.setText("1"); txtSlitWidth.setText("1350"); txtTargetTotal.setText("10000"); txtWebWidth.setText("1350"); txtFlagCount.setText("1"); txtLimitRunSpeed.setEnabled(false); if (!metric) { txtThickness.setText("0.79"); txtUnwindAmount.setText("32810"); txtRewindAmount.setText("3281.0"); txtLimitRunSpeed.setText("2624.8"); txtTargetTotal.setText("32810"); txtWebWidth.setText("53.15"); txtSlitWidth.setText("53.15"); lblTrim.setText("0 in"); } } catch (IllegalStateException e1) { e1.printStackTrace(); } catch (NullPointerException e) { } }
From source file:nz.govt.natlib.ndha.manualdeposit.StructMapFileDescMgmtPresenter.java
StructMapFileDescMgmtPresenter(final JList lstDescription, final JTextField textfldDescription, final JTextField textfldFilePrefix, final JCheckBox checkAllowMultiples, final JCheckBox checkMandatory, final JComboBox cmbPosition, final JTextField textfldDescriptionMain, final JCheckBox checkExtraLayers, final JTextField textfldDescriptionL2, final JTextField textfldFilePrefixL2, final JCheckBox checkAllowMultiplesL2, final JTextField textfldDescriptionL3, final JTextField textfldFilePrefixL3, final JCheckBox checkAllowMultiplesL3, final JTextField textfldDescriptionL4, final JTextField textfldFilePrefixL4, final JCheckBox checkAllowMultiplesL4, final JButton btnAddNew, final JButton btnDelete, final JButton btnSave, final JButton btnCancel, final JButton btnClose, final JButton btnMoveUp, final JButton btnMoveDown, final JButton btnGenMainDesc, final String xmlFileName, final IStructMapFileDescManagement theForm) { jlstDescription = lstDescription;//w w w. j a v a2s . c o m this.textfldDescription = textfldDescription; this.textfldFilePrefix = textfldFilePrefix; this.checkAllowMultiples = checkAllowMultiples; this.checkMandatory = checkMandatory; cmboPosition = cmbPosition; this.checkExtraLayers = checkExtraLayers; this.textfldDescriptionMain = textfldDescriptionMain; // Extra Layers extraLayers = new HashMap<String, JComponent>(); extraLayers.put(textfldDescriptionL2.getName(), textfldDescriptionL2); extraLayers.put(textfldFilePrefixL2.getName(), textfldFilePrefixL2); extraLayers.put(checkAllowMultiplesL2.getName(), checkAllowMultiplesL2); extraLayers.put(textfldDescriptionL3.getName(), textfldDescriptionL3); extraLayers.put(textfldFilePrefixL3.getName(), textfldFilePrefixL3); extraLayers.put(checkAllowMultiplesL3.getName(), checkAllowMultiplesL3); extraLayers.put(textfldDescriptionL4.getName(), textfldDescriptionL4); extraLayers.put(textfldFilePrefixL4.getName(), textfldFilePrefixL4); extraLayers.put(checkAllowMultiplesL4.getName(), checkAllowMultiplesL4); bttnAddNew = btnAddNew; bttnDelete = btnDelete; bttnSave = btnSave; bttnCancel = btnCancel; bttnClose = btnClose; bttnMoveUp = btnMoveUp; bttnMoveDown = btnMoveDown; bttnGenMainDesc = btnGenMainDesc; theXmlFileName = xmlFileName; theStructForm = theForm; loadData(); // Restrict the values of this combo box to that of possible "Position" // enums cmboPosition.setModel(new DefaultComboBoxModel(FileType.Position.values())); // Restrict the contents of the description and file prefix to not allow // special characters textfldDescription.setDocument(new SpecialCharFilterDocument()); textfldFilePrefix.setDocument(new SpecialCharFilterDocument()); loadListData(); addEventHandlers(); checkButtons(); }
From source file:op.care.info.DlgDiag.java
private void btnAddGPActionPerformed(ActionEvent e) { final PnlEditGP pnlGP = new PnlEditGP(new GP()); JidePopup popup = GUITools.createPanelPopup(pnlGP, new Closure() { @Override//from w ww . j a va2s .co m public void execute(Object o) { if (o != null) { GP gp = EntityTools.merge((GP) o); cmbArzt.setModel(new DefaultComboBoxModel(new GP[] { gp })); } } }, btnAddGP); GUITools.showPopup(popup, SwingConstants.EAST); }