Search in sources :

Example 26 with GridLayout

use of java.awt.GridLayout in project nhin-d by DirectProject.

the class CAPanel method initUI.

protected void initUI() {
    setLayout(new BorderLayout());
    //setBorder(new SoftBevelBorder(BevelBorder.LOWERED));
    setBorder(new CompoundBorder(new SoftBevelBorder(BevelBorder.LOWERED), new EmptyBorder(5, 5, 5, 5)));
    createCA = new JRadioButton("Create New CA");
    loadCA = new JRadioButton("Load CA");
    ButtonGroup group = new ButtonGroup();
    group.add(createCA);
    group.add(loadCA);
    createCA.setSelected(true);
    JPanel radioPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    radioPanel.add(createCA);
    radioPanel.add(loadCA);
    JPanel fieldsPanel = new JPanel();
    fieldsPanel.setLayout(new GridLayout(3, 3, 10, 10));
    cnField = new TextEntryField("CN:");
    fieldsPanel.add(cnField);
    countryField = new TextEntryField("Country:");
    fieldsPanel.add(countryField);
    stateField = new TextEntryField("State:");
    fieldsPanel.add(stateField);
    locField = new TextEntryField("Location:");
    fieldsPanel.add(locField);
    orgField = new TextEntryField("Org:");
    fieldsPanel.add(orgField);
    emailField = new TextEntryField("Email:");
    fieldsPanel.add(emailField);
    expField = new SpinEntryField("Experiation (Days):", 365);
    fieldsPanel.add(expField);
    keyStr = new DropDownEntry("Key Strength:", new Object[] { 1024, 2048, 4096 });
    fieldsPanel.add(keyStr);
    passField = new PasswordField("Password:");
    fieldsPanel.add(passField);
    JPanel topPanel = new JPanel(new BorderLayout());
    topPanel.add(radioPanel, BorderLayout.NORTH);
    topPanel.add(fieldsPanel, BorderLayout.CENTER);
    add(topPanel, BorderLayout.NORTH);
    new FlowLayout(FlowLayout.LEFT);
    certFileField = new FileField("Certificate Authority File:", "");
    keyFileField = new FileField("Private Key File:", "");
    JPanel filePanel = new JPanel(new GridLayout(1, 2));
    filePanel.add(certFileField);
    filePanel.add(keyFileField);
    loadCert = new JButton("Load");
    loadCert.setVisible(false);
    createCert = new JButton("Create");
    clear = new JButton("Clear");
    clear.setVisible(false);
    clear = new JButton("Clear");
    genCert = new JButton("Create Leaf Cert");
    genCert.setVisible(false);
    signCSR = new JButton("Sign CSR");
    signCSR.setVisible(false);
    addToAltSubjects = new JCheckBox("Add Email To Alt Subject Names");
    addToAltSubjects.setVisible(false);
    addToAltSubjects.setSelected(true);
    allowedToSign = new JCheckBox("Allowed To Sign Certificates");
    allowedToSign.setVisible(false);
    keyEnc = new JCheckBox("Key Encipherment Use");
    keyEnc.setVisible(false);
    keyEnc.setSelected(true);
    digitalSig = new JCheckBox("Digital Signature Use");
    digitalSig.setVisible(false);
    keyEnc.setSelected(true);
    JPanel addAltPanel = new JPanel(new GridLayout(2, 2));
    addAltPanel.setPreferredSize(new Dimension(450, addAltPanel.getPreferredSize().height));
    //addAltPanel.add(addToAltSubjects);
    addAltPanel.add(allowedToSign);
    addAltPanel.add(keyEnc);
    addAltPanel.add(digitalSig);
    JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttonPanel.add(addAltPanel);
    buttonPanel.add(loadCert);
    buttonPanel.add(createCert);
    buttonPanel.add(clear);
    buttonPanel.add(genCert);
    buttonPanel.add(signCSR);
    JPanel combineAltAndButtonPanel = new JPanel(new BorderLayout());
    //combineAltAndButtonPanel.add(addAltPanel, BorderLayout.WEST);
    combineAltAndButtonPanel.add(buttonPanel, BorderLayout.EAST);
    JPanel bottomPannel = new JPanel(new BorderLayout());
    bottomPannel.add(filePanel, BorderLayout.NORTH);
    bottomPannel.add(combineAltAndButtonPanel, BorderLayout.SOUTH);
    this.add(bottomPannel, BorderLayout.SOUTH);
}
Also used : JPanel(javax.swing.JPanel) JRadioButton(javax.swing.JRadioButton) FlowLayout(java.awt.FlowLayout) JButton(javax.swing.JButton) Dimension(java.awt.Dimension) JCheckBox(javax.swing.JCheckBox) GridLayout(java.awt.GridLayout) BorderLayout(java.awt.BorderLayout) ButtonGroup(javax.swing.ButtonGroup) SoftBevelBorder(javax.swing.border.SoftBevelBorder) CompoundBorder(javax.swing.border.CompoundBorder) JPasswordField(javax.swing.JPasswordField) EmptyBorder(javax.swing.border.EmptyBorder)

Example 27 with GridLayout

use of java.awt.GridLayout in project nhin-d by DirectProject.

the class ValidatePanel method initUI.

protected void initUI() {
    setLayout(new BorderLayout());
    setBorder(new CompoundBorder(new SoftBevelBorder(BevelBorder.LOWERED), new EmptyBorder(5, 5, 5, 5)));
    // File Load Fields
    policyFileField = new FileField("Policy Definition File:", "");
    certFileField = new FileField("Certificate File: ", "");
    final JPanel filePanel = new JPanel(new GridLayout(1, 2));
    filePanel.add(certFileField);
    filePanel.add(policyFileField);
    this.add(filePanel, BorderLayout.NORTH);
    // Report panel
    final JLabel reportHeaderLabel = new JLabel("Validation Report");
    reportText = new JTextArea();
    reportText.setLineWrap(true);
    reportText.setWrapStyleWord(true);
    reportText.setEditable(false);
    final JScrollPane scrollPane = new JScrollPane(reportText);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    final JPanel reportPanel = new JPanel(new BorderLayout());
    reportPanel.add(reportHeaderLabel, BorderLayout.NORTH);
    reportPanel.add(scrollPane, BorderLayout.CENTER);
    this.add(reportPanel, BorderLayout.CENTER);
    // Button Panel
    cmdValidate = new JButton("Validate");
    JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttonPanel.add(cmdValidate);
    this.add(buttonPanel, BorderLayout.SOUTH);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) JTextArea(javax.swing.JTextArea) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) JButton(javax.swing.JButton) SoftBevelBorder(javax.swing.border.SoftBevelBorder) JLabel(javax.swing.JLabel) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 28 with GridLayout

use of java.awt.GridLayout in project jdk8u_jdk by JetBrains.

the class SelectionAutoscrollTest method createObjects.

void createObjects() {
    textArea = new TextArea(bigString());
    robot = Util.createRobot();
    Panel panel = new Panel();
    panel.setLayout(new GridLayout(3, 3));
    for (int y = 0; y < 3; ++y) {
        for (int x = 0; x < 3; ++x) {
            if (x == 1 && y == 1) {
                panel.add(textArea);
            } else {
                panel.add(new Panel());
            }
        }
    }
    Frame frame = new Frame("TextArea cursor icon test");
    frame.setSize(300, 300);
    frame.add(panel);
    frame.setVisible(true);
}
Also used : Panel(java.awt.Panel) GridLayout(java.awt.GridLayout) Frame(java.awt.Frame) TextArea(java.awt.TextArea) Point(java.awt.Point)

Example 29 with GridLayout

use of java.awt.GridLayout in project jdk8u_jdk by JetBrains.

the class bug8033069NoScrollBar method setupUI.

private void setupUI() {
    frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    cb1 = new JComboBox<>(items);
    cb2 = new JComboBox<>(items);
    JPanel panel = new JPanel(new GridLayout(1, 2));
    panel.add(cb1);
    panel.add(cb2);
    frame.add(panel);
    frame.pack();
    frame.setVisible(true);
}
Also used : JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) JFrame(javax.swing.JFrame)

Example 30 with GridLayout

use of java.awt.GridLayout in project jdk8u_jdk by JetBrains.

the class FileDialogForDirectories method init.

@Override
public void init() {
    if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
        Sysout.createDialogWithInstructions(new String[] { "Press PASS, this test is for MacOS X only." });
        return;
    }
    System.setProperty("apple.awt.fileDialogForDirectories", "true");
    setLayout(new GridLayout(1, 1));
    fd = new FileDialog(new Frame(), "Open");
    showBtn = new Button("Show File Dialog");
    showBtn.addActionListener(this);
    add(showBtn);
    String[] instructions = { "1) Click on 'Show File Dialog' button. A file dialog will come up.", "2) Check that files can't be selected.", "3) Check that directories can be selected.", "4) Repeat steps 1 - 3 a few times for different files and directories.", "5) If it's true then the test passed, otherwise it failed." };
    Sysout.createDialogWithInstructions(instructions);
}
Also used : GridLayout(java.awt.GridLayout) Frame(java.awt.Frame) Button(java.awt.Button) FileDialog(java.awt.FileDialog)

Aggregations

GridLayout (java.awt.GridLayout)142 JPanel (javax.swing.JPanel)106 JLabel (javax.swing.JLabel)54 BorderLayout (java.awt.BorderLayout)50 Dimension (java.awt.Dimension)32 JButton (javax.swing.JButton)32 ActionEvent (java.awt.event.ActionEvent)29 JScrollPane (javax.swing.JScrollPane)27 ActionListener (java.awt.event.ActionListener)25 JTextField (javax.swing.JTextField)23 Insets (java.awt.Insets)21 JCheckBox (javax.swing.JCheckBox)21 GridBagConstraints (java.awt.GridBagConstraints)17 GridBagLayout (java.awt.GridBagLayout)17 TitledBorder (javax.swing.border.TitledBorder)17 PlotCanvas (smile.plot.PlotCanvas)16 BoxLayout (javax.swing.BoxLayout)15 EmptyBorder (javax.swing.border.EmptyBorder)15 FlowLayout (java.awt.FlowLayout)13 ButtonGroup (javax.swing.ButtonGroup)10