Search in sources :

Example 1 with JPolicyInformation

use of org.kse.gui.crypto.policyinformation.JPolicyInformation in project keystore-explorer by kaikramer.

the class DCertificatePolicies method initComponents.

private void initComponents() {
    jlCertificatePolicies = new JLabel(res.getString("DCertificatePolicies.jlCertificatePolicies.text"));
    GridBagConstraints gbc_jlCertificatePolicies = new GridBagConstraints();
    gbc_jlCertificatePolicies.gridx = 0;
    gbc_jlCertificatePolicies.gridy = 1;
    gbc_jlCertificatePolicies.gridwidth = 1;
    gbc_jlCertificatePolicies.gridheight = 1;
    gbc_jlCertificatePolicies.insets = new Insets(5, 5, 5, 5);
    gbc_jlCertificatePolicies.anchor = GridBagConstraints.NORTHEAST;
    jpiCertificatePolicies = new JPolicyInformation(res.getString("DCertificatePolicies.PolicyInformation.Title"));
    jpiCertificatePolicies.setPreferredSize(new Dimension(400, 150));
    GridBagConstraints gbc_jpiCertificatePolicies = new GridBagConstraints();
    gbc_jpiCertificatePolicies.gridx = 1;
    gbc_jpiCertificatePolicies.gridy = 1;
    gbc_jpiCertificatePolicies.gridwidth = 1;
    gbc_jpiCertificatePolicies.gridheight = 1;
    gbc_jpiCertificatePolicies.insets = new Insets(5, 5, 5, 5);
    gbc_jpiCertificatePolicies.anchor = GridBagConstraints.WEST;
    jpCertificatePolicies = new JPanel(new GridBagLayout());
    jpCertificatePolicies.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new EtchedBorder()));
    jpCertificatePolicies.add(jlCertificatePolicies, gbc_jlCertificatePolicies);
    jpCertificatePolicies.add(jpiCertificatePolicies, gbc_jpiCertificatePolicies);
    jbOK = new JButton(res.getString("DCertificatePolicies.jbOK.text"));
    jbOK.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            okPressed();
        }
    });
    jbCancel = new JButton(res.getString("DCertificatePolicies.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(jpCertificatePolicies, BorderLayout.CENTER);
    getContentPane().add(jpButtons, BorderLayout.SOUTH);
    addWindowListener(new WindowAdapter() {

        @Override
        public void windowClosing(WindowEvent evt) {
            closeDialog();
        }
    });
    setResizable(false);
    getRootPane().setDefaultButton(jbOK);
    pack();
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) WindowAdapter(java.awt.event.WindowAdapter) Dimension(java.awt.Dimension) EtchedBorder(javax.swing.border.EtchedBorder) ActionListener(java.awt.event.ActionListener) BorderLayout(java.awt.BorderLayout) WindowEvent(java.awt.event.WindowEvent) CompoundBorder(javax.swing.border.CompoundBorder) JPolicyInformation(org.kse.gui.crypto.policyinformation.JPolicyInformation) EmptyBorder(javax.swing.border.EmptyBorder) AbstractAction(javax.swing.AbstractAction)

Aggregations

BorderLayout (java.awt.BorderLayout)1 Dimension (java.awt.Dimension)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 WindowAdapter (java.awt.event.WindowAdapter)1 WindowEvent (java.awt.event.WindowEvent)1 AbstractAction (javax.swing.AbstractAction)1 JButton (javax.swing.JButton)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 CompoundBorder (javax.swing.border.CompoundBorder)1 EmptyBorder (javax.swing.border.EmptyBorder)1 EtchedBorder (javax.swing.border.EtchedBorder)1 JPolicyInformation (org.kse.gui.crypto.policyinformation.JPolicyInformation)1