摘要:
A progress bar with an unknown maximum typically displays an animation until the task is complete. Note: The percentage display should not be enabled 阅读全文
摘要:
By default, the progress monitor delays for a short period before it is displayed. There are two properties that control when the dialog is displayed 阅读全文
摘要:
A progress bar is used to visually indicate how much a task has been progressed. A progress bar can be oriented horizontally (left-to-right) or vertic 阅读全文
摘要:
The currently selected menu or menu item in a JMenu or JPopupMenu is tracked by MenuSelectionManager. To receive notification of changes to the curren 阅读全文
摘要:
A common feature of a user interface is to show a progress dialog that visually displays the progress of a long-running task. The dialog automatically 阅读全文
摘要:
The currently selected menu or menu item in a JMenu or JPopupMenu is tracked by MenuSelectionManager and can be retrieved by calling MenuSelectionMana 阅读全文
摘要:
By default, Swing popup menus used by JMenu and JPopupMenu are lightweight. If heavyweight components are used in the same frame, the popup menus may 阅读全文
摘要:
See e810 创建弹出菜单 for an example on how to display a popup menu. 阅读全文
摘要:
final JPopupMenu menu = new JPopupMenu(); // Create and add a menu item JMenuItem item = new JMenuItem("Item Label"); item.addActionListener(actionListener); menu.add(item); ... 阅读全文
摘要:
A menu item can receive notification of selection changes by overriding its menuSelectionChanged() method. See also e808 建立菜单栏,菜单,菜单项. 阅读全文
摘要:
A separator typically appears as a horizontal line. It is used to group related sets of menu items in a menu. 阅读全文
摘要:
By default, Swing uses a cross-platform look and feel called Metal. In most cases, it is more desirable to use a look and feel that is closer to the p 阅读全文
摘要:
When the user selects a menu item, it fires an action event. 阅读全文
摘要:
This example demonstrates how to retrieve all the default values for the current look and feel. 阅读全文
摘要:
UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels(); for (int i=0; i<info.length; i++) { // Get the name of the look and feel that is suitable for display to the user ... 阅读全文
摘要:
// Create a list, overriding the getToolTipText() method String[] items = {"A", "B", "C", "D"}; JList list = new JList(items) { // This method is called as the cursor moves within t... 阅读全文
摘要:
To change the look and feel, you need to know the class name of the new look and feel. This example installs the Windows look and feel. See also e866 阅读全文
摘要:
By default, the width of the list is determined by the longest item and the height is determined by the number of visible lines multiplied by the tall 阅读全文
摘要:
When the set of selected items is changed, either by the user or programmatically, a list selection event is fired. 阅读全文
摘要:
// The default mode is MULTIPLE_INTERVAL_SELECTION String[] items = {"A", "B", "C", "D"}; JList list = new JList(items); // Get the current selection model mode int mode = list.g... 阅读全文
摘要:
By default, the items in a list are arranged vertically, in a single column, as in: It is possible to arrange the items left-to-right and top-to-botto 阅读全文
摘要:
List selection events are fired when the following methods are used to change the set of selected items (see e774 创建JList组件). 阅读全文
摘要:
The following methods return the indices of the selected items: The following methods return the selected item objects: 阅读全文
摘要:
// Create a list String[] items = {"A", "B", "C", "D"}; JList list = new JList(items); // Add a listener for mouse clicks list.addMouseListener(new MouseAdapter() { publi... 阅读全文
摘要:
These methods are used to find an item: These methods can be used to find the range of visible items: 阅读全文
摘要:
The default model for a list does not allow the addition and removal of items. The list must be created with a DefaultListModel. This method replaces 阅读全文
摘要:
When the set of items in a list component is changed, a list data event is fired. 阅读全文
摘要:
This example demonstrates how to list all the key bindings in a component. Text components have an additional set of key bindings called a keymap. See 阅读全文
摘要:
By default, a list allows more than one item to be selected. Also, the selected items need not be contiguous. To change this default, see e781 设置JList 阅读全文
摘要:
This example demonstrates how to modify a label component so that its text can be dragged and dropped to another component. 阅读全文
摘要:
This example demonstrates how to list all the actions in a component. A text component not only has an action map with actions, it also has keymaps wi 阅读全文
摘要:
This example creates a JLabel component with an icon. This example adds or replaces the icon in an existing JLabel component: The methods to control t 阅读全文
摘要:
This example associates a label with a text field using setLabelFor(). A mnemonic is set on the label. When the mnemonic keystroke is pressed, the tex 阅读全文
摘要:
The KeyStroke.toString() method does not return a string that can be parsed by KeyStroke.getKeyStroke(). The method keyStroke2String() in this example 阅读全文
摘要:
This example creates a number of keystrokes and adds them to the input map of a component. When a keystroke is added to an input map, an action name m 阅读全文
摘要:
// The text is left-justified and vertically centered JLabel label = new JLabel("Text Label"); // The text is horizontally and vertically centered label = new JLabel("Text Label",... 阅读全文
摘要:
A frame is a component container that displays its contents in a top-level window with a title bar and buttons to resize, iconify, maximize, and close 阅读全文
摘要:
By default, when the close button on a frame is clicked, nothing happens. This example shows how to exit the application when the frame is closed: 阅读全文
摘要:
By default, when the close button on a frame is clicked, nothing happens. This example shows how to make the action hide the frame. One reason for hid 阅读全文
摘要:
This example demonstrates a text field that validates its contents when it receives a permanent focus-lost event. If the contents are invalid, it disp 阅读全文