/** *CreatescontrolstoaltertheJSplitPane.
*/ protected JPanel createSplitPaneControls() {
JPanel wrapper = new JPanel();
ButtonGroup group = new ButtonGroup();
JRadioButton button;
Box buttonWrapper = new Box(BoxLayout.X_AXIS);
wrapper.setLayout(new GridLayout(0, 1));
/* Create a radio button to vertically split the split pane. */
button = new JRadioButton(getString("SplitPaneDemo.vert_split"));
button.setMnemonic(getMnemonic("SplitPaneDemo.vert_split_mnemonic"));
button.addActionListener(new ActionListener() { publicvoid actionPerformed(ActionEvent e) {
splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
}
});
group.add(button);
buttonWrapper.add(button);
/* Create a radio button the horizontally split the split pane. */
button = new JRadioButton(getString("SplitPaneDemo.horz_split"));
button.setMnemonic(getMnemonic("SplitPaneDemo.horz_split_mnemonic"));
button.setSelected(true);
button.addActionListener(new ActionListener() { publicvoid actionPerformed(ActionEvent e) {
splitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
}
});
group.add(button);
buttonWrapper.add(button);
/* Create a check box as to whether or not the split pane continually
lays out the component when dragging. */
JCheckBox checkBox = new JCheckBox(getString("SplitPaneDemo.cont_layout"));
checkBox.setMnemonic(getMnemonic("SplitPaneDemo.cont_layout_mnemonic"));
checkBox.setSelected(true);
/* Create a check box as to whether or not the split pane divider
contains the oneTouchExpandable buttons. */
checkBox = new JCheckBox(getString("SplitPaneDemo.one_touch_expandable"));
checkBox.setMnemonic(getMnemonic("SplitPaneDemo.one_touch_expandable_mnemonic"));
checkBox.setSelected(true);
/* Create a text field that will change the preferred/minimum size
of the earth component. */
earthSize = new JTextField(String.valueOf(earth.getMinimumSize().width));
earthSize.setColumns(5);
earthSize.getAccessibleContext().setAccessibleName(getString("SplitPaneDemo.first_component_min_size"));
earthSize.addActionListener(new ActionListener() { publicvoid actionPerformed(ActionEvent e) {
String value = ((JTextField)e.getSource()).getText(); int newSize;
/* Create a text field that will change the preferred/minimum size
of the moon component. */
moonSize = new JTextField(String.valueOf(moon.getMinimumSize().width));
moonSize.setColumns(5);
moonSize.getAccessibleContext().setAccessibleName(getString("SplitPaneDemo.second_component_min_size"));
moonSize.addActionListener(new ActionListener() { publicvoid actionPerformed(ActionEvent e) {
String value = ((JTextField)e.getSource()).getText(); int newSize;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.