List of usage examples for javax.swing WindowConstants DISPOSE_ON_CLOSE
int DISPOSE_ON_CLOSE
To view the source code for javax.swing WindowConstants DISPOSE_ON_CLOSE.
Click Source Link
From source file:org.ut.biolab.medsavant.client.variant.VariantWorker.java
@Override protected void showSuccess(Void result) { progressBar.setIndeterminate(false); progressBar.setValue(100);//from w ww. j a va 2 s . c o m progressLabel.setText(String.format("%s complete.", activity)); workButton.setEnabled(false); wizard.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); }
From source file:org.ut.biolab.medsavant.client.variant.VariantWorker.java
@Override protected void showFailure(Throwable ex) { progressBar.setIndeterminate(false); progressBar.setValue(0);//from w w w . j a v a 2 s. c om wizard.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); if (ex instanceof InterruptedException) { // Cancellation progressLabel.setText(String.format("%s cancelled.", activity)); workButton.setText("Cancel"); } else { // Failure ClientMiscUtils.checkSQLException(ex); progressLabel.setForeground(Color.RED); progressLabel.setText(ex.getMessage()); LOG.error(activity + " failed.", ex); } }
From source file:org.yccheok.jstock.gui.StockJDialog.java
/** This method is called from within the constructor to * initialize the form.//from w w w . java 2 s .c o m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { buttonGroup1 = new javax.swing.ButtonGroup(); jPanel4 = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); jRadioButton2 = new javax.swing.JRadioButton(); jRadioButton3 = new javax.swing.JRadioButton(); jPanel2 = new javax.swing.JPanel(); jCheckBox1 = new javax.swing.JCheckBox(); jCheckBox2 = new javax.swing.JCheckBox(); jCheckBox3 = new javax.swing.JCheckBox(); jCheckBox21 = new javax.swing.JCheckBox(); jCheckBox4 = new javax.swing.JCheckBox(); jCheckBox23 = new javax.swing.JCheckBox(); jCheckBox25 = new javax.swing.JCheckBox(); jCheckBox26 = new javax.swing.JCheckBox(); jCheckBox27 = new javax.swing.JCheckBox(); jRadioButton4 = new javax.swing.JRadioButton(); jPanel3 = new javax.swing.JPanel(); jCheckBox5 = new javax.swing.JCheckBox(); jCheckBox6 = new javax.swing.JCheckBox(); jCheckBox7 = new javax.swing.JCheckBox(); jCheckBox8 = new javax.swing.JCheckBox(); jCheckBox9 = new javax.swing.JCheckBox(); jCheckBox10 = new javax.swing.JCheckBox(); jCheckBox11 = new javax.swing.JCheckBox(); jCheckBox12 = new javax.swing.JCheckBox(); jCheckBox13 = new javax.swing.JCheckBox(); jCheckBox14 = new javax.swing.JCheckBox(); jCheckBox15 = new javax.swing.JCheckBox(); jCheckBox16 = new javax.swing.JCheckBox(); jCheckBox17 = new javax.swing.JCheckBox(); jCheckBox18 = new javax.swing.JCheckBox(); jCheckBox19 = new javax.swing.JCheckBox(); jCheckBox20 = new javax.swing.JCheckBox(); jCheckBox22 = new javax.swing.JCheckBox(); jCheckBox24 = new javax.swing.JCheckBox(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/yccheok/jstock/data/gui"); // NOI18N setTitle(bundle.getString("StockJDialog_SelectStock")); // NOI18N setResizable(false); getContentPane().setLayout(new java.awt.BorderLayout(5, 5)); jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/apply.png"))); // NOI18N jButton1.setText(bundle.getString("StockJDialog_OK")); // NOI18N jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jPanel4.add(jButton1); jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/button_cancel.png"))); // NOI18N jButton2.setText(bundle.getString("StockJDialog_Cancel")); // NOI18N jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jPanel4.add(jButton2); getContentPane().add(jPanel4, java.awt.BorderLayout.SOUTH); jPanel1.setBorder( javax.swing.BorderFactory.createTitledBorder(bundle.getString("StockJDialog_TypeOfStock"))); // NOI18N buttonGroup1.add(jRadioButton2); jRadioButton2.setSelected(true); jRadioButton2.setText(bundle.getString("StockJDialog_SelectEntireStockMarket")); // NOI18N jRadioButton2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jRadioButton2.setMargin(new java.awt.Insets(0, 0, 0, 0)); jRadioButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton2ActionPerformed(evt); } }); buttonGroup1.add(jRadioButton3); jRadioButton3.setText(bundle.getString("StockJDialog_SelectBasedOnBoard")); // NOI18N jRadioButton3.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jRadioButton3.setMargin(new java.awt.Insets(0, 0, 0, 0)); jRadioButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton3ActionPerformed(evt); } }); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("StockJDialog_Board"))); // NOI18N jCheckBox1.setText("Main board"); jCheckBox1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox1.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox2.setText("Second board"); jCheckBox2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox2.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox3.setText("Call warrant"); jCheckBox3.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox3.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox21.setText("Mesdaq"); jCheckBox21.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox21.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox4.setText("Call warrant"); jCheckBox4.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox4.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox23.setText("Call warrant"); jCheckBox23.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox23.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox25.setText("Call warrant"); jCheckBox25.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox25.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox26.setText("Call warrant"); jCheckBox26.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox26.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox27.setText("Call warrant"); jCheckBox27.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox27.setMargin(new java.awt.Insets(0, 0, 0, 0)); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jCheckBox25).addComponent(jCheckBox1).addComponent(jCheckBox3)) .addGap(51, 51, 51) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jCheckBox4).addComponent(jCheckBox26).addComponent(jCheckBox2)) .addGap(35, 35, 35) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jCheckBox27, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE) .addComponent(jCheckBox23, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE) .addComponent(jCheckBox21, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE)) .addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCheckBox1).addComponent(jCheckBox2).addComponent(jCheckBox21)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCheckBox3).addComponent(jCheckBox4).addComponent(jCheckBox23)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCheckBox25).addComponent(jCheckBox26).addComponent(jCheckBox27)) .addContainerGap(16, Short.MAX_VALUE))); buttonGroup1.add(jRadioButton4); jRadioButton4.setText(bundle.getString("StockJDialog_SelectBasedOnIndustry")); // NOI18N jRadioButton4.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jRadioButton4.setMargin(new java.awt.Insets(0, 0, 0, 0)); jRadioButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton4ActionPerformed(evt); } }); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("StockJDialog_Industry"))); // NOI18N jCheckBox5.setText("Consumer products"); jCheckBox5.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox5.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox6.setText("Trading / Services"); jCheckBox6.setActionCommand("Trading/Services"); jCheckBox6.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox6.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox7.setText("Industrial products"); jCheckBox7.setActionCommand("Industry Product"); jCheckBox7.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox7.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox8.setText("Technology"); jCheckBox8.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox8.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox9.setText("Construction"); jCheckBox9.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox9.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox10.setText("Infrastructure"); jCheckBox10.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox10.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox11.setText("Finance"); jCheckBox11.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox11.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox12.setText("Hotels"); jCheckBox12.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox12.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox13.setText("Properties"); jCheckBox13.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox13.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox14.setText("Plantation"); jCheckBox14.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox14.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox15.setText("Mining"); jCheckBox15.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox15.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox16.setText("Trusts"); jCheckBox16.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox16.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox17.setText("Close-end fund"); jCheckBox17.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox17.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox18.setText("ETF"); jCheckBox18.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox18.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox19.setText("Call warrant"); jCheckBox19.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox19.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox20.setText("Unknown"); jCheckBox20.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox20.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox22.setText("Loans"); jCheckBox22.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox22.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox24.setText("Unknown"); jCheckBox24.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox24.setMargin(new java.awt.Insets(0, 0, 0, 0)); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jCheckBox5).addComponent(jCheckBox6).addComponent(jCheckBox11) .addComponent(jCheckBox14).addComponent(jCheckBox17).addComponent(jCheckBox19)) .addGap(13, 13, 13) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jCheckBox7).addComponent(jCheckBox8).addComponent(jCheckBox12) .addComponent(jCheckBox15).addComponent(jCheckBox18).addComponent(jCheckBox20)) .addGap(14, 14, 14) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jCheckBox24).addComponent(jCheckBox22).addComponent(jCheckBox16) .addComponent(jCheckBox13).addComponent(jCheckBox10).addComponent(jCheckBox9)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCheckBox5).addComponent(jCheckBox7).addComponent(jCheckBox9)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCheckBox6).addComponent(jCheckBox8).addComponent(jCheckBox10)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCheckBox11).addComponent(jCheckBox12).addComponent(jCheckBox13)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCheckBox14).addComponent(jCheckBox15).addComponent(jCheckBox16)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCheckBox17).addComponent(jCheckBox18).addComponent(jCheckBox22)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCheckBox20).addComponent(jCheckBox19).addComponent(jCheckBox24)) .addContainerGap(14, Short.MAX_VALUE))); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addComponent(jRadioButton4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jRadioButton2) .addGroup(jPanel1Layout.createSequentialGroup().addComponent(jRadioButton3) .addGap(16, 16, 16).addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addContainerGap())); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(jRadioButton2) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jRadioButton3).addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jRadioButton4).addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER); pack(); }
From source file:pcgen.gui2.dialog.AboutDialog.java
public AboutDialog(PCGenFrame frame) { super(frame, LanguageBundle.getString("in_abt_title"), true); //$NON-NLS-1$ getContentPane().setLayout(new BorderLayout()); getContentPane().add(new MainAbout(), BorderLayout.CENTER); pack();//from w w w . java 2 s .c o m setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); Utility.setComponentRelativeLocation(frame, this); Utility.installEscapeCloseOperation(this); }
From source file:pcgen.gui2.dialog.ChooserDialog.java
private void initComponents() { setTitle(chooser.getName());// www . j a v a 2 s. c om setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { //detach listeners from the chooser treeViewModel.setDelegate(null); listModel.setListFacade(null); chooser.getRemainingSelections().removeReferenceListener(ChooserDialog.this); } }); Container pane = getContentPane(); pane.setLayout(new BorderLayout()); JSplitPane split = new JSplitPane(); JPanel leftPane = new JPanel(new BorderLayout()); if (availTable != null) { availTable.setAutoCreateRowSorter(true); availTable.setTreeViewModel(treeViewModel); availTable.getRowSorter().toggleSortOrder(0); availTable.addActionListener(this); leftPane.add(new JScrollPane(availTable), BorderLayout.CENTER); } else { availInput.addActionListener(this); Dimension maxDim = new Dimension(Integer.MAX_VALUE, availInput.getPreferredSize().height); availInput.setMaximumSize(maxDim); JPanel availPanel = new JPanel(); availPanel.setLayout(new BoxLayout(availPanel, BoxLayout.PAGE_AXIS)); availPanel.add(Box.createRigidArea(new Dimension(10, 30))); availPanel.add(Box.createVerticalGlue()); availPanel.add(new JLabel(LanguageBundle.getString("in_uichooser_value"))); availPanel.add(availInput); availPanel.add(Box.createVerticalGlue()); leftPane.add(availPanel, BorderLayout.WEST); } JPanel buttonPane1 = new JPanel(new FlowLayout()); JButton addButton = new JButton(chooser.getAddButtonName()); addButton.setActionCommand("ADD"); addButton.addActionListener(this); buttonPane1.add(addButton); buttonPane1.add(new JLabel(Icons.Forward16.getImageIcon())); leftPane.add(buttonPane1, BorderLayout.SOUTH); split.setLeftComponent(leftPane); JPanel rightPane = new JPanel(new BorderLayout()); JPanel labelPane = new JPanel(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridwidth = GridBagConstraints.REMAINDER; labelPane.add(new JLabel(chooser.getSelectionCountName()), new GridBagConstraints()); remainingLabel.setText(chooser.getRemainingSelections().get().toString()); labelPane.add(remainingLabel, gbc); labelPane.add(new JLabel(chooser.getSelectedTableTitle()), gbc); rightPane.add(labelPane, BorderLayout.NORTH); list.setModel(listModel); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); list.addActionListener(this); rightPane.add(new JScrollPane(list), BorderLayout.CENTER); JPanel buttonPane2 = new JPanel(new FlowLayout()); buttonPane2.add(new JLabel(Icons.Back16.getImageIcon())); JButton removeButton = new JButton(chooser.getRemoveButtonName()); removeButton.setActionCommand("REMOVE"); removeButton.addActionListener(this); buttonPane2.add(removeButton); rightPane.add(buttonPane2, BorderLayout.SOUTH); split.setRightComponent(rightPane); if (chooser.isInfoAvailable()) { JSplitPane infoSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT); infoSplit.setTopComponent(split); infoSplit.setBottomComponent(infoPane); infoSplit.setResizeWeight(0.8); pane.add(infoSplit, BorderLayout.CENTER); if (availTable != null) { availTable.getSelectionModel().addListSelectionListener(this); } } else { pane.add(split, BorderLayout.CENTER); } JPanel bottomPane = new JPanel(new FlowLayout()); JButton button = new JButton(LanguageBundle.getString("in_ok")); //$NON-NLS-1$ button.setMnemonic(LanguageBundle.getMnemonic("in_mn_ok")); //$NON-NLS-1$ button.setActionCommand("OK"); button.addActionListener(this); bottomPane.add(button); button = new JButton(LanguageBundle.getString("in_cancel")); //$NON-NLS-1$ button.setMnemonic(LanguageBundle.getMnemonic("in_mn_cancel")); //$NON-NLS-1$ button.setActionCommand("CANCEL"); button.addActionListener(this); bottomPane.add(button); pane.add(bottomPane, BorderLayout.SOUTH); }
From source file:pcgen.gui2.dialog.ExportDialog.java
private void initComponents() { characterBox.setRenderer(new DefaultListCellRenderer() { @Override/*from www . ja v a2s .co m*/ public Component getListCellRendererComponent(JList<? extends Object> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { CharacterFacade character = (CharacterFacade) value; return super.getListCellRendererComponent(list, character.getNameRef().get(), index, isSelected, cellHasFocus); } }); fileList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); fileList.addListSelectionListener(this); exportButton.setDefaultCapable(true); getRootPane().setDefaultButton(exportButton); partyBox.setActionCommand(PARTY_COMMAND); exportBox.setActionCommand(EXPORT_TO_COMMAND); exportButton.setActionCommand(EXPORT_COMMAND); closeButton.setActionCommand(CLOSE_COMMAND); exportBox.addActionListener(this); partyBox.addActionListener(this); exportButton.addActionListener(this); closeButton.addActionListener(this); exportButton.setEnabled(false); progressBar.setStringPainted(true); progressBar.setString("Loading Templates"); progressBar.setIndeterminate(true); setTitle("Export a PC or Party"); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); UIPropertyContext context = UIPropertyContext.createContext("ExportDialog"); String defaultOSType = context.getProperty(UIPropertyContext.DEFAULT_OS_TYPE); if (defaultOSType != null) { for (SheetFilter filter : SheetFilter.values()) { if (defaultOSType.equals(filter.toString())) { exportBox.setSelectedItem(filter); } } } }
From source file:pipeline.GUI_utils.ListOfPointsView.java
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override/* w w w . j a va2s . c o m*/ public void show() { if (frame != null) frame.toFront(); if (table == null) { spreadsheetEngine = new DependencyEngine(new BasicEngineProvider()); setupTableModel(points); silenceUpdates.incrementAndGet(); table = new JXTablePerColumnFiltering(tableModel); table.setRolloverEnabled(true); // table.setDragEnabled(true); table.setFillsViewportHeight(false); table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); table.setShowGrid(true); table.setShowHorizontalLines(true); table.setColumnSelectionAllowed(true); table.setRowSelectionAllowed(true); table.setColumnControlVisible(true); table.setHighlighters(new Highlighter[] { HighlighterFactory.createAlternateStriping() }); table.addPropertyChangeListener("horizontalScrollEnabled", new PropertyChangeListener() { JViewport viewPort, filteringViewPort, columnDescViewPort; int lastX; ChangeListener scrollListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { if (viewPort == null || filteringViewPort == null) { return; } Point position = viewPort.getViewPosition(); if (position.x == lastX) { return; } filteringViewPort.setViewPosition(position); columnDescViewPort.setViewPosition(position); lastX = position.x; } }; @Override public void propertyChange(PropertyChangeEvent evt) { if (viewPort != null) { viewPort.removeChangeListener(scrollListener); } if (evt.getNewValue().equals(true)) { viewPort = getTableViewPort(table); if (viewPort == null) { return; } table.filteringTable.setHorizontalScrollEnabled(true); table.tableForColumnDescriptions.setHorizontalScrollEnabled(true); table.updateFilteringTableSetup(); filteringViewPort = getTableViewPort(table.filteringTable); columnDescViewPort = getTableViewPort(table.tableForColumnDescriptions); viewPort.addChangeListener(scrollListener); scrollListener.stateChanged(null); } else { table.filteringTable.setHorizontalScrollEnabled(false); table.tableForColumnDescriptions.setHorizontalScrollEnabled(false); } } }); modelForColumnDescriptions = new dataModelAllEditable(1, tableModel.getColumnCount()); Vector<String> rowVector0 = (Vector<String>) modelForColumnDescriptions.getDataVector().get(0); for (int j = 0; j < tableModel.getColumnCount(); j++) { rowVector0.setElementAt(tableModel.getColumnName(j), j); } boolean done; do { done = true; for (TableColumn i : table.getColumns(true)) { TableColumnExt iCast = (TableColumnExt) i; if (iCast.getTitle().equals("Class") || iCast.getTitle().equals("c") || iCast.getTitle().equals("t") || iCast.getTitle().equals("clusterID") || iCast.getTitle().equals("userCell 2") || iCast.getTitle().equals("userCell 3")) { if (iCast.isVisible()) { iCast.setVisible(false); done = false; break; } } } } while (!done); SwingUtilities.invokeLater(modelForColumnDescriptions::fireTableDataChanged); JScrollPane scrollPane = new JScrollPane(table); scrollPane.setPreferredSize(new Dimension(2000, 2000)); updateColumnDescriptions(); silenceUpdates.decrementAndGet(); setSpreadsheetColumnEditorAndRenderer(); tableForColumnDescriptions = new JXTable(modelForColumnDescriptions); table.tableForColumnDescriptions = tableForColumnDescriptions; JScrollPane jScrollPaneForNames = new JScrollPane(tableForColumnDescriptions); jScrollPaneForNames.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); JPanel controlPanel = new JPanel(); controlPanel.setLayout(new FlowLayout()); JButton createScatterPlotButton = new JButton("Scatter plot from selected columns"); controlPanel.add(createScatterPlotButton); createScatterPlotButton.setActionCommand("Scatter plot from selected columns"); createScatterPlotButton.addActionListener(this); realTimeUpdateCheckbox = new JCheckBox("Update display in real time"); controlPanel.add(realTimeUpdateCheckbox); realTimeUpdateCheckbox.setActionCommand("Update display in real time"); realTimeUpdateCheckbox.addActionListener(this); JButton forceUpdate = new JButton("Force display update"); controlPanel.add(forceUpdate); forceUpdate.setActionCommand("Force display update"); forceUpdate.addActionListener(this); JButton extendFormula = new JButton("Extend formula to column"); controlPanel.add(extendFormula); extendFormula.setActionCommand("Extend formula to column"); extendFormula.addActionListener(this); JButton saveFormulas = new JButton("Save user formulas..."); saveFormulas.addActionListener(this); saveFormulas.setActionCommand("Save user formulas"); controlPanel.add(saveFormulas); JButton reloadFormulas = new JButton("Reload user formulas..."); reloadFormulas.addActionListener(this); reloadFormulas.setActionCommand("Reload user formulas"); controlPanel.add(reloadFormulas); controlPanel.add(new JLabel("Color with:")); coloringComboBox = new JComboBox(); controlPanel.add(coloringComboBox); DefaultComboBoxModel comboBoxModel = (DefaultComboBoxModel) coloringComboBox.getModel(); coloringComboBox.addActionListener(this); for (int i = 0; i < tableModel.getColumnCount(); i++) { comboBoxModel.addElement(tableModel.getColumnName(i)); } JButton saveTableToFile = new JButton("Save table to file"); controlPanel.add(saveTableToFile); saveTableToFile.setActionCommand("Save table to file"); saveTableToFile.addActionListener(this); /* final JCheckBox useCalibration = new JCheckBox("Use calibration"); useCalibration.addActionListener(e -> { if (points == null) return; boolean selected = useCalibration.isSelected(); if (selected && !(points instanceof PluginIOCalibrable)) { Utils.displayMessage("Type " + points.getClass().getName() + " does not have calibration", true, LogLevel.ERROR); return; } PluginIOCalibrable calibrable = (PluginIOCalibrable) points; if (selected && (calibrable.getCalibration() == null)) { Utils.displayMessage("Calibration information is not present in the segmentation; one " + "way of adding it is to give the source image (with calibration) as an input " + "to the active contour plugin", true, LogLevel.ERROR); return; } float xyCalibration = selected ? ((float) calibrable.getCalibration().pixelWidth) : 0; float zCalibration = selected ? ((float) calibrable.getCalibration().pixelDepth) : 0; updateCalibration(xyCalibration, zCalibration); }); PluginIOCalibrable calibrable = null; if (points instanceof PluginIOCalibrable) calibrable = (PluginIOCalibrable) points; boolean calibrationPresent = calibrable != null && calibrable.getCalibration() != null; useCalibration.setSelected(calibrationPresent); if (calibrationPresent) { updateCalibration((float) calibrable.getCalibration().pixelWidth, (float) calibrable.getCalibration().pixelDepth); } controlPanel.add(useCalibration); */ frame = new JFrame(points.getName()); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); listener = new WindowListenerWeakRef(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { close();// So all references to data are nulled, to ensure garbage collection } }); frame.addWindowListener(listener); frame.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.gridx = 0; c.gridy = GridBagConstraints.RELATIVE; c.weighty = 0.75; c.weightx = 1.0; c.gridwidth = 1; c.gridheight = 1; frame.add(scrollPane, c); c.weighty = 0.0; JScrollPane scrollPane2 = new JScrollPane(table.filteringTable); scrollPane2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane2.setMinimumSize(new Dimension(1, 250)); frame.add(scrollPane2, c); c.weighty = 0.0; jScrollPaneForNames.setMinimumSize(new Dimension(1, 40)); jScrollPaneForNames.setMaximumSize(new Dimension(9999999, 40)); frame.add(jScrollPaneForNames, c); c.weighty = 0.0; c.fill = GridBagConstraints.HORIZONTAL; controlPanel.setMinimumSize(new Dimension(1, 80)); frame.add(controlPanel, c); table.setHorizontalScrollEnabled(true); table.updateFilteringTableSetup(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int height = screenSize.height; int width = screenSize.width; frame.setSize((int) (0.67 * width), height / 2); frame.setLocation((int) (0.33 * width), height / 2); frame.setVisible(true); } if ((tableUpdateThread == null) || (!tableUpdateThread.isAlive())) { tableUpdateThread = new Thread(() -> { try { checkForDirtiness(); } catch (Exception e) { Utils.log("Exception in ListOfPointsView GUI update thread", LogLevel.ERROR); Utils.printStack(e); } }, "ListOfPointsView GUI update thread"); tableUpdateThread.start(); } }
From source file:pl.kotcrab.arget.gui.MainWindow.java
private void createAndShowGUI() { setTitle(App.APP_NAME);//from w ww . j a v a2 s .c o m setBounds(100, 100, 800, 700); setMinimumSize(new Dimension(500, 250)); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); setIconImage(App.loadImage("/data/icon/icon.png")); sessionWindowManager = new SessionWindowManager(this); if (profile.mainWindowBounds != null && GraphicsUtils.isRectangleDisplayableOnScreen(profile.mainWindowBounds)) setBounds(profile.mainWindowBounds); createMenuBars(); contactsPanel = new ContactsPanel(profile, this); statusPane = new JTextPane(); statusPane.setBorder(new EmptyBorder(1, 3, 2, 0)); statusPane.setContentType("text/html"); statusPane.setBackground(null); statusPane.setHighlighter(null); statusPane.setEditable(false); statusPane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, true); statusPane.setFont(new Font("Tahoma", Font.PLAIN, 13)); statusPane.addHyperlinkListener(new HyperlinkListener() { @Override public void hyperlinkUpdate(HyperlinkEvent e) { if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())) { String desc = e.getDescription(); if (desc.startsWith("version-mismatch")) { desc = desc.substring(desc.indexOf("://") + 3); String[] versionInfo = desc.split("!"); new VersionMismatchDialog(MainWindow.instance, versionInfo[0], Integer.valueOf(versionInfo[1])); } } } }); JPanel bottomPanel = new JPanel(new BorderLayout(0, 0)); getContentPane().add(bottomPanel, BorderLayout.SOUTH); scrollLockToggle = new WebToggleButton(); scrollLockToggle.setToolTipText("Scroll lock"); scrollLockToggle.setRolloverDecoratedOnly(true); scrollLockToggle.setDrawFocus(false); scrollLockToggle.setIcon(App.loadImageIcon("/data/scrolllock.png")); scrollLockToggle.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { postScrollLockUpdate(); } }); bottomPanel.add(statusPane); bottomPanel.add(scrollLockToggle, BorderLayout.EAST); splitPane = new JSplitPane(); splitPane.setBorder(new BottomSplitPaneBorder()); splitPane.setResizeWeight(0); splitPane.setContinuousLayout(true); splitPane.setOneTouchExpandable(true); getContentPane().add(splitPane, BorderLayout.CENTER); homePanel = new HomePanel(profile.fileName); logPanel = new LoggerPanel(); errorStatusPanel = new ErrorStatusPanel(); JPanel leftPanel = new JPanel(new BorderLayout()); leftPanel.add(contactsPanel, BorderLayout.CENTER); leftPanel.add(errorStatusPanel, BorderLayout.SOUTH); splitPane.setLeftComponent(leftPanel); splitPane.setRightComponent(null); setCenterScreenTo(homePanel); addWindowFocusListener(new WindowAdapter() { @Override public void windowGainedFocus(WindowEvent e) { instance.validate(); instance.revalidate(); instance.repaint(); getCenterScreen().onShow(); } @Override public void windowLostFocus(WindowEvent e) { getCenterScreen().onHide(); } }); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent evt) { ExitCleaner.forceExit(); } }); setVisible(true); }
From source file:plugins.tprovoost.Microscopy.MicroManagerForIcy.MMMainFrame.java
public void customClose() { if (getInternalFrame().getDefaultCloseOperation() == WindowConstants.DO_NOTHING_ON_CLOSE) { if (!_list_plugin.isEmpty()) { if (!ConfirmDialog.confirm("Some plugins are still running. Are you sure you want to close this ?")) return; }//from w ww. j a v a 2s .c om if (painterPreferences != null) painterPreferences.saveColors(); _pluginListEmpty = true; setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); close(); Icy.getMainInterface().removeCanExitListener(acceptListener); } }
From source file:repast.simphony.visualization.gui.styleBuilder.EditedStyleDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license dialogPane = new JPanel(); buttonBar = new JPanel(); okButton = new JButton(); cancelButton = new JButton(); panel1 = new JPanel(); shapePanel = new JPanel(); shapeComboBox = new JComboBox(); iconColorbutton = new JButton(); iconButton = new JButton(); clearFileButton = new JButton(); textureButton = new JButton(); clearTextureButton = new JButton(); previewPanel = new JPanel(); panel3 = new JPanel(); label1 = new JLabel(); label2 = new JLabel(); label3 = new JLabel(); label4 = new JLabel(); sizeComboBox = new JComboBox(); sizeMinComboBox = new JComboBox(); sizeMaxComboBox = new JComboBox(); sizeScaleComboBox = new JComboBox(); panel4 = new JPanel(); label5 = new JLabel(); label6 = new JLabel(); label7 = new JLabel(); label19 = new JLabel(); labelComboBox = new JComboBox(); labelPositionComboBox = new JComboBox(); labelOffsetTextField = new JTextField(); labelPrecisionComboBox = new JComboBox(); panel2 = new JPanel(); label8 = new JLabel(); label9 = new JLabel(); label10 = new JLabel(); label11 = new JLabel(); labelFontFamilyComboBox = new JComboBox(); labelFontSizeComboBox = new JComboBox(); labelFontStyleComboBox = new JComboBox(); fontColorButton = new JButton(); panel6 = new JPanel(); label15 = new JLabel(); label16 = new JLabel(); label17 = new JLabel(); label18 = new JLabel(); label12 = new JLabel(); redValueComboBox = new JComboBox(); redMinComboBox = new JComboBox(); redMaxComboBox = new JComboBox(); redScaleComboBox = new JComboBox(); label13 = new JLabel(); greenValueComboBox = new JComboBox(); greenMinComboBox = new JComboBox(); greenMaxComboBox = new JComboBox(); greenScaleComboBox = new JComboBox(); label14 = new JLabel(); blueValueComboBox = new JComboBox(); blueMinComboBox = new JComboBox(); blueMaxComboBox = new JComboBox(); blueScaleComboBox = new JComboBox(); CellConstraints cc = new CellConstraints(); //======== this ======== setModal(true);// w w w. j a va2 s . co m setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.DIALOG); dialogPane.setLayout(new BorderLayout()); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_PAD); buttonBar.setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.GLUE_COLSPEC, FormSpecs.BUTTON_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref"))); //---- okButton ---- okButton.setText("OK"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okButtonActionPerformed(e); } }); buttonBar.add(okButton, cc.xy(2, 1)); //---- cancelButton ---- cancelButton.setText("Cancel"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelButtonActionPerformed(e); } }); buttonBar.add(cancelButton, cc.xy(4, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); //======== panel1 ======== { panel1.setLayout(new FormLayout( new ColumnSpec[] { ColumnSpec.decode("left:max(default;166dlu):grow"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(133)), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC })); //======== shapePanel ======== { shapePanel.setBorder(new TitledBorder("Icon Shape and Color")); shapePanel.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(79)), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(17)) })); //---- shapeComboBox ---- shapeComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { shapeComboBoxActionPerformed(e); } }); shapePanel.add(shapeComboBox, cc.xy(1, 1)); //---- iconColorbutton ---- iconColorbutton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { iconColorbuttonActionPerformed(e); } }); shapePanel.add(iconColorbutton, cc.xy(3, 1)); //---- iconButton ---- iconButton.setText("text"); iconButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { iconButtonActionPerformed(e); } }); shapePanel.add(iconButton, cc.xy(1, 5)); //---- clearFileButton ---- clearFileButton.setText("text"); clearFileButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { clearFileButtonActionPerformed(e); } }); shapePanel.add(clearFileButton, cc.xy(3, 5)); //---- textureButton ---- textureButton.setText("Select Texture"); textureButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { textureButtonActionPerformed(e); } }); shapePanel.add(textureButton, cc.xy(1, 7)); //---- clearTextureButton ---- clearTextureButton.setText("Clear Texture"); clearTextureButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { clearTextureButtonActionPerformed(e); } }); shapePanel.add(clearTextureButton, cc.xy(3, 7)); } panel1.add(shapePanel, cc.xywh(1, 1, 2, 1)); //======== previewPanel ======== { previewPanel.setBorder(new TitledBorder("Icon Preview")); previewPanel.setLayout(new FormLayout("101dlu:grow", "top:57dlu:grow")); } panel1.add(previewPanel, cc.xywh(5, 1, 3, 1, CellConstraints.DEFAULT, CellConstraints.TOP)); //======== panel3 ======== { panel3.setBorder(new TitledBorder("Icon Size")); panel3.setLayout(new FormLayout( new ColumnSpec[] { ColumnSpec.decode("max(pref;66dlu)"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC })); //---- label1 ---- label1.setText("Value"); panel3.add(label1, cc.xy(1, 1)); //---- label2 ---- label2.setText("Minimum"); panel3.add(label2, cc.xy(5, 1)); //---- label3 ---- label3.setText("Maximum"); panel3.add(label3, cc.xy(9, 1)); //---- label4 ---- label4.setText("Scaling"); panel3.add(label4, cc.xy(13, 1)); //---- sizeComboBox ---- sizeComboBox.setEditable(true); sizeComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { sizeComboBoxActionPerformed(e); } }); panel3.add(sizeComboBox, cc.xy(1, 3)); //---- sizeMinComboBox ---- sizeMinComboBox.setEditable(true); sizeMinComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { sizeMinComboBoxActionPerformed(e); } }); panel3.add(sizeMinComboBox, cc.xy(5, 3)); //---- sizeMaxComboBox ---- sizeMaxComboBox.setEditable(true); sizeMaxComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { sizeMaxComboBoxActionPerformed(e); } }); panel3.add(sizeMaxComboBox, cc.xy(9, 3)); //---- sizeScaleComboBox ---- sizeScaleComboBox.setEditable(true); sizeScaleComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { sizeScaleComboBoxActionPerformed(e); } }); panel3.add(sizeScaleComboBox, cc.xy(13, 3)); } panel1.add(panel3, cc.xywh(1, 3, 7, 1)); //======== panel4 ======== { panel4.setBorder(new TitledBorder("Icon Label")); panel4.setLayout(new FormLayout( new ColumnSpec[] { ColumnSpec.decode("max(pref;67dlu)"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(33)), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC })); //---- label5 ---- label5.setText("Value"); panel4.add(label5, cc.xy(1, 1)); //---- label6 ---- label6.setText("Position"); panel4.add(label6, cc.xy(5, 1)); //---- label7 ---- label7.setText("Offset"); panel4.add(label7, cc.xy(9, 1)); //---- label19 ---- label19.setText("Precision"); panel4.add(label19, cc.xy(13, 1)); //---- labelComboBox ---- labelComboBox.setEditable(true); labelComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { labelComboBoxActionPerformed(e); } }); panel4.add(labelComboBox, cc.xy(1, 3)); //---- labelPositionComboBox ---- labelPositionComboBox.setEditable(true); labelPositionComboBox .setModel(new DefaultComboBoxModel(new String[] { "bottom", "top", "left", "right" })); labelPositionComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { labelPositionComboBoxActionPerformed(e); } }); panel4.add(labelPositionComboBox, cc.xy(5, 3)); //---- labelOffsetTextField ---- labelOffsetTextField.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { labelOffsetTextFieldActionPerformed(e); } }); panel4.add(labelOffsetTextField, cc.xy(9, 3)); //---- labelPrecisionComboBox ---- labelPrecisionComboBox.setEditable(true); labelPrecisionComboBox.setModel(new DefaultComboBoxModel( new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" })); labelPrecisionComboBox.setSelectedIndex(2); labelPrecisionComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { labelPrecisionComboBoxActionPerformed(e); } }); panel4.add(labelPrecisionComboBox, cc.xy(13, 3)); } panel1.add(panel4, cc.xywh(1, 5, 7, 1)); //======== panel2 ======== { panel2.setBorder(new TitledBorder("Icon Label Font")); panel2.setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC })); //---- label8 ---- label8.setText("Font"); panel2.add(label8, cc.xy(1, 1)); //---- label9 ---- label9.setText("Font Size"); panel2.add(label9, cc.xy(5, 1)); //---- label10 ---- label10.setText("Font Style"); panel2.add(label10, cc.xy(9, 1)); //---- label11 ---- label11.setText("Font Color"); panel2.add(label11, cc.xy(13, 1)); //---- labelFontFamilyComboBox ---- labelFontFamilyComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { labelFontFamilyComboBoxActionPerformed(e); } }); panel2.add(labelFontFamilyComboBox, cc.xy(1, 3)); //---- labelFontSizeComboBox ---- labelFontSizeComboBox.setModel(new DefaultComboBoxModel(new String[] { "8", "10", "11", "12", "14", "16", "18", "20", "24", "30", "36", "40", "48", "60", "72 " })); labelFontSizeComboBox.setEditable(true); labelFontSizeComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { labelFontSizeComboBoxActionPerformed(e); } }); panel2.add(labelFontSizeComboBox, cc.xy(5, 3)); //---- labelFontStyleComboBox ---- labelFontStyleComboBox .setModel(new DefaultComboBoxModel(new String[] { "Plain", "Bold", "Italic" })); labelFontStyleComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { labelFontStyleComboBoxActionPerformed(e); } }); panel2.add(labelFontStyleComboBox, cc.xy(9, 3)); //---- fontColorButton ---- fontColorButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { fontColorButtonActionPerformed(e); } }); panel2.add(fontColorButton, cc.xy(13, 3)); } panel1.add(panel2, cc.xywh(1, 7, 7, 1)); //======== panel6 ======== { panel6.setBorder(new TitledBorder("Variable Icon Color")); panel6.setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC })); //---- label15 ---- label15.setText("Value"); panel6.add(label15, cc.xy(3, 1)); //---- label16 ---- label16.setText("Minimum"); panel6.add(label16, cc.xy(7, 1)); //---- label17 ---- label17.setText("Maximum"); panel6.add(label17, cc.xy(11, 1)); //---- label18 ---- label18.setText("Scaling"); panel6.add(label18, cc.xy(15, 1)); //---- label12 ---- label12.setText("Red"); panel6.add(label12, cc.xy(1, 3)); //---- redValueComboBox ---- redValueComboBox.setEditable(true); redValueComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { redValueComboBoxActionPerformed(e); } }); panel6.add(redValueComboBox, cc.xy(3, 3)); //---- redMinComboBox ---- redMinComboBox.setEditable(true); redMinComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { redMinComboBoxActionPerformed(e); } }); panel6.add(redMinComboBox, cc.xy(7, 3)); //---- redMaxComboBox ---- redMaxComboBox.setEditable(true); redMaxComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { redMaxComboBoxActionPerformed(e); } }); panel6.add(redMaxComboBox, cc.xy(11, 3)); //---- redScaleComboBox ---- redScaleComboBox.setEditable(true); redScaleComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { redScaleComboBoxActionPerformed(e); } }); panel6.add(redScaleComboBox, cc.xy(15, 3)); //---- label13 ---- label13.setText("Green"); panel6.add(label13, cc.xy(1, 5)); //---- greenValueComboBox ---- greenValueComboBox.setEditable(true); greenValueComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { greenValueComboBoxActionPerformed(e); } }); panel6.add(greenValueComboBox, cc.xy(3, 5)); //---- greenMinComboBox ---- greenMinComboBox.setEditable(true); greenMinComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { greenMinComboBoxActionPerformed(e); } }); panel6.add(greenMinComboBox, cc.xy(7, 5)); //---- greenMaxComboBox ---- greenMaxComboBox.setEditable(true); greenMaxComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { greenMaxComboBoxActionPerformed(e); } }); panel6.add(greenMaxComboBox, cc.xy(11, 5)); //---- greenScaleComboBox ---- greenScaleComboBox.setEditable(true); greenScaleComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { greenScaleComboBoxActionPerformed(e); } }); panel6.add(greenScaleComboBox, cc.xy(15, 5)); //---- label14 ---- label14.setText("Blue"); panel6.add(label14, cc.xy(1, 7)); //---- blueValueComboBox ---- blueValueComboBox.setEditable(true); blueValueComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { blueValueComboBoxActionPerformed(e); } }); panel6.add(blueValueComboBox, cc.xy(3, 7)); //---- blueMinComboBox ---- blueMinComboBox.setEditable(true); blueMinComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { blueMinComboBoxActionPerformed(e); } }); panel6.add(blueMinComboBox, cc.xy(7, 7)); //---- blueMaxComboBox ---- blueMaxComboBox.setEditable(true); blueMaxComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { blueMaxComboBoxActionPerformed(e); } }); panel6.add(blueMaxComboBox, cc.xy(11, 7)); //---- blueScaleComboBox ---- blueScaleComboBox.setEditable(true); blueScaleComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { blueScaleComboBoxActionPerformed(e); } }); panel6.add(blueScaleComboBox, cc.xy(15, 7)); } panel1.add(panel6, cc.xywh(1, 9, 7, 1)); } dialogPane.add(panel1, BorderLayout.CENTER); } contentPane.add(dialogPane, BorderLayout.CENTER); setSize(520, 595); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }