上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 50 下一页
摘要: A progress bar with an unknown maximum typically displays an animation until the task is complete. Note: The percentage display should not be enabled 阅读全文
posted @ 2018-09-06 08:58 borter 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:57 borter 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:57 borter 阅读(140) 评论(0) 推荐(0) 编辑
摘要: The currently selected menu or menu item in a JMenu or JPopupMenu is tracked by MenuSelectionManager. To receive notification of changes to the curren 阅读全文
posted @ 2018-09-06 08:56 borter 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:56 borter 阅读(112) 评论(0) 推荐(0) 编辑
摘要: The currently selected menu or menu item in a JMenu or JPopupMenu is tracked by MenuSelectionManager and can be retrieved by calling MenuSelectionMana 阅读全文
posted @ 2018-09-06 08:55 borter 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:55 borter 阅读(160) 评论(0) 推荐(0) 编辑
摘要: See e810 创建弹出菜单 for an example on how to display a popup menu. 阅读全文
posted @ 2018-09-06 08:54 borter 阅读(93) 评论(0) 推荐(0) 编辑
摘要: final JPopupMenu menu = new JPopupMenu(); // Create and add a menu item JMenuItem item = new JMenuItem("Item Label"); item.addActionListener(actionListener); menu.add(item); ... 阅读全文
posted @ 2018-09-06 08:54 borter 阅读(127) 评论(0) 推荐(0) 编辑
摘要: A menu item can receive notification of selection changes by overriding its menuSelectionChanged() method. See also e808 建立菜单栏,菜单,菜单项. 阅读全文
posted @ 2018-09-06 08:53 borter 阅读(125) 评论(0) 推荐(0) 编辑
摘要: A separator typically appears as a horizontal line. It is used to group related sets of menu items in a menu. 阅读全文
posted @ 2018-09-06 08:53 borter 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:52 borter 阅读(143) 评论(0) 推荐(0) 编辑
摘要: When the user selects a menu item, it fires an action event. 阅读全文
posted @ 2018-09-06 08:52 borter 阅读(112) 评论(0) 推荐(0) 编辑
摘要: This example demonstrates how to retrieve all the default values for the current look and feel. 阅读全文
posted @ 2018-09-06 08:50 borter 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 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 ... 阅读全文
posted @ 2018-09-06 08:50 borter 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:49 borter 阅读(152) 评论(0) 推荐(0) 编辑
摘要: // 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... 阅读全文
posted @ 2018-09-06 08:49 borter 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:48 borter 阅读(230) 评论(0) 推荐(0) 编辑
摘要: When the set of selected items is changed, either by the user or programmatically, a list selection event is fired. 阅读全文
posted @ 2018-09-06 08:47 borter 阅读(380) 评论(0) 推荐(0) 编辑
摘要: // 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... 阅读全文
posted @ 2018-09-06 08:47 borter 阅读(749) 评论(0) 推荐(0) 编辑
摘要: List selection events are fired when the following methods are used to change the set of selected items (see e774 创建JList组件). 阅读全文
posted @ 2018-09-06 08:46 borter 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:46 borter 阅读(271) 评论(0) 推荐(0) 编辑
摘要: The following methods return the indices of the selected items: The following methods return the selected item objects: 阅读全文
posted @ 2018-09-06 08:45 borter 阅读(237) 评论(0) 推荐(0) 编辑
摘要: // 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... 阅读全文
posted @ 2018-09-06 08:44 borter 阅读(457) 评论(0) 推荐(0) 编辑
摘要: These methods are used to find an item: These methods can be used to find the range of visible items: 阅读全文
posted @ 2018-09-06 08:44 borter 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:43 borter 阅读(199) 评论(0) 推荐(0) 编辑
摘要: When the set of items in a list component is changed, a list data event is fired. 阅读全文
posted @ 2018-09-06 08:43 borter 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:42 borter 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:42 borter 阅读(122) 评论(0) 推荐(0) 编辑
摘要: This example demonstrates how to modify a label component so that its text can be dragged and dropped to another component. 阅读全文
posted @ 2018-09-06 08:41 borter 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:41 borter 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:40 borter 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:40 borter 阅读(101) 评论(0) 推荐(0) 编辑
摘要: The KeyStroke.toString() method does not return a string that can be parsed by KeyStroke.getKeyStroke(). The method keyStroke2String() in this example 阅读全文
posted @ 2018-09-06 08:39 borter 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:39 borter 阅读(112) 评论(0) 推荐(0) 编辑
摘要: // 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",... 阅读全文
posted @ 2018-09-06 08:39 borter 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:38 borter 阅读(389) 评论(0) 推荐(0) 编辑
摘要: 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: 阅读全文
posted @ 2018-09-06 08:37 borter 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:37 borter 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-06 08:36 borter 阅读(127) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 50 下一页