Search in sources :

Example 71 with Container

use of java.awt.Container in project JMRI by JMRI.

the class RenumberFrame method initComponents.

/**
     * Initialize the window
     */
@Override
public void initComponents() {
    setTitle(rb.getString("WindowTitleRenumber"));
    Container contentPane = getContentPane();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
    JPanel p = new JPanel();
    p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
    contentPane.add(p);
    p.add(new JLabel(rb.getString("LabelFrom")));
    from = new JTextField(4);
    p.add(from);
    p.add(new JLabel(rb.getString("LabelTo")));
    to = new JTextField(4);
    p.add(to);
    p = new JPanel();
    p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
    contentPane.add(p);
    JButton b = new JButton(rb.getString("ButtonExec"));
    p.add(b);
    b.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent event) {
            execute();
        }
    });
    // add help menu to window
    addHelpMenu("package.jmri.jmrix.grapevine.nodetable.RenumberFrame", true);
    // pack for display
    pack();
}
Also used : JPanel(javax.swing.JPanel) Container(java.awt.Container) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) BoxLayout(javax.swing.BoxLayout) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField)

Example 72 with Container

use of java.awt.Container 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 73 with Container

use of java.awt.Container 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 74 with Container

use of java.awt.Container 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)

Example 75 with Container

use of java.awt.Container in project JMRI by JMRI.

the class TieToolFrame 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));
    ProducerTablePane producerPane = new ProducerTablePane();
    producerPane.initComponents();
    Border producerBorder = BorderFactory.createEtchedBorder();
    Border producerTitled = BorderFactory.createTitledBorder(producerBorder, "Producers");
    producerPane.setBorder(producerTitled);
    ConsumerTablePane consumerPane = new ConsumerTablePane();
    consumerPane.initComponents();
    Border consumerBorder = BorderFactory.createEtchedBorder();
    Border consumerTitled = BorderFactory.createTitledBorder(consumerBorder, "Consumers");
    consumerPane.setBorder(consumerTitled);
    TieTablePane tiePane = new TieTablePane();
    tiePane.initComponents();
    Border tieBorder = BorderFactory.createEtchedBorder();
    Border tieTitled = BorderFactory.createTitledBorder(tieBorder, "Events");
    tiePane.setBorder(tieTitled);
    JSplitPane upperSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, producerPane, consumerPane);
    JSplitPane wholeSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, upperSplit, tiePane);
    JPanel p1 = new JPanel();
    p1.add(wholeSplit);
    contentPane.add(p1);
    JPanel p2 = new JPanel();
    p2.setLayout(new FlowLayout());
    p2.add(new JButton("Add"));
    p2.add(new JButton("Update"));
    p2.add(new JButton("Delete"));
    contentPane.add(p2);
    // initialize menu bar
    JMenuBar menuBar = new JMenuBar();
    // set up File menu
    JMenu fileMenu = new JMenu("File");
    menuBar.add(fileMenu);
    // fileMenu.add(...);
    setJMenuBar(menuBar);
    addHelpMenu("package.jmri.jmrix.openlcb.swing.tie.TieToolFrame", true);
    // pack for display
    pack();
}
Also used : JPanel(javax.swing.JPanel) Container(java.awt.Container) FlowLayout(java.awt.FlowLayout) BoxLayout(javax.swing.BoxLayout) JButton(javax.swing.JButton) JSplitPane(javax.swing.JSplitPane) Border(javax.swing.border.Border) JMenuBar(javax.swing.JMenuBar) JMenu(javax.swing.JMenu)

Aggregations

Container (java.awt.Container)250 JPanel (javax.swing.JPanel)70 JLabel (javax.swing.JLabel)65 JButton (javax.swing.JButton)56 JScrollPane (javax.swing.JScrollPane)55 BoxLayout (javax.swing.BoxLayout)50 FlowLayout (java.awt.FlowLayout)49 Component (java.awt.Component)46 BorderLayout (java.awt.BorderLayout)44 Dimension (java.awt.Dimension)39 ActionEvent (java.awt.event.ActionEvent)38 ActionListener (java.awt.event.ActionListener)26 JComponent (javax.swing.JComponent)22 JFrame (javax.swing.JFrame)22 JmriJFrame (jmri.util.JmriJFrame)20 Border (javax.swing.border.Border)18 JTable (javax.swing.JTable)17 JTextArea (javax.swing.JTextArea)17 Frame (java.awt.Frame)16 JTextField (javax.swing.JTextField)16