Search in sources :

Example 6 with EtchedBorder

use of javax.swing.border.EtchedBorder in project tray by qzind.

the class AboutDialog method initComponents.

public void initComponents() {
    JComponent header = setHeader(new JLabel(getIcon(IconCache.Icon.BANNER_ICON)));
    header.setBorder(new EmptyBorder(Constants.BORDER_PADDING, 0, Constants.BORDER_PADDING, 0));
    gridPanel = new JPanel();
    JScrollPane pane = new JScrollPane(gridPanel);
    pane.getVerticalScrollBar().setUnitIncrement(8);
    pane.setPreferredSize(new Dimension(00, 100));
    gridPanel.setLayout(new GridLayout(5, 2));
    gridPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
    wsLabel = new JLabel("None");
    wssLabel = new JLabel("None.  No https support.");
    wssLabel.setForeground(Constants.WARNING_COLOR);
    wssLabel.setFont(wsLabel.getFont().deriveFont(Font.BOLD));
    gridPanel.add(createLabel("Software:", true));
    gridPanel.add(createLabel(name));
    gridPanel.add(createLabel("Secure Socket:", true));
    gridPanel.add(wssLabel);
    gridPanel.add(createLabel("Fallback Socket:", true));
    gridPanel.add(wsLabel);
    gridPanel.add(createLabel("Publisher:", true));
    try {
        gridPanel.add(new LinkLabel(new URL(Constants.ABOUT_URL)));
    } catch (MalformedURLException ex) {
        gridPanel.add(new LinkLabel(Constants.ABOUT_URL));
    }
    shadeComponents();
    setContent(pane, true);
}
Also used : EtchedBorder(javax.swing.border.EtchedBorder) MalformedURLException(java.net.MalformedURLException) EmptyBorder(javax.swing.border.EmptyBorder) URL(java.net.URL)

Example 7 with EtchedBorder

use of javax.swing.border.EtchedBorder in project keystore-explorer by kaikramer.

the class DSystemInformation method initComponents.

private void initComponents() {
    getContentPane().setLayout(new BorderLayout());
    Properties sysProps = java.lang.System.getProperties();
    Runtime runtime = Runtime.getRuntime();
    GridBagConstraints gbcLabel = new GridBagConstraints();
    gbcLabel.gridx = 0;
    gbcLabel.gridwidth = 3;
    gbcLabel.gridheight = 1;
    gbcLabel.insets = new Insets(5, 5, 5, 5);
    gbcLabel.anchor = GridBagConstraints.EAST;
    GridBagConstraints gbcTextField = new GridBagConstraints();
    gbcTextField.gridx = 3;
    gbcTextField.gridwidth = 3;
    gbcTextField.gridheight = 1;
    gbcTextField.insets = new Insets(5, 5, 5, 5);
    gbcTextField.anchor = GridBagConstraints.WEST;
    jpSystemInformation = new JPanel(new GridBagLayout());
    jpSystemInformation.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new EtchedBorder()));
    String hostname = null;
    try {
        InetAddress localAddr = InetAddress.getLocalHost();
        String host = localAddr.getCanonicalHostName();
        String address = localAddr.getHostAddress();
        if (host.equals(address)) {
            hostname = address;
        } else {
            hostname = MessageFormat.format(res.getString("DSystemInformation.jtfHostname.text"), host, address);
        }
    } catch (UnknownHostException e) {
        hostname = res.getString("DSystemInformation.jtfHostname.unknown.text");
    }
    jlHostname = new JLabel(res.getString("DSystemInformation.jlHostname.text"), SwingConstants.RIGHT);
    GridBagConstraints gbc_jlHostname = (GridBagConstraints) gbcLabel.clone();
    gbc_jlHostname.gridy = 0;
    jpSystemInformation.add(jlHostname, gbc_jlHostname);
    jtfHostname = new JTextField(hostname, TEXT_FIELD_WIDTH);
    jtfHostname.setEditable(false);
    jtfHostname.setCaretPosition(0);
    GridBagConstraints gbc_jtfHostname = (GridBagConstraints) gbcTextField.clone();
    gbc_jtfHostname.gridy = 0;
    jpSystemInformation.add(jtfHostname, gbc_jtfHostname);
    jlOperatingSystem = new JLabel(res.getString("DSystemInformation.jlOperatingSystem.text"), SwingConstants.RIGHT);
    GridBagConstraints gbc_jlOperatingSystem = (GridBagConstraints) gbcLabel.clone();
    gbc_jlOperatingSystem.gridy = 1;
    jpSystemInformation.add(jlOperatingSystem, gbc_jlOperatingSystem);
    jtfOperatingSystem = new JTextField(MessageFormat.format(res.getString("DSystemInformation.jtfOperatingSystem.text"), sysProps.getProperty("os.name", ""), sysProps.getProperty("os.version", ""), sysProps.getProperty("os.arch", "")), TEXT_FIELD_WIDTH);
    jtfOperatingSystem.setEditable(false);
    jtfOperatingSystem.setCaretPosition(0);
    GridBagConstraints gbc_jtfOperatingSystem = (GridBagConstraints) gbcTextField.clone();
    gbc_jtfOperatingSystem.gridy = 1;
    jpSystemInformation.add(jtfOperatingSystem, gbc_jtfOperatingSystem);
    jlLocale = new JLabel(res.getString("DSystemInformation.jlLocale.text"), SwingConstants.RIGHT);
    GridBagConstraints gbc_jlLocale = (GridBagConstraints) gbcLabel.clone();
    gbc_jlLocale.gridy = 2;
    jpSystemInformation.add(jlLocale, gbc_jlLocale);
    jtfLocale = new JTextField(Locale.getDefault().getDisplayName(), TEXT_FIELD_WIDTH);
    jtfLocale.setEditable(false);
    jtfLocale.setCaretPosition(0);
    GridBagConstraints gbc_jtfLocale = (GridBagConstraints) gbcTextField.clone();
    gbc_jtfLocale.gridy = 2;
    jpSystemInformation.add(jtfLocale, gbc_jtfLocale);
    jlJavaVersion = new JLabel(res.getString("DSystemInformation.jlJavaVersion.text"), SwingConstants.RIGHT);
    GridBagConstraints gbc_jlJavaVersion = (GridBagConstraints) gbcLabel.clone();
    gbc_jlJavaVersion.gridy = 3;
    jpSystemInformation.add(jlJavaVersion, gbc_jlJavaVersion);
    jtfJavaVersion = new JTextField(sysProps.getProperty("java.version", ""), TEXT_FIELD_WIDTH);
    jtfJavaVersion.setEditable(false);
    jtfJavaVersion.setCaretPosition(0);
    GridBagConstraints gbc_jtfJavaVersion = (GridBagConstraints) gbcTextField.clone();
    gbc_jtfJavaVersion.gridy = 3;
    jpSystemInformation.add(jtfJavaVersion, gbc_jtfJavaVersion);
    jlJavaVendor = new JLabel(res.getString("DSystemInformation.jlJavaVendor.text"), SwingConstants.RIGHT);
    GridBagConstraints gbc_jlJavaVendor = (GridBagConstraints) gbcLabel.clone();
    gbc_jlJavaVendor.gridy = 4;
    jpSystemInformation.add(jlJavaVendor, gbc_jlJavaVendor);
    jtfJavaVendor = new JTextField(MessageFormat.format(res.getString("DSystemInformation.jtfJavaVendor.text"), sysProps.getProperty("java.vendor", ""), sysProps.getProperty("java.vendor.url", "")), TEXT_FIELD_WIDTH);
    jtfJavaVendor.setEditable(false);
    jtfJavaVendor.setCaretPosition(0);
    GridBagConstraints gbc_jtfJavaVendor = (GridBagConstraints) gbcTextField.clone();
    gbc_jtfJavaVendor.gridy = 4;
    jpSystemInformation.add(jtfJavaVendor, gbc_jtfJavaVendor);
    jlJavaHome = new JLabel(res.getString("DSystemInformation.jlJavaHome.text"), SwingConstants.RIGHT);
    GridBagConstraints gbc_jlJavaHome = (GridBagConstraints) gbcLabel.clone();
    gbc_jlJavaHome.gridy = 5;
    jpSystemInformation.add(jlJavaHome, gbc_jlJavaHome);
    jtfJavaHome = new JTextField(sysProps.getProperty("java.home", ""), TEXT_FIELD_WIDTH);
    jtfJavaHome.setEditable(false);
    jtfJavaHome.setCaretPosition(0);
    GridBagConstraints gbc_jtfJavaHome = (GridBagConstraints) gbcTextField.clone();
    gbc_jtfJavaHome.gridy = 5;
    jpSystemInformation.add(jtfJavaHome, gbc_jtfJavaHome);
    jlJvmMaximumMemory = new JLabel(res.getString("DSystemInformation.jlJvmMaximumMemory.text"), SwingConstants.RIGHT);
    GridBagConstraints gbc_jlJvmMaximumMemory = (GridBagConstraints) gbcLabel.clone();
    gbc_jlJvmMaximumMemory.gridy = 6;
    jpSystemInformation.add(jlJvmMaximumMemory, gbc_jlJvmMaximumMemory);
    jtfJvmMaximumMemory = new JTextField(TEXT_FIELD_WIDTH);
    jtfJvmMaximumMemory.setEditable(false);
    GridBagConstraints gbc_jtfJvmMaximumMemory = (GridBagConstraints) gbcTextField.clone();
    gbc_jtfJvmMaximumMemory.gridy = 6;
    jpSystemInformation.add(jtfJvmMaximumMemory, gbc_jtfJvmMaximumMemory);
    jlJvmTotalMemory = new JLabel(res.getString("DSystemInformation.jlJvmTotalMemory.text"), SwingConstants.RIGHT);
    GridBagConstraints gbc_jlJvmTotalMemory = (GridBagConstraints) gbcLabel.clone();
    gbc_jlJvmTotalMemory.gridy = 7;
    jpSystemInformation.add(jlJvmTotalMemory, gbc_jlJvmTotalMemory);
    jtfJvmTotalMemory = new JTextField(TEXT_FIELD_WIDTH);
    jtfJvmTotalMemory.setEditable(false);
    GridBagConstraints gbc_jtfJvmTotalMemory = (GridBagConstraints) gbcTextField.clone();
    gbc_jtfJvmTotalMemory.gridy = 7;
    jpSystemInformation.add(jtfJvmTotalMemory, gbc_jtfJvmTotalMemory);
    jlJvmFreeMemory = new JLabel(res.getString("DSystemInformation.jlJvmFreeMemory.text"), SwingConstants.RIGHT);
    GridBagConstraints gbc_jlJvmFreeMemory = (GridBagConstraints) gbcLabel.clone();
    gbc_jlJvmFreeMemory.gridy = 8;
    jpSystemInformation.add(jlJvmFreeMemory, gbc_jlJvmFreeMemory);
    jtfJvmFreeMemory = new JTextField(TEXT_FIELD_WIDTH);
    jtfJvmFreeMemory.setEditable(false);
    GridBagConstraints gbc_jtfJvmFreeMemory = (GridBagConstraints) gbcTextField.clone();
    gbc_jtfJvmFreeMemory.gridy = 8;
    jpSystemInformation.add(jtfJvmFreeMemory, gbc_jtfJvmFreeMemory);
    jlAvailableProcessors = new JLabel(res.getString("DSystemInformation.jlAvailableProcessors.text"), SwingConstants.RIGHT);
    GridBagConstraints gbc_jlAvailableProcessors = (GridBagConstraints) gbcLabel.clone();
    gbc_jlAvailableProcessors.gridy = 9;
    jpSystemInformation.add(jlAvailableProcessors, gbc_jlAvailableProcessors);
    jtfAvailableProcessors = new JTextField("" + runtime.availableProcessors(), TEXT_FIELD_WIDTH);
    jtfAvailableProcessors.setEditable(false);
    jtfAvailableProcessors.setCaretPosition(0);
    GridBagConstraints gbc_jtfAvailableProcessors = (GridBagConstraints) gbcTextField.clone();
    gbc_jtfAvailableProcessors.gridy = 9;
    jpSystemInformation.add(jtfAvailableProcessors, gbc_jtfAvailableProcessors);
    jbEnvironmentVariables = new JButton(res.getString("DSystemInformation.jbEnvironmentVariables.text"));
    PlatformUtil.setMnemonic(jbEnvironmentVariables, res.getString("DSystemInformation.jbEnvironmentVariables.mnemonic").charAt(0));
    jbEnvironmentVariables.setToolTipText(res.getString("DSystemInformation.jbEnvironmentVariables.tooltip"));
    jbEnvironmentVariables.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            try {
                CursorUtil.setCursorBusy(DSystemInformation.this);
                environmentVariablesPressed();
            } finally {
                CursorUtil.setCursorFree(DSystemInformation.this);
            }
        }
    });
    jbSystemProperties = new JButton(res.getString("DSystemInformation.jbSystemProperties.text"));
    PlatformUtil.setMnemonic(jbSystemProperties, res.getString("DSystemInformation.jbSystemProperties.mnemonic").charAt(0));
    jbSystemProperties.setToolTipText(res.getString("DSystemInformation.jbSystemProperties.tooltip"));
    jbSystemProperties.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            try {
                CursorUtil.setCursorBusy(DSystemInformation.this);
                systemPropertiesPressed();
            } finally {
                CursorUtil.setCursorFree(DSystemInformation.this);
            }
        }
    });
    jpButtons = new JPanel(new FlowLayout(FlowLayout.CENTER));
    jpButtons.add(jbEnvironmentVariables);
    jpButtons.add(jbSystemProperties);
    GridBagConstraints gbc_jpButtons = new GridBagConstraints();
    gbc_jpButtons.gridx = 0;
    gbc_jpButtons.gridy = 10;
    gbc_jpButtons.gridwidth = 6;
    gbc_jpButtons.gridheight = 1;
    gbc_jpButtons.anchor = GridBagConstraints.EAST;
    jpSystemInformation.add(jpButtons, gbc_jpButtons);
    jbOK = new JButton(res.getString("DSystemInformation.jbOK.text"));
    jbOK.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            okPressed();
        }
    });
    jpOK = PlatformUtil.createDialogButtonPanel(jbOK, false);
    getContentPane().add(jpSystemInformation, BorderLayout.CENTER);
    getContentPane().add(jpOK, BorderLayout.SOUTH);
    setResizable(false);
    addWindowListener(new WindowAdapter() {

        @Override
        public void windowClosing(WindowEvent evt) {
            closeDialog();
        }
    });
    getRootPane().setDefaultButton(jbOK);
    pack();
    startMemoryUpdater();
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) FlowLayout(java.awt.FlowLayout) GridBagLayout(java.awt.GridBagLayout) UnknownHostException(java.net.UnknownHostException) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) WindowAdapter(java.awt.event.WindowAdapter) Properties(java.util.Properties) JTextField(javax.swing.JTextField) EtchedBorder(javax.swing.border.EtchedBorder) BorderLayout(java.awt.BorderLayout) ActionListener(java.awt.event.ActionListener) WindowEvent(java.awt.event.WindowEvent) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) InetAddress(java.net.InetAddress)

Example 8 with EtchedBorder

use of javax.swing.border.EtchedBorder in project keystore-explorer by kaikramer.

the class DUserNoticeChooser method initComponents.

private void initComponents(UserNotice userNotice) {
    jlOrganization = new JLabel(res.getString("DUserNoticeChooser.jlOrganization.text"));
    GridBagConstraints gbc_jlOrganization = new GridBagConstraints();
    gbc_jlOrganization.gridx = 0;
    gbc_jlOrganization.gridy = 0;
    gbc_jlOrganization.gridwidth = 1;
    gbc_jlOrganization.gridheight = 1;
    gbc_jlOrganization.insets = new Insets(5, 5, 5, 5);
    gbc_jlOrganization.anchor = GridBagConstraints.EAST;
    jtfOrganization = new JTextField(40);
    jtfOrganization.setToolTipText(res.getString("DUserNoticeChooser.jtfOrganization.tooltip"));
    GridBagConstraints gbc_jtfOrganization = new GridBagConstraints();
    gbc_jtfOrganization.gridx = 1;
    gbc_jtfOrganization.gridy = 0;
    gbc_jtfOrganization.gridwidth = 1;
    gbc_jtfOrganization.gridheight = 1;
    gbc_jtfOrganization.insets = new Insets(5, 5, 5, 5);
    gbc_jtfOrganization.anchor = GridBagConstraints.WEST;
    jlNoticeNumbers = new JLabel(res.getString("DUserNoticeChooser.jlNoticeNumbers.text"));
    GridBagConstraints gbc_jlNoticeNumbers = new GridBagConstraints();
    gbc_jlNoticeNumbers.gridx = 0;
    gbc_jlNoticeNumbers.gridy = 1;
    gbc_jlNoticeNumbers.gridwidth = 1;
    gbc_jlNoticeNumbers.gridheight = 1;
    gbc_jlNoticeNumbers.insets = new Insets(5, 5, 5, 5);
    gbc_jlNoticeNumbers.anchor = GridBagConstraints.EAST;
    jtfNoticeNumbers = new JTextField(20);
    jtfNoticeNumbers.setToolTipText(res.getString("DUserNoticeChooser.jtfNoticeNumbers.tooltip"));
    GridBagConstraints gbc_jtfNoticeNumbers = new GridBagConstraints();
    gbc_jtfNoticeNumbers.gridx = 1;
    gbc_jtfNoticeNumbers.gridy = 1;
    gbc_jtfNoticeNumbers.gridwidth = 1;
    gbc_jtfNoticeNumbers.gridheight = 1;
    gbc_jtfNoticeNumbers.insets = new Insets(5, 5, 5, 5);
    gbc_jtfNoticeNumbers.anchor = GridBagConstraints.WEST;
    jpNoticeReference = new JPanel(new GridBagLayout());
    jpNoticeReference.setBorder(new TitledBorder(res.getString("DUserNoticeChooser.jpNoticeReference.text")));
    jpNoticeReference.add(jlOrganization, gbc_jlOrganization);
    jpNoticeReference.add(jtfOrganization, gbc_jtfOrganization);
    jpNoticeReference.add(jlNoticeNumbers, gbc_jlNoticeNumbers);
    jpNoticeReference.add(jtfNoticeNumbers, gbc_jtfNoticeNumbers);
    jlExplicitText = new JLabel(res.getString("DUserNoticeChooser.jlExplicitText.text"));
    jtfExplicitText = new JTextField(40);
    jtfExplicitText.setToolTipText(res.getString("DUserNoticeChooser.jtfExplicitText.tooltip"));
    jpExplicitText = new JPanel(new FlowLayout(FlowLayout.LEFT));
    jpExplicitText.add(jlExplicitText);
    jpExplicitText.add(jtfExplicitText);
    jpUserNotice = new JPanel(new BorderLayout());
    jpUserNotice.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
    jpUserNotice.add(jpNoticeReference, BorderLayout.CENTER);
    jpUserNotice.add(jpExplicitText, BorderLayout.SOUTH);
    jbOK = new JButton(res.getString("DUserNoticeChooser.jbOK.text"));
    jbOK.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            okPressed();
        }
    });
    jbCancel = new JButton(res.getString("DUserNoticeChooser.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(BorderLayout.CENTER, jpUserNotice);
    getContentPane().add(BorderLayout.SOUTH, jpButtons);
    populate(userNotice);
    setResizable(false);
    getRootPane().setDefaultButton(jbOK);
    pack();
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) FlowLayout(java.awt.FlowLayout) GridBagLayout(java.awt.GridBagLayout) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) TitledBorder(javax.swing.border.TitledBorder) EtchedBorder(javax.swing.border.EtchedBorder) BorderLayout(java.awt.BorderLayout) ActionListener(java.awt.event.ActionListener) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) AbstractAction(javax.swing.AbstractAction)

Example 9 with EtchedBorder

use of javax.swing.border.EtchedBorder in project keystore-explorer by kaikramer.

the class DGeneralSubtreeChooser method initComponents.

private void initComponents(GeneralSubtree generalSubtree) {
    jlBase = new JLabel(res.getString("DGeneralSubtreeChooser.jlBase.text"));
    GridBagConstraints gbc_jlBase = new GridBagConstraints();
    gbc_jlBase.gridx = 0;
    gbc_jlBase.gridy = 0;
    gbc_jlBase.gridwidth = 1;
    gbc_jlBase.gridheight = 1;
    gbc_jlBase.insets = new Insets(5, 5, 0, 5);
    gbc_jlBase.anchor = GridBagConstraints.EAST;
    jgnBase = new JGeneralName(res.getString("DGeneralSubtreeChooser.Base.Title"));
    jgnBase.setToolTipText(res.getString("DGeneralSubtreeChooser.jgnBase.tooltip"));
    GridBagConstraints gbc_jgnBase = new GridBagConstraints();
    gbc_jgnBase.gridx = 1;
    gbc_jgnBase.gridy = 0;
    gbc_jgnBase.gridwidth = 1;
    gbc_jgnBase.gridheight = 1;
    gbc_jgnBase.insets = new Insets(5, 5, 0, 5);
    gbc_jgnBase.anchor = GridBagConstraints.WEST;
    jlMinimum = new JLabel(res.getString("DGeneralSubtreeChooser.jlMinimum.text"));
    GridBagConstraints gbc_jlMinimum = new GridBagConstraints();
    gbc_jlMinimum.gridx = 0;
    gbc_jlMinimum.gridy = 1;
    gbc_jlMinimum.gridwidth = 1;
    gbc_jlMinimum.gridheight = 1;
    gbc_jlMinimum.insets = new Insets(5, 5, 5, 5);
    gbc_jlMinimum.anchor = GridBagConstraints.EAST;
    jtfMinimum = new JTextField(3);
    jtfMinimum.setToolTipText(res.getString("DGeneralSubtreeChooser.jtfMinimum.tooltip"));
    GridBagConstraints gbc_jtfMinimum = new GridBagConstraints();
    gbc_jtfMinimum.gridx = 1;
    gbc_jtfMinimum.gridy = 1;
    gbc_jtfMinimum.gridwidth = 1;
    gbc_jtfMinimum.gridheight = 1;
    gbc_jtfMinimum.insets = new Insets(5, 5, 5, 5);
    gbc_jtfMinimum.anchor = GridBagConstraints.WEST;
    jlMaximum = new JLabel(res.getString("DGeneralSubtreeChooser.jlMaximum.text"));
    GridBagConstraints gbc_jlMaximum = new GridBagConstraints();
    gbc_jlMaximum.gridx = 0;
    gbc_jlMaximum.gridy = 2;
    gbc_jlMaximum.gridwidth = 1;
    gbc_jlMaximum.gridheight = 1;
    gbc_jlMaximum.insets = new Insets(5, 5, 5, 5);
    gbc_jlMaximum.anchor = GridBagConstraints.EAST;
    jtfMaximum = new JTextField(3);
    jtfMaximum.setToolTipText(res.getString("DGeneralSubtreeChooser.jtfMaximum.tooltip"));
    GridBagConstraints gbc_jtfMaximum = new GridBagConstraints();
    gbc_jtfMaximum.gridx = 1;
    gbc_jtfMaximum.gridy = 2;
    gbc_jtfMaximum.gridwidth = 1;
    gbc_jtfMaximum.gridheight = 1;
    gbc_jtfMaximum.insets = new Insets(5, 5, 5, 5);
    gbc_jtfMaximum.anchor = GridBagConstraints.WEST;
    jpGeneralSubtree = new JPanel(new GridBagLayout());
    jpGeneralSubtree.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
    jpGeneralSubtree.add(jlBase, gbc_jlBase);
    jpGeneralSubtree.add(jgnBase, gbc_jgnBase);
    jpGeneralSubtree.add(jlMinimum, gbc_jlMinimum);
    jpGeneralSubtree.add(jtfMinimum, gbc_jtfMinimum);
    jpGeneralSubtree.add(jlMaximum, gbc_jlMaximum);
    jpGeneralSubtree.add(jtfMaximum, gbc_jtfMaximum);
    jbOK = new JButton(res.getString("DGeneralSubtreeChooser.jbOK.text"));
    jbOK.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            okPressed();
        }
    });
    jbCancel = new JButton(res.getString("DGeneralSubtreeChooser.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(BorderLayout.CENTER, jpGeneralSubtree);
    getContentPane().add(BorderLayout.SOUTH, jpButtons);
    populate(generalSubtree);
    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) JGeneralName(org.kse.gui.crypto.generalname.JGeneralName) JTextField(javax.swing.JTextField) EtchedBorder(javax.swing.border.EtchedBorder) ActionListener(java.awt.event.ActionListener) BorderLayout(java.awt.BorderLayout) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) AbstractAction(javax.swing.AbstractAction)

Example 10 with EtchedBorder

use of javax.swing.border.EtchedBorder in project keystore-explorer by kaikramer.

the class DPolicyMappingChooser method initComponents.

private void initComponents(PolicyMapping policyMapping) {
    jlIssuerDomainPolicy = new JLabel(res.getString("DPolicyMappingChooser.jlIssuerDomainPolicy.text"));
    GridBagConstraints gbc_jlIssuerDomainPolicy = new GridBagConstraints();
    gbc_jlIssuerDomainPolicy.gridx = 0;
    gbc_jlIssuerDomainPolicy.gridy = 0;
    gbc_jlIssuerDomainPolicy.gridwidth = 1;
    gbc_jlIssuerDomainPolicy.gridheight = 1;
    gbc_jlIssuerDomainPolicy.insets = new Insets(5, 5, 5, 5);
    gbc_jlIssuerDomainPolicy.anchor = GridBagConstraints.EAST;
    joiIssuerDomainPolicy = new JObjectId(res.getString("DPolicyMappingChooser.IssuerDomainPolicy.Title"));
    joiIssuerDomainPolicy.setToolTipText(res.getString("DPolicyMappingChooser.joiIssuerDomainPolicy.tooltip"));
    GridBagConstraints gbc_joiIssuerDomainPolicy = new GridBagConstraints();
    gbc_joiIssuerDomainPolicy.gridx = 1;
    gbc_joiIssuerDomainPolicy.gridy = 0;
    gbc_joiIssuerDomainPolicy.gridwidth = 1;
    gbc_joiIssuerDomainPolicy.gridheight = 1;
    gbc_joiIssuerDomainPolicy.insets = new Insets(5, 5, 5, 5);
    gbc_joiIssuerDomainPolicy.anchor = GridBagConstraints.WEST;
    jlSubjectDomainPolicy = new JLabel(res.getString("DPolicyMappingChooser.jlSubjectDomainPolicy.text"));
    GridBagConstraints gbc_jlSubjectDomainPolicy = new GridBagConstraints();
    gbc_jlSubjectDomainPolicy.gridx = 0;
    gbc_jlSubjectDomainPolicy.gridy = 1;
    gbc_jlSubjectDomainPolicy.gridwidth = 1;
    gbc_jlSubjectDomainPolicy.gridheight = 1;
    gbc_jlSubjectDomainPolicy.insets = new Insets(5, 5, 5, 5);
    gbc_jlSubjectDomainPolicy.anchor = GridBagConstraints.EAST;
    joiSubjectDomainPolicy = new JObjectId(res.getString("DPolicyMappingChooser.SubjectDomainPolicy.Title"));
    joiSubjectDomainPolicy.setToolTipText(res.getString("DPolicyMappingChooser.joiSubjectDomainPolicy.tooltip"));
    GridBagConstraints gbc_joiSubjectDomainPolicy = new GridBagConstraints();
    gbc_joiSubjectDomainPolicy.gridx = 1;
    gbc_joiSubjectDomainPolicy.gridy = 1;
    gbc_joiSubjectDomainPolicy.gridwidth = 1;
    gbc_joiSubjectDomainPolicy.gridheight = 1;
    gbc_joiSubjectDomainPolicy.insets = new Insets(5, 5, 5, 5);
    gbc_joiSubjectDomainPolicy.anchor = GridBagConstraints.WEST;
    jpPolicyMapping = new JPanel(new GridBagLayout());
    jpPolicyMapping.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
    jpPolicyMapping.add(jlIssuerDomainPolicy, gbc_jlIssuerDomainPolicy);
    jpPolicyMapping.add(joiIssuerDomainPolicy, gbc_joiIssuerDomainPolicy);
    jpPolicyMapping.add(jlSubjectDomainPolicy, gbc_jlSubjectDomainPolicy);
    jpPolicyMapping.add(joiSubjectDomainPolicy, gbc_joiSubjectDomainPolicy);
    jbOK = new JButton(res.getString("DPolicyMappingChooser.jbOK.text"));
    jbOK.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            okPressed();
        }
    });
    jbCancel = new JButton(res.getString("DPolicyMappingChooser.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(BorderLayout.CENTER, jpPolicyMapping);
    getContentPane().add(BorderLayout.SOUTH, jpButtons);
    populate(policyMapping);
    setResizable(false);
    getRootPane().setDefaultButton(jbOK);
    pack();
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) JObjectId(org.kse.gui.oid.JObjectId) GridBagLayout(java.awt.GridBagLayout) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) EtchedBorder(javax.swing.border.EtchedBorder) ActionListener(java.awt.event.ActionListener) BorderLayout(java.awt.BorderLayout) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) AbstractAction(javax.swing.AbstractAction)

Aggregations

EtchedBorder (javax.swing.border.EtchedBorder)116 JPanel (javax.swing.JPanel)92 JButton (javax.swing.JButton)74 JLabel (javax.swing.JLabel)74 ActionEvent (java.awt.event.ActionEvent)73 BorderLayout (java.awt.BorderLayout)72 ActionListener (java.awt.event.ActionListener)70 EmptyBorder (javax.swing.border.EmptyBorder)63 CompoundBorder (javax.swing.border.CompoundBorder)62 AbstractAction (javax.swing.AbstractAction)58 WindowAdapter (java.awt.event.WindowAdapter)55 WindowEvent (java.awt.event.WindowEvent)55 Insets (java.awt.Insets)46 GridBagConstraints (java.awt.GridBagConstraints)43 GridBagLayout (java.awt.GridBagLayout)43 JTextField (javax.swing.JTextField)40 Dimension (java.awt.Dimension)24 TitledBorder (javax.swing.border.TitledBorder)22 FlowLayout (java.awt.FlowLayout)18 JScrollPane (javax.swing.JScrollPane)17