摘要:
// To create a tabbed pane, see e828 创建JTabbedPane // Remove the last tab pane.remove(pane.getTabCount()-1); // Remove the tab with the specified child component pane.remove... 阅读全文
摘要:
// To create a tabbed pane, see e828 创建JTabbedPane // Get the index of the currently selected tab int selIndex = pane.getSelectedIndex(); // Select the last tab selIndex = p... 阅读全文
摘要:
Setting a mnemonic on a tab allows the tab to be selected with a keystroke. For example, if the mnemonic for a tab were the key L, then typing ALT-L ( 阅读全文
摘要:
By default, all the tabs in a tabbed pane are displayed. When the tabs are wider than the width of the tabbed pane, they are displayed in rows. If spa 阅读全文
摘要:
To move a tab, it must first be removed and then reinserted into the tabbed pane as a new tab. Unfortunately, since there is no object that represents 阅读全文
摘要:
A tabbed pane fires a change event whenever the selected tab is changed either by the user or programmatically. 阅读全文
摘要:
This example retrieves all the tabs in a tabbed pane: Most of the methods that allow the properties of a tab to be changed require the index of the ta 阅读全文
摘要:
This example demonstrates various ways to add a tab to a tabbed pane. 阅读全文
摘要:
By default, all new tabs are enabled, which means the user can select them. A tab can be disabled to prevent the user from selecting it. 阅读全文
摘要:
The weight of a split pane controls the behavior of the divider when the split pane is resized. If the weight is 0, all extra space is given to the ri 阅读全文
摘要:
A tabbed pane is a container that displays only one child component at a time. Typically, the children are themselves containers of other components. 阅读全文
摘要:
A split pane divides its space between two components. The split pane contains a divider that allows the user to control the amount of space distribut 阅读全文
摘要:
// Create a left-right split pane JSplitPane hpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftComponent, rightComponent); // Create a top-bottom split pane JSplitPane vpane = ... 阅读全文
摘要:
The location of a divider is measured in pixels from either the left edge (in the case of a horizontal split pane) or the top edge (in the case of a v 阅读全文
摘要:
A divider can be no less than one pixel in size. 阅读全文
摘要:
// Create a nummber spinner JSpinner spinner = new JSpinner(); // Disable keyboard edits in the spinner JFormattedTextField tf = ((JSpinner.DefaultEditor)spinner.getEditor())... 阅读全文
摘要:
// Create a number spinner JSpinner spinner = new JSpinner(); // Get the text field JFormattedTextField tf = ((JSpinner.DefaultEditor)spinner.getEditor()).getTextField(); ... 阅读全文
摘要:
// Create a number spinner that only handles values in the range [0,100] int min = 0; int max = 100; int step = 5; int initValue = 50; SpinnerModel model = new SpinnerNumberModel(i... 阅读全文
摘要:
// Create a calendar object and initialize to a particular hour if desired Calendar calendar = new GregorianCalendar(); calendar.set(Calendar.HOUR_OF_DAY, 13); // 1pm // Create a da... 阅读全文
摘要:
// Create a nummber spinner JSpinner spinner = new JSpinner(); // Add the listener spinner.addChangeListener(new SpinnerListener()); // Changing the value programmatically a... 阅读全文
摘要:
This example demonstrates how to build three kinds of spinners. A number spinner: A list spinner: A date spinner: 阅读全文
摘要:
By default, if the user is browsing the values in a SpinnerListModel, the iteration stops when either end is reached. This example demonstrates a subc 阅读全文
摘要:
This example replaces the default editor (a JFormattedTextField) in a spinner component with a custom editor. The custom editor is simply a panel that 阅读全文
摘要:
It is also possible to set all the values at once by using the model: 阅读全文
摘要:
By default, the slider can take on any value from the minimum to the maximum. It is possible to configure the slider to allow only values at tick mark 阅读全文
摘要:
The slider supports two levels of tick marks, major and minor. Typically, the minor tick-mark spacing is smaller than the major tick-mark spacing. Als 阅读全文
摘要:
Besides being either horizontal or vertical, a slider can also be inverted. An inverted horizontal slider moves from right-to-left. An inverted vertic 阅读全文
摘要:
// Create horizontal slider JSlider slider = new JSlider(); // Register a change listener slider.addChangeListener(new ChangeListener() { // This method is called whenever the... 阅读全文
摘要:
This example demonstrates how to display labels (numerical values) at the major ticks (see e797 显示JSlider的标记). The slider allows you to use an arbitra 阅读全文
摘要:
In addition to allowing the user to drag the slider, some look and feels allow the user page the slider by a fixed amount. This amount is called the e 阅读全文
摘要:
By sharing an InputMap or ActionMap, any change to the shared InputMap or ActionMap will affect all components sharing the InputMap or ActionMap. WHEN 阅读全文
摘要:
A scroll bar in a scroll pane can be set to appear only as needed, always appear, or never appear. By default, both the vertical and horizontal scroll 阅读全文
摘要:
A scrollbar in a scroll pane fires adjustment events whenever its value changes. 阅读全文
摘要:
// To create a radio button and button group, // see e768 创建单选按钮 // Select the radio button; the currently selected radio button is deselected. // This operation does not cause any ac... 阅读全文
摘要:
See also e670 缓冲图像转换为图像. 阅读全文
摘要:
When you ask a button group for the currently selected radio button, it returns the selected radio button's model (rather than the selected radio butt 阅读全文
摘要:
// Create an action for each radio button Action action1 = new AbstractAction("RadioButton Label1") { // This method is called whenever the radio button is pressed, // even if it i... 阅读全文
摘要:
It is also possible to set all the values at once by using the model: 阅读全文
摘要:
The progress bar offers the ability to display the actual value of the bar as a percentage. This example demonstrates how to enable this display. Note 阅读全文
摘要:
A progress bar with an unknown maximum typically displays an animation until the task is complete. Note: The percentage display should not be enabled 阅读全文