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();
}
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();
}
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();
}
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);
}
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();
}
Aggregations