List of usage examples for java.awt GridBagConstraints EAST
int EAST
To view the source code for java.awt GridBagConstraints EAST.
Click Source Link
From source file:org.nuxeo.launcher.sync.NuxeoSyncFrame.java
protected Component buildSyncPanel() { syncPanel = new JPanel(); syncPanel.setBackground(new Color(55, 55, 55)); syncPanel.setForeground(Color.WHITE); syncPanel.setLayout(new GridBagLayout()); JLabel l = new JLabel("Server IP", SwingConstants.TRAILING); l.setForeground(Color.WHITE); GridBagConstraints c = new GridBagConstraints(); c.weightx = 1.0;// ww w . ja va 2 s .com c.gridx = 0; c.gridy = 0; c.anchor = GridBagConstraints.EAST; c.insets = new Insets(0, 0, 0, 0); syncPanel.add(l, c); syncServerIpTextField = new JTextField(10); l.setLabelFor(syncServerIpTextField); c.gridx = 1; c.gridy = 0; c.anchor = GridBagConstraints.WEST; syncPanel.add(syncServerIpTextField, c); l = new JLabel("Port", SwingConstants.TRAILING); l.setForeground(Color.WHITE); c.gridx = 0; c.gridy = 2; c.anchor = GridBagConstraints.EAST; syncPanel.add(l, c); syncPortTextField = new JTextField(10); l.setLabelFor(syncPortTextField); c.gridx = 1; c.gridy = 2; c.anchor = GridBagConstraints.WEST; syncPanel.add(syncPortTextField, c); l = new JLabel("Login", SwingConstants.TRAILING); l.setForeground(Color.WHITE); c.gridx = 0; c.gridy = 3; c.anchor = GridBagConstraints.EAST; syncPanel.add(l, c); syncLoginTextField = new JTextField(10); l.setLabelFor(syncLoginTextField); c.gridx = 1; c.gridy = 3; c.anchor = GridBagConstraints.WEST; syncPanel.add(syncLoginTextField, c); l = new JLabel("Password", SwingConstants.TRAILING); l.setForeground(Color.WHITE); c.gridx = 0; c.gridy = 4; c.anchor = GridBagConstraints.EAST; syncPanel.add(l, c); syncPasswordField = new JPasswordField(10); l.setLabelFor(syncPasswordField); c.gridx = 1; c.gridy = 4; c.anchor = GridBagConstraints.WEST; syncPanel.add(syncPasswordField, c); syncButton = new JButton(); c.fill = GridBagConstraints.NONE; c.gridx = 0; c.gridy = 5; c.gridwidth = 2; c.insets = new Insets(10, 0, 0, 0); c.anchor = GridBagConstraints.CENTER; // set the action to the button synchronizeAction = createSyncAction(); syncButton.setAction(synchronizeAction); syncButton.setText("Synchronize"); updateSyncButton(); syncPanel.add(syncButton, c); errorMessageLabel = new JLabel("", SwingConstants.TRAILING); errorMessageLabel.setForeground(Color.RED); c.gridx = 0; c.gridy = 6; c.gridwidth = 2; c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(10, 0, 0, 0); c.anchor = GridBagConstraints.CENTER; syncPanel.add(errorMessageLabel, c); return syncPanel; }
From source file:org.n52.oxf.ui.swing.ChartDialog.java
/** * This method initializes this/*from w ww. jav a 2 s . co m*/ * * @return void */ private void initialize() { this.setSize(dialogWidth, dialogHeight); MyGridBagLayout mainLayout = new MyGridBagLayout(this.getContentPane()); this.getContentPane().setLayout(mainLayout); mainLayout.addComponent(0, timePeriodPanel, 0, 1, 1, 1, 10, 10, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2)); mainLayout.addComponent(1, applyButton, 0, 2, 2, 1, 100, 10, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0)); mainLayout.addComponent(2, nowButton, 1, 1, 1, 1, 10, 10, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(32, 0, 0, 0)); }
From source file:org.kse.gui.dialogs.sign.DSignMidlet.java
private void initComponents() { GridBagConstraints gbcLbl = new GridBagConstraints(); gbcLbl.gridx = 0;/* ww w .ja va 2 s. com*/ gbcLbl.gridwidth = 1; gbcLbl.gridheight = 1; gbcLbl.insets = new Insets(5, 5, 5, 5); gbcLbl.anchor = GridBagConstraints.EAST; gbcLbl.weightx = 0; GridBagConstraints gbcCtrl = new GridBagConstraints(); gbcCtrl.gridx = 1; gbcCtrl.gridwidth = 1; gbcCtrl.gridheight = 1; gbcCtrl.insets = new Insets(5, 5, 5, 5); gbcCtrl.anchor = GridBagConstraints.WEST; gbcCtrl.fill = GridBagConstraints.NONE; gbcCtrl.weightx = 1; GridBagConstraints gbcBrws = new GridBagConstraints(); gbcBrws.gridx = 2; gbcBrws.gridwidth = 1; gbcBrws.gridheight = 1; gbcBrws.insets = new Insets(5, 5, 5, 5); gbcBrws.anchor = GridBagConstraints.WEST; gbcBrws.fill = GridBagConstraints.NONE; gbcBrws.weightx = 1; jlInputJad = new JLabel(res.getString("DSignMidlet.jlInputJad.text")); GridBagConstraints gbc_jlInputJad = (GridBagConstraints) gbcLbl.clone(); gbc_jlInputJad.gridy = 0; jtfInputJad = new JTextField(30); jtfInputJad.setCaretPosition(0); jtfInputJad.setToolTipText(res.getString("DSignMidlet.jtfInputJad.tooltip")); GridBagConstraints gbc_jtfInputJad = (GridBagConstraints) gbcCtrl.clone(); gbc_jtfInputJad.gridy = 0; jbInputJadBrowse = new JButton(res.getString("DSignMidlet.jbInputJadBrowse.text")); PlatformUtil.setMnemonic(jbInputJadBrowse, res.getString("DSignMidlet.jbInputJadBrowse.mnemonic").charAt(0)); jbInputJadBrowse.setToolTipText(res.getString("DSignMidlet.jbInputJadBrowse.tooltip")); jbInputJadBrowse.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DSignMidlet.this); inputJadBrowsePressed(); } finally { CursorUtil.setCursorFree(DSignMidlet.this); } } }); GridBagConstraints gbc_jbInputJadBrowse = (GridBagConstraints) gbcBrws.clone(); gbc_jbInputJadBrowse.gridy = 0; jlSignDirectly = new JLabel(res.getString("DSignMidlet.jlSignDirectly.text")); GridBagConstraints gbc_jlSignDirectly = (GridBagConstraints) gbcLbl.clone(); gbc_jlSignDirectly.gridy = 1; jcbSignDirectly = new JCheckBox(); jcbSignDirectly.setSelected(true); jcbSignDirectly.setToolTipText(res.getString("DSignMidlet.jcbSignDirectly.tooltip")); GridBagConstraints gbc_jcbSignDirectly = (GridBagConstraints) gbcCtrl.clone(); gbc_jcbSignDirectly.gridy = 1; jcbSignDirectly.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent evt) { jtfOutputJad.setEnabled(!jcbSignDirectly.isSelected()); jbOutputJadBrowse.setEnabled(!jcbSignDirectly.isSelected()); } }); jlOutputJad = new JLabel(res.getString("DSignMidlet.jlOutputJad.text")); GridBagConstraints gbc_jlOutputJad = (GridBagConstraints) gbcLbl.clone(); gbc_jlOutputJad.gridy = 2; jtfOutputJad = new JTextField(30); jtfOutputJad.setEnabled(false); jtfOutputJad.setCaretPosition(0); jtfOutputJad.setToolTipText(res.getString("DSignMidlet.jtfOutputJad.tooltip")); GridBagConstraints gbc_jtfOutputJad = (GridBagConstraints) gbcCtrl.clone(); gbc_jtfOutputJad.gridy = 2; jbOutputJadBrowse = new JButton(res.getString("DSignMidlet.jbOutputJadBrowse.text")); PlatformUtil.setMnemonic(jbOutputJadBrowse, res.getString("DSignMidlet.jbOutputJadBrowse.mnemonic").charAt(0)); jbOutputJadBrowse.setToolTipText(res.getString("DSignMidlet.jbOutputJadBrowse.tooltip")); jbOutputJadBrowse.setEnabled(false); jbOutputJadBrowse.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DSignMidlet.this); outputJadBrowsePressed(); } finally { CursorUtil.setCursorFree(DSignMidlet.this); } } }); GridBagConstraints gbc_jbOutputJadBrowse = (GridBagConstraints) gbcBrws.clone(); gbc_jbOutputJadBrowse.gridy = 2; jlJar = new JLabel(res.getString("DSignMidlet.jlJar.text")); GridBagConstraints gbc_jlJar = (GridBagConstraints) gbcLbl.clone(); gbc_jlJar.gridy = 3; jtfJar = new JTextField(30); jtfJar.setCaretPosition(0); jtfJar.setToolTipText(res.getString("DSignMidlet.jtfJar.tooltip")); GridBagConstraints gbc_jtfJar = (GridBagConstraints) gbcCtrl.clone(); gbc_jtfJar.gridy = 3; jbJarBrowse = new JButton(res.getString("DSignMidlet.jbJarBrowse.text")); PlatformUtil.setMnemonic(jbJarBrowse, res.getString("DSignMidlet.jbJarBrowse.mnemonic").charAt(0)); jbJarBrowse.setToolTipText(res.getString("DSignMidlet.jbJarBrowse.tooltip")); jbJarBrowse.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DSignMidlet.this); jarBrowsePressed(); } finally { CursorUtil.setCursorFree(DSignMidlet.this); } } }); GridBagConstraints gbc_jbJarBrowse = (GridBagConstraints) gbcBrws.clone(); gbc_jbJarBrowse.gridy = 3; jpOptions = new JPanel(new GridBagLayout()); jpOptions.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new EtchedBorder())); jpOptions.add(jlInputJad, gbc_jlInputJad); jpOptions.add(jtfInputJad, gbc_jtfInputJad); jpOptions.add(jbInputJadBrowse, gbc_jbInputJadBrowse); jpOptions.add(jlSignDirectly, gbc_jlSignDirectly); jpOptions.add(jcbSignDirectly, gbc_jcbSignDirectly); jpOptions.add(jlOutputJad, gbc_jlOutputJad); jpOptions.add(jtfOutputJad, gbc_jtfOutputJad); jpOptions.add(jbOutputJadBrowse, gbc_jbOutputJadBrowse); jpOptions.add(jlJar, gbc_jlJar); jpOptions.add(jtfJar, gbc_jtfJar); jpOptions.add(jbJarBrowse, gbc_jbJarBrowse); jbOK = new JButton(res.getString("DSignMidlet.jbOK.text")); jbOK.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { okPressed(); } }); jbCancel = new JButton(res.getString("DSignMidlet.jbCancel.text")); jbCancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { cancelPressed(); } }); jbCancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_KEY); jbCancel.getActionMap().put(CANCEL_KEY, new AbstractAction() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent evt) { cancelPressed(); } }); jpButtons = PlatformUtil.createDialogButtonPanel(jbOK, jbCancel, false); getContentPane().setLayout(new BorderLayout()); getContentPane().add(jpOptions, BorderLayout.NORTH); getContentPane().add(jpButtons, BorderLayout.SOUTH); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent evt) { closeDialog(); } }); setResizable(false); getRootPane().setDefaultButton(jbOK); pack(); }
From source file:medsavant.enrichment.app.OntologyAggregatePanel.java
public OntologyAggregatePanel(String page) { super(page);/* ww w . j a v a 2 s . c o m*/ setLayout(new GridBagLayout()); chooser = new JComboBox(OntologyListItem.DEFAULT_ITEMS); chooser.setMaximumSize(new Dimension(400, chooser.getMaximumSize().height)); progress = new JProgressBar(); progress.setPreferredSize(new Dimension(600, progress.getMaximumSize().height)); progress.setStringPainted(true); JPanel banner = new JPanel(); banner.setLayout(new GridBagLayout()); banner.setBackground(new Color(245, 245, 245)); banner.setBorder(BorderFactory.createTitledBorder("Ontology")); tree = new TreeTable(); GridBagConstraints gbc = new GridBagConstraints(); gbc.weightx = 1.0; gbc.anchor = GridBagConstraints.WEST; banner.add(chooser, gbc); gbc.anchor = GridBagConstraints.EAST; banner.add(progress, gbc); gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.weightx = 1.0; gbc.weighty = 0.0; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.NORTH; add(banner, gbc); gbc.weighty = 1.0; gbc.fill = GridBagConstraints.BOTH; add(new JScrollPane(tree), gbc); chooser.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (termFetcher != null) { termFetcher.cancel(true); termFetcher = null; } recalculate(); } }); tree.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { createPopup().show(e.getComponent(), e.getX(), e.getY()); } } }); }
From source file:org.pentaho.reporting.engine.classic.demo.ancient.demo.layouts.DemoReportController.java
public DemoReportController() { setLayout(new GridBagLayout()); final JLabel messageOneLabel = new JLabel("One:"); final JLabel messageTwoLabel = new JLabel("Two:"); messageOneField = new JTextArea(); messageOneField.setWrapStyleWord(true); messageOneField.setRows(10);/*from w ww . j a v a2 s.c o m*/ messageTwoField = new JTextArea(); messageTwoField.setRows(10); messageTwoField.setWrapStyleWord(true); updateAction = new UpdateAction(); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; add(messageOneLabel, gbc); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; add(messageTwoLabel, gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.weightx = 1; gbc.weighty = 1; gbc.fill = GridBagConstraints.BOTH; add(new JScrollPane(messageOneField), gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.weightx = 1; gbc.weighty = 1; gbc.fill = GridBagConstraints.BOTH; add(new JScrollPane(messageTwoField), gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 2; gbc.anchor = GridBagConstraints.EAST; add(new JButton(updateAction)); setEnabled(false); messageOneField.setEnabled(false); messageTwoField.setEnabled(false); updateAction.setEnabled(false); }
From source file:us.paulevans.basicxslt.SaveAsConfigurationFrame.java
/** * Builds the main panel/* w w w . j a v a 2 s .c o m*/ * @return */ private JPanel buildMainPanel() { int row; GridBagLayout layout; GridBagConstraints constraints; JPanel main; JLabel label; layout = new GridBagLayout(); constraints = new GridBagConstraints(); main = new JPanel(layout); row = 0; GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.SAVEASCONFIG_FRAME_CURRENT_CONFIGURATION)), layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE, GUIUtils.MED_INSETS); GUIUtils.add(main, label = new JLabel(userPrefs.getConfiguration()), layout, constraints, row++, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS); label.setForeground(Color.BLUE); GUIUtils.add(main, new JSeparator(), layout, constraints, row++, 0, 1, 2, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, GUIUtils.MED_INSETS); GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.SAVEASCONFIG_FRAME_CONFIGURATION_NAME)), layout, constraints, row, 0, 1, 1, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS); GUIUtils.add(main, new JScrollPane(configurationName = new JTextField(20)), layout, constraints, row++, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS); GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.SAVEASCONFIG_FRAME_MAKE_DEFAULT)), layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS); GUIUtils.add(main, makeDefault = new JCheckBox(), layout, constraints, row++, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS); return main; }
From source file:savant.plugin.ToolSettingsPanel.java
private void addArgumentToPanel(ToolArgument arg, int row) { GridBagConstraints gbc = new GridBagConstraints(); gbc.insets = new Insets(5, 5, 5, 5); gbc.gridy = row;// w w w . java 2s . co m JComponent widget = null; if (arg.type == ToolArgument.Type.BOOL) { gbc.gridx = 2; gbc.anchor = GridBagConstraints.WEST; addWidget(arg, new BoolCheck(arg), gbc); } else { gbc.gridx = 1; gbc.anchor = GridBagConstraints.EAST; JLabel nameLabel = new JLabel(arg.name + ":"); add(nameLabel, gbc); gbc.gridx = 2; gbc.anchor = GridBagConstraints.WEST; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.weightx = 1.0; JTextField field = null; switch (arg.type) { case INT: field = new JFormattedTextField(); ((JFormattedTextField) field).setValue(Integer.valueOf(arg.value != null ? arg.value : "0")); field.setColumns(5); addField(arg, field, gbc); break; case FLOAT: field = new JFormattedTextField(); ((JFormattedTextField) field).setValue(Double.valueOf(arg.value != null ? arg.value : "0.0")); field.setColumns(10); addField(arg, field, gbc); break; case OUTPUT_FILE: gbc.gridwidth = 1; gbc.fill = GridBagConstraints.HORIZONTAL; field = new JTextField(arg.value); addField(arg, field, gbc); gbc.gridx = 3; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.weightx = 0.0; JCheckBox loadCheck = new JCheckBox("Load upon Completion", true); loadCheck.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { tool.loadUponCompletion = ((JCheckBox) ae.getSource()).isSelected(); } }); add(loadCheck, gbc); break; case RANGE: field = new JTextField(); field.setColumns(25); LocationController.getInstance().addListener(new RangeUpdater(field)); addField(arg, field, gbc); break; case LIST: addWidget(arg, new StringCombo(arg), gbc); break; case MULTI: gbc.fill = GridBagConstraints.HORIZONTAL; addWidget(arg, new MultiCheckGrid(arg), gbc); break; case BAM_INPUT_FILE: TrackUtils.addTrackListener( (TrackCombo) addWidget(arg, new TrackCombo(arg, DataFormat.ALIGNMENT), gbc)); break; case FASTA_INPUT_FILE: TrackUtils.addTrackListener( (TrackCombo) addWidget(arg, new TrackCombo(arg, DataFormat.SEQUENCE), gbc)); break; } } }
From source file:org.kse.gui.dialogs.importexport.DImportKeyPairPvk.java
private void initComponents() { GridBagConstraints gbcLbl = new GridBagConstraints(); gbcLbl.gridx = 0;//from ww w.ja v a 2 s . c om gbcLbl.gridwidth = 3; gbcLbl.gridheight = 1; gbcLbl.insets = new Insets(5, 5, 5, 5); gbcLbl.anchor = GridBagConstraints.EAST; GridBagConstraints gbcEdCtrl = new GridBagConstraints(); gbcEdCtrl.gridx = 3; gbcEdCtrl.gridwidth = 3; gbcEdCtrl.gridheight = 1; gbcEdCtrl.insets = new Insets(5, 5, 5, 5); gbcEdCtrl.anchor = GridBagConstraints.WEST; jlEncrypted = new JLabel(res.getString("DImportKeyPairPvk.jlEncrypted.text")); GridBagConstraints gbc_jlEncrypted = (GridBagConstraints) gbcLbl.clone(); gbc_jlEncrypted.gridy = 0; jcbEncrypted = new JCheckBox(); jcbEncrypted.setSelected(true); jcbEncrypted.setToolTipText(res.getString("DImportKeyPairPvk.jcbEncrypted.tooltip")); GridBagConstraints gbc_jcbEncrypted = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jcbEncrypted.gridy = 0; jlPassword = new JLabel(res.getString("DImportKeyPairPvk.jlPassword.text")); GridBagConstraints gbc_jlPassword = (GridBagConstraints) gbcLbl.clone(); gbc_jlPassword.gridy = 1; jpfPassword = new JPasswordField(15); jpfPassword.setToolTipText(res.getString("DImportKeyPairPvk.jpfPassword.tooltip")); GridBagConstraints gbc_jpfPassword = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jpfPassword.gridy = 1; jlPrivateKey = new JLabel(res.getString("DImportKeyPairPvk.jlPrivateKey.text")); GridBagConstraints gbc_jlPrivateKey = (GridBagConstraints) gbcLbl.clone(); gbc_jlPrivateKey.gridy = 2; jtfPrivateKeyPath = new JTextField(30); jtfPrivateKeyPath.setToolTipText(res.getString("DImportKeyPairPvk.jtfPrivateKeyPath.tooltip")); GridBagConstraints gbc_jtfPrivateKeyPath = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jtfPrivateKeyPath.gridy = 2; gbc_jtfPrivateKeyPath.gridwidth = 6; jbPrivateKeyBrowse = new JButton(res.getString("DImportKeyPairPvk.jbPrivateKeyBrowse.text")); PlatformUtil.setMnemonic(jbPrivateKeyBrowse, res.getString("DImportKeyPairPvk.jbPrivateKeyBrowse.mnemonic").charAt(0)); jbPrivateKeyBrowse.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairPvk.this); privateKeyBrowsePressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairPvk.this); } } }); jbPrivateKeyBrowse.setToolTipText(res.getString("DImportKeyPairPvk.jbPrivateKeyBrowse.tooltip")); GridBagConstraints gbc_jbPrivateKeyBrowse = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jbPrivateKeyBrowse.gridy = 2; gbc_jbPrivateKeyBrowse.gridx = 9; jbPrivateKeyDetails = new JButton(res.getString("DImportKeyPairPvk.jbPrivateKeyDetails.text")); jbPrivateKeyDetails.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairPvk.this); privateKeyDetailsPressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairPvk.this); } } }); PlatformUtil.setMnemonic(jbPrivateKeyDetails, res.getString("DImportKeyPairPvk.jbPrivateKeyDetails.mnemonic").charAt(0)); jbPrivateKeyDetails.setToolTipText(res.getString("DImportKeyPairPvk.jbPrivateKeyDetails.tooltip")); GridBagConstraints gbc_jbPrivateKeyDetails = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jbPrivateKeyDetails.gridy = 2; gbc_jbPrivateKeyDetails.gridx = 12; jlCertificate = new JLabel(res.getString("DImportKeyPairPvk.jlCertificate.text")); GridBagConstraints gbc_jlCertificate = (GridBagConstraints) gbcLbl.clone(); gbc_jlCertificate.gridy = 3; jtfCertificatePath = new JTextField(30); jtfCertificatePath.setToolTipText(res.getString("DImportKeyPairPvk.jtfCertificatePath.tooltip")); GridBagConstraints gbc_jtfCertificatePath = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jtfCertificatePath.gridy = 3; gbc_jtfCertificatePath.gridwidth = 6; jbCertificateBrowse = new JButton(res.getString("DImportKeyPairPvk.jbCertificateBrowse.text")); jbCertificateBrowse.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairPvk.this); certificateBrowsePressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairPvk.this); } } }); PlatformUtil.setMnemonic(jbCertificateBrowse, res.getString("DImportKeyPairPvk.jbCertificateBrowse.mnemonic").charAt(0)); jbCertificateBrowse.setToolTipText(res.getString("DImportKeyPairPvk.jbCertificateBrowse.tooltip")); GridBagConstraints gbc_jbCertificateBrowse = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jbCertificateBrowse.gridy = 3; gbc_jbCertificateBrowse.gridx = 9; jbCertificateDetails = new JButton(res.getString("DImportKeyPairPvk.jbCertificateDetails.text")); jbCertificateDetails.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairPvk.this); certificateDetailsPressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairPvk.this); } } }); PlatformUtil.setMnemonic(jbCertificateDetails, res.getString("DImportKeyPairPvk.jbCertificateDetails.mnemonic").charAt(0)); jbCertificateDetails.setToolTipText(res.getString("DImportKeyPairPvk.jbCertificateDetails.tooltip")); GridBagConstraints gbc_jbCertificateDetails = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jbCertificateDetails.gridy = 3; gbc_jbCertificateDetails.gridx = 12; jpKeyPair = new JPanel(new GridBagLayout()); jpKeyPair.setBorder(new CompoundBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new EtchedBorder()), new EmptyBorder(5, 5, 5, 5))); jpKeyPair.add(jlEncrypted, gbc_jlEncrypted); jpKeyPair.add(jcbEncrypted, gbc_jcbEncrypted); jpKeyPair.add(jlPassword, gbc_jlPassword); jpKeyPair.add(jpfPassword, gbc_jpfPassword); jpKeyPair.add(jlPrivateKey, gbc_jlPrivateKey); jpKeyPair.add(jtfPrivateKeyPath, gbc_jtfPrivateKeyPath); jpKeyPair.add(jbPrivateKeyBrowse, gbc_jbPrivateKeyBrowse); jpKeyPair.add(jbPrivateKeyDetails, gbc_jbPrivateKeyDetails); jpKeyPair.add(jlCertificate, gbc_jlCertificate); jpKeyPair.add(jtfCertificatePath, gbc_jtfCertificatePath); jpKeyPair.add(jbCertificateBrowse, gbc_jbCertificateBrowse); jpKeyPair.add(jbCertificateDetails, gbc_jbCertificateDetails); jcbEncrypted.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent evt) { if (jcbEncrypted.isSelected()) { jpfPassword.setEnabled(true); } else { jpfPassword.setEnabled(false); jpfPassword.setText(""); } } }); jbImport = new JButton(res.getString("DImportKeyPairPvk.jbImport.text")); PlatformUtil.setMnemonic(jbImport, res.getString("DImportKeyPairPvk.jbImport.mnemonic").charAt(0)); jbImport.setToolTipText(res.getString("DImportKeyPairPvk.jbImport.tooltip")); jbImport.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairPvk.this); importPressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairPvk.this); } } }); jbCancel = new JButton(res.getString("DImportKeyPairPvk.jbCancel.text")); jbCancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { cancelPressed(); } }); jbCancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_KEY); jbCancel.getActionMap().put(CANCEL_KEY, new AbstractAction() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent evt) { cancelPressed(); } }); jpButtons = PlatformUtil.createDialogButtonPanel(jbImport, jbCancel); getContentPane().setLayout(new BorderLayout()); getContentPane().add(jpKeyPair, BorderLayout.CENTER); getContentPane().add(jpButtons, BorderLayout.SOUTH); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent evt) { closeDialog(); } }); setTitle(res.getString("DImportKeyPairPvk.Title")); setResizable(false); getRootPane().setDefaultButton(jbImport); pack(); }
From source file:org.kse.gui.dialogs.importexport.DImportKeyPairPkcs8.java
private void initComponents() { GridBagConstraints gbcLbl = new GridBagConstraints(); gbcLbl.gridx = 0;/*from w ww . ja v a2 s .co m*/ gbcLbl.gridwidth = 3; gbcLbl.gridheight = 1; gbcLbl.insets = new Insets(5, 5, 5, 5); gbcLbl.anchor = GridBagConstraints.EAST; GridBagConstraints gbcEdCtrl = new GridBagConstraints(); gbcEdCtrl.gridx = 3; gbcEdCtrl.gridwidth = 3; gbcEdCtrl.gridheight = 1; gbcEdCtrl.insets = new Insets(5, 5, 5, 5); gbcEdCtrl.anchor = GridBagConstraints.WEST; jlEncrypted = new JLabel(res.getString("DImportKeyPairPkcs8.jlEncrypted.text")); GridBagConstraints gbc_jlEncrypted = (GridBagConstraints) gbcLbl.clone(); gbc_jlEncrypted.gridy = 0; jcbEncrypted = new JCheckBox(); jcbEncrypted.setSelected(true); jcbEncrypted.setToolTipText(res.getString("DImportKeyPairPkcs8.jcbEncrypted.tooltip")); GridBagConstraints gbc_jcbEncrypted = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jcbEncrypted.gridy = 0; jlPassword = new JLabel(res.getString("DImportKeyPairPkcs8.jlPassword.text")); GridBagConstraints gbc_jlPassword = (GridBagConstraints) gbcLbl.clone(); gbc_jlPassword.gridy = 1; jpfPassword = new JPasswordField(15); jpfPassword.setToolTipText(res.getString("DImportKeyPairPkcs8.jpfPassword.tooltip")); GridBagConstraints gbc_jpfPassword = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jpfPassword.gridy = 1; jlPrivateKey = new JLabel(res.getString("DImportKeyPairPkcs8.jlPrivateKey.text")); GridBagConstraints gbc_jlPrivateKey = (GridBagConstraints) gbcLbl.clone(); gbc_jlPrivateKey.gridy = 2; jtfPrivateKeyPath = new JTextField(30); jtfPrivateKeyPath.setToolTipText(res.getString("DImportKeyPairPkcs8.jtfPrivateKeyPath.tooltip")); GridBagConstraints gbc_jtfPrivateKeyPath = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jtfPrivateKeyPath.gridy = 2; gbc_jtfPrivateKeyPath.gridwidth = 6; jbPrivateKeyBrowse = new JButton(res.getString("DImportKeyPairPkcs8.jbPrivateKeyBrowse.text")); PlatformUtil.setMnemonic(jbPrivateKeyBrowse, res.getString("DImportKeyPairPkcs8.jbPrivateKeyBrowse.mnemonic").charAt(0)); jbPrivateKeyBrowse.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairPkcs8.this); privateKeyBrowsePressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairPkcs8.this); } } }); jbPrivateKeyBrowse.setToolTipText(res.getString("DImportKeyPairPkcs8.jbPrivateKeyBrowse.tooltip")); GridBagConstraints gbc_jbPrivateKeyBrowse = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jbPrivateKeyBrowse.gridy = 2; gbc_jbPrivateKeyBrowse.gridx = 9; jbPrivateKeyDetails = new JButton(res.getString("DImportKeyPairPkcs8.jbPrivateKeyDetails.text")); jbPrivateKeyDetails.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairPkcs8.this); privateKeyDetailsPressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairPkcs8.this); } } }); PlatformUtil.setMnemonic(jbPrivateKeyDetails, res.getString("DImportKeyPairPkcs8.jbPrivateKeyDetails.mnemonic").charAt(0)); jbPrivateKeyDetails.setToolTipText(res.getString("DImportKeyPairPkcs8.jbPrivateKeyDetails.tooltip")); GridBagConstraints gbc_jbPrivateKeyDetails = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jbPrivateKeyDetails.gridy = 2; gbc_jbPrivateKeyDetails.gridx = 12; jlCertificate = new JLabel(res.getString("DImportKeyPairPkcs8.jlCertificate.text")); GridBagConstraints gbc_jlCertificate = (GridBagConstraints) gbcLbl.clone(); gbc_jlCertificate.gridy = 3; jtfCertificatePath = new JTextField(30); jtfCertificatePath.setToolTipText(res.getString("DImportKeyPairPkcs8.jtfCertificatePath.tooltip")); GridBagConstraints gbc_jtfCertificatePath = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jtfCertificatePath.gridy = 3; gbc_jtfCertificatePath.gridwidth = 6; jbCertificateBrowse = new JButton(res.getString("DImportKeyPairPkcs8.jbCertificateBrowse.text")); jbCertificateBrowse.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairPkcs8.this); certificateBrowsePressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairPkcs8.this); } } }); PlatformUtil.setMnemonic(jbCertificateBrowse, res.getString("DImportKeyPairPkcs8.jbCertificateBrowse.mnemonic").charAt(0)); jbCertificateBrowse.setToolTipText(res.getString("DImportKeyPairPkcs8.jbCertificateBrowse.tooltip")); GridBagConstraints gbc_jbCertificateBrowse = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jbCertificateBrowse.gridy = 3; gbc_jbCertificateBrowse.gridx = 9; jbCertificateDetails = new JButton(res.getString("DImportKeyPairPkcs8.jbCertificateDetails.text")); jbCertificateDetails.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairPkcs8.this); certificateDetailsPressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairPkcs8.this); } } }); PlatformUtil.setMnemonic(jbCertificateDetails, res.getString("DImportKeyPairPkcs8.jbCertificateDetails.mnemonic").charAt(0)); jbCertificateDetails.setToolTipText(res.getString("DImportKeyPairPkcs8.jbCertificateDetails.tooltip")); GridBagConstraints gbc_jbCertificateDetails = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jbCertificateDetails.gridy = 3; gbc_jbCertificateDetails.gridx = 12; jpKeyPair = new JPanel(new GridBagLayout()); jpKeyPair.setBorder(new CompoundBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new EtchedBorder()), new EmptyBorder(5, 5, 5, 5))); jpKeyPair.add(jlEncrypted, gbc_jlEncrypted); jpKeyPair.add(jcbEncrypted, gbc_jcbEncrypted); jpKeyPair.add(jlPassword, gbc_jlPassword); jpKeyPair.add(jpfPassword, gbc_jpfPassword); jpKeyPair.add(jlPrivateKey, gbc_jlPrivateKey); jpKeyPair.add(jtfPrivateKeyPath, gbc_jtfPrivateKeyPath); jpKeyPair.add(jbPrivateKeyBrowse, gbc_jbPrivateKeyBrowse); jpKeyPair.add(jbPrivateKeyDetails, gbc_jbPrivateKeyDetails); jpKeyPair.add(jlCertificate, gbc_jlCertificate); jpKeyPair.add(jtfCertificatePath, gbc_jtfCertificatePath); jpKeyPair.add(jbCertificateBrowse, gbc_jbCertificateBrowse); jpKeyPair.add(jbCertificateDetails, gbc_jbCertificateDetails); jcbEncrypted.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent evt) { if (jcbEncrypted.isSelected()) { jpfPassword.setEnabled(true); } else { jpfPassword.setEnabled(false); jpfPassword.setText(""); } } }); jbImport = new JButton(res.getString("DImportKeyPairPkcs8.jbImport.text")); PlatformUtil.setMnemonic(jbImport, res.getString("DImportKeyPairPkcs8.jbImport.mnemonic").charAt(0)); jbImport.setToolTipText(res.getString("DImportKeyPairPkcs8.jbImport.tooltip")); jbImport.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairPkcs8.this); importPressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairPkcs8.this); } } }); jbCancel = new JButton(res.getString("DImportKeyPairPkcs8.jbCancel.text")); jbCancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { cancelPressed(); } }); jbCancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_KEY); jbCancel.getActionMap().put(CANCEL_KEY, new AbstractAction() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent evt) { cancelPressed(); } }); jpButtons = PlatformUtil.createDialogButtonPanel(jbImport, jbCancel); getContentPane().setLayout(new BorderLayout()); getContentPane().add(jpKeyPair, BorderLayout.CENTER); getContentPane().add(jpButtons, BorderLayout.SOUTH); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent evt) { closeDialog(); } }); setTitle(res.getString("DImportKeyPairPkcs8.Title")); setResizable(false); getRootPane().setDefaultButton(jbImport); pack(); }
From source file:org.kse.gui.dialogs.importexport.DImportKeyPairOpenSsl.java
private void initComponents() { GridBagConstraints gbcLbl = new GridBagConstraints(); gbcLbl.gridx = 0;//from ww w .java 2 s. c om gbcLbl.gridwidth = 3; gbcLbl.gridheight = 1; gbcLbl.insets = new Insets(5, 5, 5, 5); gbcLbl.anchor = GridBagConstraints.EAST; GridBagConstraints gbcEdCtrl = new GridBagConstraints(); gbcEdCtrl.gridx = 3; gbcEdCtrl.gridwidth = 3; gbcEdCtrl.gridheight = 1; gbcEdCtrl.insets = new Insets(5, 5, 5, 5); gbcEdCtrl.anchor = GridBagConstraints.WEST; jlEncrypted = new JLabel(res.getString("DImportKeyPairOpenSsl.jlEncrypted.text")); GridBagConstraints gbc_jlEncrypted = (GridBagConstraints) gbcLbl.clone(); gbc_jlEncrypted.gridy = 0; jcbEncrypted = new JCheckBox(); jcbEncrypted.setSelected(true); jcbEncrypted.setToolTipText(res.getString("DImportKeyPairOpenSsl.jcbEncrypted.tooltip")); GridBagConstraints gbc_jcbEncrypted = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jcbEncrypted.gridy = 0; jlPassword = new JLabel(res.getString("DImportKeyPairOpenSsl.jlPassword.text")); GridBagConstraints gbc_jlPassword = (GridBagConstraints) gbcLbl.clone(); gbc_jlPassword.gridy = 1; jpfPassword = new JPasswordField(15); jpfPassword.setToolTipText(res.getString("DImportKeyPairOpenSsl.jpfPassword.tooltip")); GridBagConstraints gbc_jpfPassword = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jpfPassword.gridy = 1; jlPrivateKey = new JLabel(res.getString("DImportKeyPairOpenSsl.jlPrivateKey.text")); GridBagConstraints gbc_jlPrivateKey = (GridBagConstraints) gbcLbl.clone(); gbc_jlPrivateKey.gridy = 2; jtfPrivateKeyPath = new JTextField(30); jtfPrivateKeyPath.setToolTipText(res.getString("DImportKeyPairOpenSsl.jtfPrivateKeyPath.tooltip")); GridBagConstraints gbc_jtfPrivateKeyPath = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jtfPrivateKeyPath.gridy = 2; gbc_jtfPrivateKeyPath.gridwidth = 6; jbPrivateKeyBrowse = new JButton(res.getString("DImportKeyPairOpenSsl.jbPrivateKeyBrowse.text")); PlatformUtil.setMnemonic(jbPrivateKeyBrowse, res.getString("DImportKeyPairOpenSsl.jbPrivateKeyBrowse.mnemonic").charAt(0)); jbPrivateKeyBrowse.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairOpenSsl.this); privateKeyBrowsePressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairOpenSsl.this); } } }); jbPrivateKeyBrowse.setToolTipText(res.getString("DImportKeyPairOpenSsl.jbPrivateKeyBrowse.tooltip")); GridBagConstraints gbc_jbPrivateKeyBrowse = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jbPrivateKeyBrowse.gridy = 2; gbc_jbPrivateKeyBrowse.gridx = 9; jbPrivateKeyDetails = new JButton(res.getString("DImportKeyPairOpenSsl.jbPrivateKeyDetails.text")); jbPrivateKeyDetails.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairOpenSsl.this); privateKeyDetailsPressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairOpenSsl.this); } } }); PlatformUtil.setMnemonic(jbPrivateKeyDetails, res.getString("DImportKeyPairOpenSsl.jbPrivateKeyDetails.mnemonic").charAt(0)); jbPrivateKeyDetails.setToolTipText(res.getString("DImportKeyPairOpenSsl.jbPrivateKeyDetails.tooltip")); GridBagConstraints gbc_jbPrivateKeyDetails = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jbPrivateKeyDetails.gridy = 2; gbc_jbPrivateKeyDetails.gridx = 12; jlCertificate = new JLabel(res.getString("DImportKeyPairOpenSsl.jlCertificate.text")); GridBagConstraints gbc_jlCertificate = (GridBagConstraints) gbcLbl.clone(); gbc_jlCertificate.gridy = 3; jtfCertificatePath = new JTextField(30); jtfCertificatePath.setToolTipText(res.getString("DImportKeyPairOpenSsl.jtfCertificatePath.tooltip")); GridBagConstraints gbc_jtfCertificatePath = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jtfCertificatePath.gridy = 3; gbc_jtfCertificatePath.gridwidth = 6; jbCertificateBrowse = new JButton(res.getString("DImportKeyPairOpenSsl.jbCertificateBrowse.text")); jbCertificateBrowse.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairOpenSsl.this); certificateBrowsePressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairOpenSsl.this); } } }); PlatformUtil.setMnemonic(jbCertificateBrowse, res.getString("DImportKeyPairOpenSsl.jbCertificateBrowse.mnemonic").charAt(0)); jbCertificateBrowse.setToolTipText(res.getString("DImportKeyPairOpenSsl.jbCertificateBrowse.tooltip")); GridBagConstraints gbc_jbCertificateBrowse = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jbCertificateBrowse.gridy = 3; gbc_jbCertificateBrowse.gridx = 9; jbCertificateDetails = new JButton(res.getString("DImportKeyPairOpenSsl.jbCertificateDetails.text")); jbCertificateDetails.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairOpenSsl.this); certificateDetailsPressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairOpenSsl.this); } } }); PlatformUtil.setMnemonic(jbCertificateDetails, res.getString("DImportKeyPairOpenSsl.jbCertificateDetails.mnemonic").charAt(0)); jbCertificateDetails.setToolTipText(res.getString("DImportKeyPairOpenSsl.jbCertificateDetails.tooltip")); GridBagConstraints gbc_jbCertificateDetails = (GridBagConstraints) gbcEdCtrl.clone(); gbc_jbCertificateDetails.gridy = 3; gbc_jbCertificateDetails.gridx = 12; jpKeyPair = new JPanel(new GridBagLayout()); jpKeyPair.setBorder(new CompoundBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new EtchedBorder()), new EmptyBorder(5, 5, 5, 5))); jpKeyPair.add(jlEncrypted, gbc_jlEncrypted); jpKeyPair.add(jcbEncrypted, gbc_jcbEncrypted); jpKeyPair.add(jlPassword, gbc_jlPassword); jpKeyPair.add(jpfPassword, gbc_jpfPassword); jpKeyPair.add(jlPrivateKey, gbc_jlPrivateKey); jpKeyPair.add(jtfPrivateKeyPath, gbc_jtfPrivateKeyPath); jpKeyPair.add(jbPrivateKeyBrowse, gbc_jbPrivateKeyBrowse); jpKeyPair.add(jbPrivateKeyDetails, gbc_jbPrivateKeyDetails); jpKeyPair.add(jlCertificate, gbc_jlCertificate); jpKeyPair.add(jtfCertificatePath, gbc_jtfCertificatePath); jpKeyPair.add(jbCertificateBrowse, gbc_jbCertificateBrowse); jpKeyPair.add(jbCertificateDetails, gbc_jbCertificateDetails); jcbEncrypted.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent evt) { if (jcbEncrypted.isSelected()) { jpfPassword.setEnabled(true); } else { jpfPassword.setEnabled(false); jpfPassword.setText(""); } } }); jbImport = new JButton(res.getString("DImportKeyPairOpenSsl.jbImport.text")); PlatformUtil.setMnemonic(jbImport, res.getString("DImportKeyPairOpenSsl.jbImport.mnemonic").charAt(0)); jbImport.setToolTipText(res.getString("DImportKeyPairOpenSsl.jbImport.tooltip")); jbImport.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { CursorUtil.setCursorBusy(DImportKeyPairOpenSsl.this); importPressed(); } finally { CursorUtil.setCursorFree(DImportKeyPairOpenSsl.this); } } }); jbCancel = new JButton(res.getString("DImportKeyPairOpenSsl.jbCancel.text")); jbCancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { cancelPressed(); } }); jbCancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_KEY); jbCancel.getActionMap().put(CANCEL_KEY, new AbstractAction() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent evt) { cancelPressed(); } }); jpButtons = PlatformUtil.createDialogButtonPanel(jbImport, jbCancel); getContentPane().setLayout(new BorderLayout()); getContentPane().add(jpKeyPair, BorderLayout.CENTER); getContentPane().add(jpButtons, BorderLayout.SOUTH); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent evt) { closeDialog(); } }); setTitle(res.getString("DImportKeyPairOpenSsl.Title")); setResizable(false); getRootPane().setDefaultButton(jbImport); pack(); }