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