Search in sources :

Example 91 with BoxLayout

use of javax.swing.BoxLayout in project JMRI by JMRI.

the class SerialPacketGenFrame method initComponents.

@Override
public void initComponents() throws Exception {
    // the following code sets the frame's initial state
    jLabel1.setText("Command:");
    jLabel1.setVisible(true);
    sendButton.setText("Send");
    sendButton.setVisible(true);
    sendButton.setToolTipText("Send packet");
    packetTextField.setText("");
    packetTextField.setToolTipText("Enter command as hexadecimal bytes separated by a space");
    packetTextField.setMaximumSize(new Dimension(packetTextField.getMaximumSize().width, packetTextField.getPreferredSize().height));
    setTitle("Send Grapevine serial command");
    getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
    getContentPane().add(jLabel1);
    getContentPane().add(packetTextField);
    JPanel p1 = new JPanel();
    p1.setLayout(new BoxLayout(p1, BoxLayout.X_AXIS));
    p1.add(parityButton);
    p1.add(sendButton);
    getContentPane().add(p1);
    sendButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent e) {
            sendButtonActionPerformed(e);
        }
    });
    parityButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent e) {
            parityButtonActionPerformed(e);
        }
    });
    getContentPane().add(new JSeparator(JSeparator.HORIZONTAL));
    // add poll message buttons
    JPanel pane3 = new JPanel();
    pane3.setLayout(new FlowLayout());
    pane3.add(new JLabel("Address:"));
    pane3.add(uaAddrField);
    pane3.add(pollButton);
    uaAddrField.setText("0");
    uaAddrField.setToolTipText("Enter node address (decimal integer)");
    getContentPane().add(pane3);
    pollButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent e) {
            pollButtonActionPerformed(e);
        }
    });
    pollButton.setToolTipText("Send poll request");
    // add help menu to window
    addHelpMenu("package.jmri.jmrix.grapevine.packetgen.SerialPacketGenFrame", true);
    // pack for display
    pack();
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) JSeparator(javax.swing.JSeparator)

Example 92 with BoxLayout

use of javax.swing.BoxLayout in project JMRI by JMRI.

the class ConnectionConfig method loadDetails.

@Override
public void loadDetails(JPanel details) {
    // have to embed the usual one in a new JPanel
    JPanel p = new JPanel();
    super.loadDetails(p);
    details.setLayout(new BoxLayout(details, BoxLayout.Y_AXIS));
    details.add(p);
// add another button
//JButton b = new JButton("Configure nodes");
//details.add(b);
//b.addActionListener(new NodeConfigAction());  
}
Also used : JPanel(javax.swing.JPanel) BoxLayout(javax.swing.BoxLayout)

Example 93 with BoxLayout

use of javax.swing.BoxLayout in project JMRI by JMRI.

the class NodeTableFrame method initComponents.

/**
     * Initialize the window
     */
@Override
public void initComponents() {
    setTitle(rb.getString("WindowTitle"));
    Container contentPane = getContentPane();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
    // add table
    p = new NodeTablePane();
    p.initComponents();
    contentPane.add(p);
    // add help menu to window
    addHelpMenu("package.jmri.jmrix.grapevine.nodetable.NodeTableFrame", true);
    // register
    SerialTrafficController.instance().addSerialListener(p);
    // pack for display
    pack();
}
Also used : Container(java.awt.Container) BoxLayout(javax.swing.BoxLayout)

Example 94 with BoxLayout

use of javax.swing.BoxLayout in project JMRI by JMRI.

the class TreeFrame method initComponents.

@Override
public void initComponents() throws Exception {
    // set the frame's initial state
    setTitle(rb.getString("WindowTitle"));
    Container contentPane = getContentPane();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
    // add only content pane 
    contentPane.add(new TreePanel());
    // add help menu
    addHelpMenu("package.jmri.jmrix.jinput.treecontrol.TreeFrame", true);
    // pack for display
    pack();
}
Also used : Container(java.awt.Container) BoxLayout(javax.swing.BoxLayout)

Example 95 with BoxLayout

use of javax.swing.BoxLayout in project JMRI by JMRI.

the class NodeConfigFrame method initComponents.

/**
     * Initialize the config window
     */
@Override
public void initComponents() {
    setTitle(Bundle.getMessage("WindowTitle"));
    Container contentPane = getContentPane();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
    contentPane.add(initAddressPanel());
    // Set up the pin assignment table
    assignmentPanel = new JPanel();
    assignmentPanel.setLayout(new BoxLayout(assignmentPanel, BoxLayout.Y_AXIS));
    assignmentListModel = new AssignmentTableModel();
    assignmentTable = new JTable(assignmentListModel);
    assignmentTable.setRowSelectionAllowed(false);
    assignmentTable.setPreferredScrollableViewportSize(new java.awt.Dimension(300, 350));
    JScrollPane assignmentScrollPane = new JScrollPane(assignmentTable);
    assignmentPanel.add(assignmentScrollPane, BorderLayout.CENTER);
    contentPane.add(assignmentPanel);
    contentPane.add(initNotesPanel());
    contentPane.add(initButtonPanel());
    // pack for display
    pack();
    // after the components are configured, set ourselves up as a 
    // discovery listener.
    xtc.getXBee().getNetwork().addDiscoveryListener(this);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) Container(java.awt.Container) BoxLayout(javax.swing.BoxLayout) JTable(javax.swing.JTable)

Aggregations

BoxLayout (javax.swing.BoxLayout)593 JPanel (javax.swing.JPanel)510 JLabel (javax.swing.JLabel)301 Dimension (java.awt.Dimension)189 ActionEvent (java.awt.event.ActionEvent)179 JButton (javax.swing.JButton)173 ActionListener (java.awt.event.ActionListener)155 JScrollPane (javax.swing.JScrollPane)140 FlowLayout (java.awt.FlowLayout)130 JCheckBox (javax.swing.JCheckBox)74 BorderLayout (java.awt.BorderLayout)73 GridBagLayout (java.awt.GridBagLayout)66 ButtonGroup (javax.swing.ButtonGroup)58 JTable (javax.swing.JTable)53 JTextField (javax.swing.JTextField)53 Container (java.awt.Container)51 JmriJFrame (jmri.util.JmriJFrame)45 JComboBox (javax.swing.JComboBox)44 JSeparator (javax.swing.JSeparator)44 Box (javax.swing.Box)41