注解的使用
java.beans.BeanProperty
使用 BeanProperty 的包
包
描述
包含用于创建用户界面以及绘制图形和图像的所有类。
定义用户界面组件和提供对这些组件的访问的辅助技术之间的契约。
提供一组“轻量级”(全 Java 语言)组件,尽可能在所有平台上以相同的方式工作。
包含
JColorChooser 组件使用的类和接口。
提供用于处理
javax.swing.JTable 的类和接口。
提供处理可编辑和不可编辑文本组件的类和接口。
提供用于处理
javax.swing.JTree 的类和接口。
-
BeanProperty 在 java.awt 中的用法
具有类型为 BeanProperty 的注解的 java.awt 中的方法 -
BeanProperty 在 javax.accessibility 中的用法
具有类型为 BeanProperty 的注解的 javax.accessibility 中的方法修饰符和类型方法描述voidAccessibleContext.setAccessibleDescription(String s) 设置此对象的可访问描述。voidAccessibleContext.setAccessibleName(String s) 设置此对象的本地化可访问名称。 -
BeanProperty 在 javax.swing 中的用法
具有类型为 BeanProperty 的注解的 javax.swing 中的方法修饰符和类型方法描述voidJFileChooser.addChoosableFileFilter(FileFilter filter) 将过滤器添加到用户可选择的文件过滤器列表中。JFileChooser.getAcceptAllFileFilter()返回AcceptAll文件过滤器。Box.getAccessibleContext()获取与此 Box 关联的 AccessibleContext。ImageIcon.getAccessibleContext()获取与此 ImageIcon 关联的 AccessibleContext。JButton.getAccessibleContext()获取与此JButton关联的AccessibleContext。JCheckBox.getAccessibleContext()获取与此 JCheckBox 关联的 AccessibleContext。JCheckBoxMenuItem.getAccessibleContext()获取与此 JCheckBoxMenuItem 关联的 AccessibleContext。JColorChooser.getAccessibleContext()获取与此 JColorChooser 关联的 AccessibleContext。JComboBox.getAccessibleContext()获取与此 JComboBox 关联的 AccessibleContext。JDesktopPane.getAccessibleContext()获取与此JDesktopPane关联的AccessibleContext。JEditorPane.getAccessibleContext()获取与此 JEditorPane 关联的 AccessibleContext。JFileChooser.getAccessibleContext()获取与此 JFileChooser 关联的 AccessibleContext。JInternalFrame.getAccessibleContext()获取与此JInternalFrame关联的AccessibleContext。JLabel.getAccessibleContext()获取此对象的 AccessibleContextJLayeredPane.getAccessibleContext()获取与此 JLayeredPane 关联的 AccessibleContext。JList.getAccessibleContext()获取与此JList关联的AccessibleContext。JMenu.getAccessibleContext()获取与此 JMenu 关联的 AccessibleContext。JMenuBar.getAccessibleContext()获取与此 JMenuBar 关联的 AccessibleContext。JMenuItem.getAccessibleContext()返回与此JMenuItem关联的AccessibleContext。JOptionPane.getAccessibleContext()返回与此 JOptionPane 关联的AccessibleContext。JPanel.getAccessibleContext()获取与此 JPanel 关联的 AccessibleContext。JPasswordField.getAccessibleContext()返回与此JPasswordField关联的AccessibleContext。JPopupMenu.getAccessibleContext()获取与此 JPopupMenu 关联的 AccessibleContext。JProgressBar.getAccessibleContext()获取与此JProgressBar关联的AccessibleContext。JRadioButton.getAccessibleContext()获取与此 JRadioButton 关联的 AccessibleContext。JRadioButtonMenuItem.getAccessibleContext()获取与此 JRadioButtonMenuItem 关联的 AccessibleContext。JScrollBar.getAccessibleContext()获取与此 JScrollBar 关联的 AccessibleContext。JScrollPane.getAccessibleContext()获取与此 JScrollPane 关联的 AccessibleContext。JSeparator.getAccessibleContext()获取与此 JSeparator 关联的 AccessibleContext。JSlider.getAccessibleContext()获取与此 JSlider 关联的 AccessibleContext。JSpinner.getAccessibleContext()为JSpinner获取AccessibleContextJSplitPane.getAccessibleContext()获取与此 JSplitPane 关联的 AccessibleContext。JTabbedPane.getAccessibleContext()获取与此 JTabbedPane 关联的 AccessibleContext。JTable.getAccessibleContext()获取与此 JTable 关联的 AccessibleContext。JTextArea.getAccessibleContext()获取与此 JTextArea 关联的 AccessibleContext。JTextField.getAccessibleContext()获取与此JTextField关联的AccessibleContext。JToggleButton.getAccessibleContext()获取与此 JToggleButton 关联的 AccessibleContext。JToolBar.getAccessibleContext()获取与此 JToolBar 关联的 AccessibleContext。JTree.getAccessibleContext()获取与此 JTree 关联的 AccessibleContext。AbstractButton.getActionListeners()返回使用 addActionListener() 添加到此 AbstractButton 的所有ActionListener的数组。JComboBox.getActionListeners()返回使用 addActionListener() 添加到此 JComboBox 的所有ActionListener的数组。JFileChooser.getActionListeners()返回在此文件选择器上注册的所有动作监听的数组。JTextField.getActionListeners()返回使用 addActionListener() 添加到此 JTextField 的所有ActionListener的数组。Action[]JFormattedTextField.getActions()获取编辑器的命令列表。Action[]JTextField.getActions()获取编辑器的命令列表。JScrollBar.getAdjustmentListeners()返回使用 addAdjustmentListener() 添加到此 JScrollBar 的所有AdjustmentListener的数组。JDesktopPane.getAllFrames()返回当前显示在桌面上的所有JInternalFrames。JComponent.getAncestorListeners()返回在此组件上注册的所有祖先监听的数组。intJList.getAnchorSelectionIndex()返回锚点选择索引。JComponent.getBaselineResizeBehavior()返回一个枚举,指示组件的基线如何随着大小的变化而变化。AbstractButton.getChangeListeners()返回使用 addChangeListener() 添加到此 AbstractButton 的所有ChangeListener的数组。JProgressBar.getChangeListeners()返回使用addChangeListener添加到此进度条的所有ChangeListener的数组。JSlider.getChangeListeners()返回使用 addChangeListener() 添加到此 JSlider 的所有ChangeListener的数组。JSpinner.getChangeListeners()返回使用 addChangeListener() 添加到此 JSpinner 的所有ChangeListener的数组。JTabbedPane.getChangeListeners()返回添加到此JTabbedPane和addChangeListener的所有ChangeListener的数组。JTextPane.getCharacterAttributes()获取在插入符号或null的当前位置有效的字符属性。JFileChooser.getChoosableFileFilters()获取用户可选择的文件过滤器列表。intJTable.getColumnCount()返回列模型中的列数。JInternalFrame.getDesktopPane()在祖先层次结构中搜索JDesktop实例的便捷方法。final JList.DropLocationJList.getDropLocation()返回此组件在组件上的 DnD 操作期间应直观指示为放置位置的位置,如果当前没有要显示的位置,则返回null。final JTable.DropLocationJTable.getDropLocation()返回此组件在组件上的 DnD 操作期间应直观指示为放置位置的位置,如果当前没有要显示的位置,则返回null。final JTree.DropLocationJTree.getDropLocation()返回此组件在组件上的 DnD 操作期间应直观指示为放置位置的位置,如果当前没有要显示的位置,则返回null。JTree.getEditingPath()返回当前正在编辑的元素的路径。JTable.getEditorComponent()返回正在处理编辑会话的组件。intJList.getFirstVisibleIndex()返回当前可见的最小列表索引。final ContainerJInternalFrame.getFocusCycleRootAncestor()始终返回null因为JInternalFrames 必须始终是焦点遍历循环的根。JFormattedTextField.getFormatter()返回用于格式化和解析当前值的AbstractFormatter。JApplet.getGraphics()已弃用,将被删除:此 API 元素可能会在未来版本中删除。为此组件创建图形上下文。JComponent.getGraphics()返回此组件的图形上下文,它允许您在组件上绘制。JDialog.getGraphics()为此组件创建图形上下文。JFrame.getGraphics()为此组件创建图形上下文。JWindow.getGraphics()为此组件创建图形上下文。intJComponent.getHeight()返回此组件的当前高度。JTextField.getHorizontalVisibility()获取文本字段的可见性。JEditorPane.getHyperlinkListeners()返回使用 addHyperlinkListener() 添加到此 JEditorPane 的所有HyperLinkListener的数组。JTextPane.getInputAttributes()获取窗格的输入属性。JComponent.getInsets()如果已在此组件上设置了边框,则返回边框的 insets;否则调用super.getInsets。final Insets返回包含此JViewport的插入值的Insets对象。JInternalFrame.getInternalFrameListeners()返回添加到此JInternalFrame和addInternalFrameListener的所有InternalFrameListener的数组。intJComboBox.getItemCount()返回列表中的项目数。intJMenu.getItemCount()返回菜单上的项目数,包括分隔符。AbstractButton.getItemListeners()返回使用 addItemListener() 添加到此 AbstractButton 的所有ItemListener的数组。JComboBox.getItemListeners()返回使用 addItemListener() 添加到此 JComboBox 的所有ItemListener的数组。JInternalFrame.getLastCursor()返回由setCursor方法设置的最后一个Cursor不是可调整大小的Cursor。JTree.getLastSelectedPathComponent()返回所选路径的最后一个路径组件。intJList.getLastVisibleIndex()返回当前可见的最大列表索引。intJList.getLeadSelectionIndex()返回潜在客户选择索引。intJTree.getLeadSelectionRow()返回对应于前导路径的行索引。JSplitPane.getLeftComponent()返回分隔符左侧(或上方)的组件。intJTextArea.getLineCount()确定区域中包含的行数。JList.getListSelectionListeners()返回通过addListSelectionListener添加到此JList的所有ListSelectionListener的数组。JPopupMenu.getMargin()返回弹出菜单的边框与其容器之间的边距(以像素为单位)。intJOptionPane.getMaxCharactersPerLineCount()返回放置在消息中一行的最大字符数。intJSplitPane.getMaximumDividerLocation()从外观实现中返回分隔线的最大位置。intJList.getMaxSelectionIndex()返回最大的选定单元格索引,如果选择为空,则返回-1。intJTree.getMaxSelectionRow()返回最大的选定行。intJMenu.getMenuComponentCount()返回菜单上的组件数。JMenu.getMenuComponents()返回菜单子组件的Component数组。intJMenuBar.getMenuCount()返回菜单栏中的项目数。JMenuItem.getMenuDragMouseListeners()返回使用 addMenuDragMouseListener() 添加到此 JMenuItem 的所有MenuDragMouseListener的数组。JMenuItem.getMenuKeyListeners()返回使用 addMenuKeyListener() 添加到此 JMenuItem 的所有MenuKeyListener的数组。JPopupMenu.getMenuKeyListeners()返回使用 addMenuKeyListener() 添加到此 JPopupMenu 的所有MenuKeyListener的数组。JMenu.getMenuListeners()返回使用 addMenuListener() 添加到此 JMenu 的所有MenuListener的数组。intJSplitPane.getMinimumDividerLocation()从外观实现中返回分隔线的最小位置。intJList.getMinSelectionIndex()返回最小的选定单元格索引,如果选择为空,则返回-1。intJTree.getMinSelectionRow()返回最小的选定行。JInternalFrame.getMostRecentFocusOwner()返回此JInternalFrame的子组件,当选择此JInternalFrame时,它将接收焦点。JSpinner.getNextValue()返回getValue()返回的对象之后的序列中的对象。JTextPane.getParagraphAttributes()获取在插入符号位置有效的当前段落属性,如果没有则为null。char[]JPasswordField.getPassword()返回此TextComponent中包含的文本。JTree.getPathForRow(int row) 返回指定行的路径。doubleJProgressBar.getPercentComplete()返回进度条的完成百分比。JMenu.getPopupMenu()返回与此菜单关联的弹出菜单。JComboBox.getPopupMenuListeners()返回使用 addPopupMenuListener() 添加到此 JComboBox 的所有PopupMenuListener的数组。JPopupMenu.getPopupMenuListeners()返回使用 addPopupMenuListener() 添加到此 JMenuItem 的所有PopupMenuListener的数组。计算显示visibleRowCount行所需的视口大小。JTextArea.getPreferredScrollableViewportSize()如果此组件嵌入在 JScrollPane 中,则返回视口的首选大小。返回JTree的首选显示大小。JSpinner.getPreviousValue()返回序列中getValue()返回的对象之前的对象。JComponent.getRegisteredKeyStrokes()返回将启动注册操作的KeyStrokes。JApplet.getRootPane()已弃用,将被删除:此 API 元素可能会在未来版本中删除。返回此小程序的 rootPane 对象。JComponent.getRootPane()返回此组件的JRootPane祖先。JDialog.getRootPane()返回此对话框的rootPane对象。JFrame.getRootPane()返回此帧的rootPane对象。JInternalFrame.getRootPane()返回此内部框架的rootPane对象。JWindow.getRootPane()返回此窗口的rootPane对象。intJTable.getRowCount()在给定无限空间的情况下,返回可以在JTable中显示的行数。intJTree.getRowCount()返回可视节点数。booleanJEditorPane.getScrollableTracksViewportHeight()如果视口应始终强制此Scrollable的高度与视口的高度匹配,则返回 true。boolean如果此JList显示在JViewport中并且视口高于列表的首选高度,或者布局方向为VERTICAL_WRAP和visibleRowCount <= 0,则返回true;否则返回false。booleanJTable.getScrollableTracksViewportHeight()返回false表示视口的高度不决定表格的高度,除非getFillsViewportHeight是true并且表格的首选高度小于视口的高度。boolean返回 false 表示视口的高度不决定表格的高度,除非树的首选高度小于视口高度。booleanJEditorPane.getScrollableTracksViewportWidth()如果视口应始终强制此Scrollable的宽度与视口的宽度匹配,则返回 true。booleanJList.getScrollableTracksViewportWidth()如果此JList显示在JViewport中并且视口比列表的首选宽度宽,或者布局方向为HORIZONTAL_WRAP和visibleRowCount <= 0,则返回true;否则返回false。booleanJTable.getScrollableTracksViewportWidth()如果autoResizeMode设置为AUTO_RESIZE_OFF则返回 false,这表示视口的宽度不决定表格的宽度。booleanJTextArea.getScrollableTracksViewportWidth()如果视口应始终强制此 Scrollable 的宽度与视口的宽度相匹配,则返回 true。booleanJTree.getScrollableTracksViewportWidth()返回 false 表示视口的宽度不决定表格的宽度,除非树的首选宽度小于视口宽度。intJTable.getSelectedColumn()返回第一个选定列的索引,如果未选择任何列,则返回 -1。intJTable.getSelectedColumnCount()返回所选列的数量。int[]JTable.getSelectedColumns()返回所有选定列的索引。Object[]AbstractButton.getSelectedObjects()如果未选择按钮,则返回包含标签或null的数组(长度为 1)。Object[]JCheckBoxMenuItem.getSelectedObjects()返回包含复选框菜单项标签的数组(长度为 1),如果未选中复选框,则返回 null。Object[]JComboBox.getSelectedObjects()返回包含所选项目的数组。intJTable.getSelectedRow()返回第一个选定行的索引,如果未选择任何行,则返回 -1。intJTable.getSelectedRowCount()返回所选行的数量。int[]JTable.getSelectedRows()返回所有选定行的索引。JList.getSelectedValue()返回最小选定单元格索引的值;选定的值当列表中只有一个项目被选中时。Object[]JList.getSelectedValues()已弃用。JList.getSelectedValuesList()返回所有选定项目的列表,根据列表中的索引按升序排列。intJTree.getSelectionCount()返回选择的节点数。JMenu.getSubElements()返回包含此菜单组件的子菜单的MenuElement数组。JMenuBar.getSubElements()实现为MenuElement——返回此菜单栏中的菜单。JMenuItem.getSubElements()此方法返回一个数组,其中包含此菜单组件的子菜单组件。JPopupMenu.getSubElements()返回包含此菜单组件的子菜单的MenuElement数组。intJTabbedPane.getTabCount()返回此tabbedpane中的选项卡数。intJTabbedPane.getTabRunCount()返回当前用于显示选项卡的选项卡运行数。JComponent.getTopLevelAncestor()返回此组件的顶级祖先(包含Window或Applet),如果此组件尚未添加到任何容器,则返回null。JTree.getTreeExpansionListeners()返回使用 addTreeExpansionListener() 添加到此 JTree 的所有TreeExpansionListener的数组。JTree.getTreeSelectionListeners()返回使用 addTreeSelectionListener() 添加到此 JTree 的所有TreeSelectionListener的数组。JTree.getTreeWillExpandListeners()返回使用 addTreeWillExpandListener() 添加到此 JTree 的所有TreeWillExpandListener的数组。JFileChooser.getUI()获取实现此组件的 L&F 的 UI 对象。JScrollPane.getUI()返回呈现此组件的外观 (L&F) 对象。JSplitPane.getUI()返回提供当前外观的SplitPaneUI。JButton.getUIClassID()返回一个字符串,该字符串指定呈现此组件的 L&F 类的名称。JCheckBox.getUIClassID()返回一个字符串,该字符串指定呈现此组件的 L&F 类的名称。JCheckBoxMenuItem.getUIClassID()返回呈现此组件的 L&F 类的名称。JColorChooser.getUIClassID()返回呈现此组件的 L&F 类的名称。JComboBox.getUIClassID()返回呈现此组件的 L&F 类的名称。JComponent.getUIClassID()返回用于查找定义此组件外观的swing.plaf.ComponentUI类名称的UIDefaults键。JDesktopPane.getUIClassID()返回呈现此组件的 L&F 类的名称。JEditorPane.getUIClassID()获取 UI 的类 ID。JFileChooser.getUIClassID()返回一个字符串,该字符串指定呈现此组件的 L&F 类的名称。JFormattedTextField.getUIClassID()获取 UI 的类 ID。JInternalFrame.getUIClassID()返回呈现此组件的外观类的名称。JLabel.getUIClassID()返回一个字符串,该字符串指定呈现此组件的 l&f 类的名称。JList.getUIClassID()返回"ListUI",UIDefaults键用于查找定义此组件外观的javax.swing.plaf.ListUI类的名称。JMenu.getUIClassID()返回呈现此组件的 L&F 类的名称。JMenuBar.getUIClassID()返回呈现此组件的 L&F 类的名称。JMenuItem.getUIClassID()返回用于构造用于呈现此组件的 L&F 类名称的后缀。JOptionPane.getUIClassID()返回实现此组件的 L&F 的 UI 类的名称。JPanel.getUIClassID()返回一个字符串,该字符串指定呈现此组件的 L&F 类的名称。JPasswordField.getUIClassID()返回呈现此组件的 L&F 类的名称。JPopupMenu.getUIClassID()返回呈现此组件的 L&F 类的名称。JProgressBar.getUIClassID()返回呈现此组件的外观类的名称。JRadioButton.getUIClassID()返回呈现此组件的 L&F 类的名称。JRadioButtonMenuItem.getUIClassID()返回呈现此组件的 L&F 类的名称。JScrollBar.getUIClassID()返回此组件的 LookAndFeel 类的名称。JScrollPane.getUIClassID()返回用于构造用于呈现此组件的 L&F 类名称的后缀。JSeparator.getUIClassID()返回呈现此组件的 L&F 类的名称。JSlider.getUIClassID()返回呈现此组件的 L&F 类的名称。JSpinner.getUIClassID()返回用于构造用于呈现此组件的外观 (L&F) 类名称的后缀。JSplitPane.getUIClassID()返回呈现此组件的 L&F 类的名称。JTabbedPane.getUIClassID()返回实现此组件的 L&F 的 UI 类的名称。JTable.getUIClassID()返回用于构造用于呈现此组件的 L&F 类名称的后缀。JTextArea.getUIClassID()返回 UI 的类 ID。JTextField.getUIClassID()获取 UI 的类 ID。JTextPane.getUIClassID()返回 UI 的类 ID。JToggleButton.getUIClassID()返回一个字符串,该字符串指定呈现此组件的 l&f 类的名称。JToolBar.getUIClassID()返回呈现此组件的 L&F 类的名称。JTree.getUIClassID()返回呈现此组件的 L&F 类的名称。JComponent.getVetoableChangeListeners()返回在此组件上注册的所有可否决更改监听的数组。JScrollPane.getViewportBorderBounds()返回视口边界的边界。JComponent.getVisibleRect()返回Component的“可见矩形”——此组件的可见矩形new Rectangle(0, 0, getWidth(), getHeight())及其所有祖先可见矩形的交集。final StringJInternalFrame.getWarningString()获取与此内部框架一起显示的警告字符串。intJComponent.getWidth()返回此组件的当前宽度。intJComponent.getX()返回组件原点的当前 x 坐标。intJComponent.getY()返回组件原点的当前 y 坐标。booleanJButton.isDefaultButton()获取defaultButton属性的值,如果true表示此按钮是其JRootPane的当前默认按钮。booleanJFileChooser.isDirectorySelectionEnabled()根据当前文件选择模式确定目录是否可选择的便捷调用。booleanJTable.isEditing()如果正在编辑单元格,则返回 true。booleanJTree.isEditing()如果正在编辑树,则返回 true。booleanJFormattedTextField.isEditValid()如果正在编辑的当前值有效,则返回 true。booleanJFileChooser.isFileSelectionEnabled()根据当前文件选择模式确定文件是否可选择的便捷调用。booleanJTree.isFixedRowHeight()如果每个显示行的高度是固定大小,则返回 true。booleanJProgressBar.isIndeterminate()返回indeterminate属性的值。booleanJComponent.isManagingFocus()已弃用。从 1.4 开始,由Component.setFocusTraversalKeys(int, Set)和Container.setFocusCycleRoot(boolean)取代。booleanJComponent.isOptimizedDrawingEnabled()如果此组件平铺其子项,则返回 true —— 也就是说,如果它可以保证子项不会重叠。booleanJLayeredPane.isOptimizedDrawingEnabled()如果窗格中的组件可以重叠,则返回 false,这使得优化绘图变得不可能。final booleanJComponent.isPaintingForPrint()如果此组件上的当前绘制操作是print操作的一部分,则返回true。booleanJComponent.isPaintingTile()如果组件当前正在绘制图块,则返回 true。booleanJMenuBar.isSelected()如果菜单栏当前选择了一个组件,则返回 true。booleanJList.isSelectionEmpty()如果未选择任何内容,则返回true,否则返回false。booleanJTree.isSelectionEmpty()如果选择当前为空,则返回 true。booleanJMenu.isTearOff()如果菜单可以撕掉,则返回真。booleanJMenu.isTopLevelMenu()如果菜单是“顶级菜单”,即如果它是菜单栏的直接子项,则返回 true。booleanJScrollPane.isValidateRoot()重写以返回 true,以便在此JScrollPane的任何后代上对revalidate的任何调用都将导致验证以此JScrollPane开头的整个树。booleanJSplitPane.isValidateRoot()返回 true,因此在此JSplitPane的任何后代上调用revalidate将导致请求排队,该请求将验证JSplitPane及其所有后代。booleanJScrollPane.isWheelScrollingEnabled()指示是否响应鼠标滚轮进行滚动。voidJMenuItem.setAccelerator(KeyStroke keyStroke) 设置在不导航菜单层次结构的情况下调用菜单项的动作监听的组合键。voidJFileChooser.setAcceptAllFileFilterUsed(boolean b) 确定AcceptAll FileFilter是否用作可选过滤器列表中的可用选项。voidJFileChooser.setAccessory(JComponent newAccessory) 设置附件组件。void设置Action。void为ActionEvent源设置Action。void为ActionEvent源设置Action。voidJComponent.setAlignmentX(float alignmentX) 设置水平对齐方式。voidJComponent.setAlignmentY(float alignmentY) 设置垂直对齐方式。voidJTree.setAnchorSelectionPath(TreePath newPath) 设置标识为锚点的路径。voidJFileChooser.setApproveButtonMnemonic(int mnemonic) 使用数字键码设置批准按钮的助记符。voidJFileChooser.setApproveButtonText(String approveButtonText) 在FileChooserUI中设置ApproveButton中使用的文本。voidJFileChooser.setApproveButtonToolTipText(String toolTipText) 设置ApproveButton中使用的工具提示文本。voidJMenuItem.setArmed(boolean b) 将菜单项标识为“武装”。voidJTable.setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel) 设置此表的autoCreateColumnsFromModel标志。voidJTable.setAutoCreateRowSorter(boolean autoCreateRowSorter) 指定是否应在其模型更改时为表创建RowSorter。voidJTable.setAutoResizeMode(int mode) 调整表格大小时设置表格的自动调整大小模式。voidJComponent.setAutoscrolls(boolean autoscrolls) 设置autoscrolls属性。voidJComponent.setBackground(Color bg) 设置此组件的背景颜色。voidJTabbedPane.setBackgroundAt(int index, Color background) 将index的背景颜色设置为background可以是null,在这种情况下,选项卡的背景颜色将默认为tabbedpane的背景颜色。voidJScrollBar.setBlockIncrement(int blockIncrement) 设置 blockIncrement 属性。void设置此组件的边框。voidAbstractButton.setBorderPainted(boolean b) 设置borderPainted属性。voidJMenuBar.setBorderPainted(boolean b) 设置是否应绘制边框。voidJPopupMenu.setBorderPainted(boolean b) 设置是否应绘制边框。voidJProgressBar.setBorderPainted(boolean b) 设置borderPainted属性,如果进度条应绘制其边框,则该属性为true。voidJToolBar.setBorderPainted(boolean b) 设置borderPainted属性,如果应绘制边框,则为true。voidJCheckBox.setBorderPaintedFlat(boolean b) 设置borderPaintedFlat属性,该属性提示复选框边框外观的外观。voidJSplitPane.setBottomComponent(Component comp) 将组件设置在分隔线下方或右侧。voidJTable.setCellEditor(TableCellEditor anEditor) 设置活动单元格编辑器。voidJTree.setCellEditor(TreeCellEditor cellEditor) 设置单元格编辑器。voidJList.setCellRenderer(ListCellRenderer<? super E> cellRenderer) 设置用于绘制列表中每个单元格的委托。voidJTree.setCellRenderer(TreeCellRenderer x) 设置将用于绘制每个单元格的TreeCellRenderer。voidJTable.setCellSelectionEnabled(boolean cellSelectionEnabled) 设置此表是否允许列选择和行选择同时存在。voidJColorChooser.setChooserPanels(AbstractColorChooserPanel[] panels) 指定用于选择颜色值的颜色面板。voidJInternalFrame.setClosable(boolean b) 设置此JInternalFrame是否可以通过某些用户操作关闭。voidJInternalFrame.setClosed(boolean b) 如果参数为true则关闭此内部框架。void将颜色选择器的当前颜色设置为指定颜色。voidJScrollPane.setColumnHeader(JViewport columnHeader) 删除旧的 columnHeader(如果存在);如果新的 columnHeader 不是null,则将其 viewPosition 的 x 坐标与视口(如果有的话)同步,然后将其添加到滚动窗格。voidJTable.setColumnModel(TableColumnModel columnModel) 将此表的列模型设置为columnModel并注册来自新列模型的监听器通知。voidJTextArea.setColumns(int columns) 设置此 TextArea 的列数。voidJTextField.setColumns(int columns) 在此TextField中设置列数,然后使布局无效。voidJTable.setColumnSelectionAllowed(boolean columnSelectionAllowed) 设置是否可以选择此模型中的列。voidJToolTip.setComponent(JComponent c) 指定工具提示描述的组件。voidJTabbedPane.setComponentAt(int index, Component component) 将位于index的组件设置为component。voidJComponent.setComponentPopupMenu(JPopupMenu popup) 为此JComponent设置JPopupMenu。voidAbstractButton.setContentAreaFilled(boolean b) 设置contentAreaFilled属性。voidJApplet.setContentPane(Container contentPane) 已弃用,将被删除:此 API 元素可能会在未来版本中删除。设置 contentPane 属性。voidJDialog.setContentPane(Container contentPane) 设置contentPane属性。voidJFrame.setContentPane(Container contentPane) 设置contentPane属性。voidJInternalFrame.setContentPane(Container c) 设置此JInternalFrame的contentPane属性。voidJWindow.setContentPane(Container contentPane) 为此窗口设置contentPane属性。final voidJEditorPane.setContentType(String type) 设置此编辑器处理的内容类型。voidJSplitPane.setContinuousLayout(boolean newContinuousLayout) 设置continuousLayout属性的值,该属性必须为true,以便在用户干预期间不断重新显示和布局子组件。voidJFileChooser.setControlButtonsAreShown(boolean b) 设置指示是否批准和cancel按钮显示在文件选择器中。voidJFileChooser.setCurrentDirectory(File dir) 设置当前目录。voidJComponent.setDebugGraphicsOptions(int debugOptions) 启用或禁用有关在组件或其子项中执行的每个图形操作的诊断信息。voidJRootPane.setDefaultButton(JButton defaultButton) 设置defaultButton属性,该属性确定此JRootPane的当前默认按钮。voidJButton.setDefaultCapable(boolean defaultCapable) 设置defaultCapable属性,该属性确定是否可以将此按钮设为其根窗格的默认按钮。voidJDialog.setDefaultCloseOperation(int operation) 设置当用户在此对话框上启动“关闭”时默认发生的操作。voidJFrame.setDefaultCloseOperation(int operation) 设置当用户在此框架上启动“关闭”时默认发生的操作。voidJMenu.setDelay(int d) 在菜单的PopupMenu向上或向下弹出之前设置建议的延迟。voidJInternalFrame.setDesktopIcon(JInternalFrame.JDesktopIcon d) 设置与此JInternalFrame关联的JDesktopIcon。voidJDesktopPane.setDesktopManager(DesktopManager d) 设置将处理特定于桌面的 UI 操作的DesktopManger。voidJFileChooser.setDialogTitle(String dialogTitle) 设置JFileChooser窗口标题栏中的字符串。voidJFileChooser.setDialogType(int dialogType) 设置此对话框的类型。voidAbstractButton.setDisabledIcon(Icon disabledIcon) 设置按钮的禁用图标。voidJLabel.setDisabledIcon(Icon disabledIcon) 如果此 JLabel 被“禁用”(JLabel.setEnabled(false)),则设置要显示的图标。voidJTabbedPane.setDisabledIconAt(int index, Icon disabledIcon) 将index处的禁用图标设置为icon,可以是null。voidAbstractButton.setDisabledSelectedIcon(Icon disabledSelectedIcon) 为按钮设置禁用的选择图标。voidJLabel.setDisplayedMnemonic(int key) 指定表示助记键的键码。voidAbstractButton.setDisplayedMnemonicIndex(int index) 提供有关应修饰文本中的哪个字符以表示助记符的外观提示。voidJLabel.setDisplayedMnemonicIndex(int index) 提供有关应修饰文本中的哪个字符以表示助记符的外观提示。voidJTabbedPane.setDisplayedMnemonicIndexAt(int tabIndex, int mnemonicIndex) 提供有关应修饰文本中的哪个字符以表示助记符的外观提示。voidJSplitPane.setDividerLocation(double proportionalLocation) 将分隔符位置设置为JSplitPane大小的百分比。voidJSplitPane.setDividerLocation(int location) 设置分隔线的位置。voidJSplitPane.setDividerSize(int newSize) 设置分隔线的大小。voidJFormattedTextField.setDocument(Document doc) 将编辑器与文本文档相关联。voidJTextField.setDocument(Document doc) 将编辑器与文本文档相关联。voidJColorChooser.setDragEnabled(boolean b) 设置dragEnabled属性,该属性必须为true才能在此组件上启用自动拖动处理(拖放的第一部分)。voidJFileChooser.setDragEnabled(boolean b) 设置dragEnabled属性,该属性必须为true才能在此组件上启用自动拖动处理(拖放的第一部分)。voidJList.setDragEnabled(boolean b) 打开或关闭自动拖动处理。voidJTable.setDragEnabled(boolean b) 打开或关闭自动拖动处理。voidJTree.setDragEnabled(boolean b) 打开或关闭自动拖动处理。voidJDesktopPane.setDragMode(int dragMode) 设置桌面窗格使用的“拖动样式”。voidJPasswordField.setEchoChar(char c) 为此JPasswordField设置回显字符。voidJComboBox.setEditable(boolean aFlag) 确定JComboBox字段是否可编辑。voidJTree.setEditable(boolean flag) 确定树是否可编辑。voidJComboBox.setEditor(ComboBoxEditor anEditor) 设置用于绘制和编辑JComboBox字段中所选项目的编辑器。voidJSpinner.setEditor(JComponent editor) 更改显示SpinnerModel当前值的JComponent。voidJEditorPane.setEditorKit(EditorKit kit) 设置当前安装的用于处理内容的工具包。voidJComboBox.setEnabled(boolean b) 启用组合框以便可以选择项目。voidJComponent.setEnabled(boolean enabled) 设置是否启用此组件。voidJMenuItem.setEnabled(boolean b) 启用或禁用菜单项。voidJTree.setExpandsSelectedPaths(boolean newValue) 配置expandsSelectedPaths属性。voidJSlider.setExtent(int extent) 设置旋钮“重写”的范围大小。voidJFileChooser.setFileFilter(FileFilter filter) 设置当前文件过滤器。voidJFileChooser.setFileHidingEnabled(boolean b) 设置文件隐藏打开或关闭。voidJFileChooser.setFileSelectionMode(int mode) 设置JFileChooser以允许用户仅选择文件、仅选择目录或同时选择文件和目录。voidJFileChooser.setFileSystemView(FileSystemView fsv) 设置JFileChooser用于访问和创建文件系统资源的文件系统视图,例如查找软盘驱动器和获取根驱动器列表。voidJFileChooser.setFileView(FileView fileView) 设置用于检索 UI 信息的文件视图,例如代表文件的图标或文件的类型描述。voidJTable.setFillsViewportHeight(boolean fillsViewportHeight) 设置此表是否始终足够大以填充封闭视口的高度。voidJList.setFixedCellHeight(int height) 设置用于列表中每个单元格高度的固定值。voidJList.setFixedCellWidth(int width) 设置用于列表中每个单元格宽度的固定值。voidJToolBar.setFloatable(boolean b) 设置floatable属性,该属性必须为true以便用户移动工具栏。voidJFormattedTextField.setFocusLostBehavior(int behavior) 设置失去焦点时的行为。voidAbstractButton.setFocusPainted(boolean b) 设置paintFocus属性,对于要绘制的焦点状态,该属性必须为true。void设置此组件的字体。voidJComponent.setForeground(Color fg) 设置此组件的前景色。voidJTabbedPane.setForegroundAt(int index, Color foreground) 将index的前景色设置为foreground,可以是null,在这种情况下,选项卡的前景色将默认为此tabbedpane的前景色。voidJFormattedTextField.setFormatterFactory(JFormattedTextField.AbstractFormatterFactory tf) 设置AbstractFormatterFactory。voidJInternalFrame.setFrameIcon(Icon icon) 设置要在此内部框架的标题栏中显示的图像(通常在左上角)。voidJApplet.setGlassPane(Component glassPane) 已弃用,将被删除:此 API 元素可能会在未来版本中删除。设置 glassPane 属性。voidJDialog.setGlassPane(Component glassPane) 设置glassPane属性。voidJFrame.setGlassPane(Component glassPane) 设置glassPane属性。voidJInternalFrame.setGlassPane(Component glass) 设置此JInternalFrame的glassPane属性。voidJWindow.setGlassPane(Component glassPane) 设置glassPane属性。voidJTable.setGridColor(Color gridColor) 将用于绘制网格线的颜色设置为gridColor并重新显示。voidAbstractButton.setHideActionText(boolean hideActionText) 设置hideActionText属性,该属性确定按钮是否显示来自Action的文本。voidAbstractButton.setHorizontalAlignment(int alignment) 设置图标和文本的水平对齐方式。voidJLabel.setHorizontalAlignment(int alignment) 设置标签内容沿 X 轴的对齐方式。voidJTextField.setHorizontalAlignment(int alignment) 设置文本的水平对齐方式。voidJScrollPane.setHorizontalScrollBar(JScrollBar horizontalScrollBar) 将控制视口水平视图位置的滚动条添加到滚动窗格。voidJScrollPane.setHorizontalScrollBarPolicy(int policy) 确定水平滚动条何时出现在滚动窗格中。voidAbstractButton.setHorizontalTextPosition(int textPosition) 设置文本相对于图标的水平位置。voidJLabel.setHorizontalTextPosition(int textPosition) 设置标签文本相对于其图像的水平位置。void设置按钮的默认图标。voidJInternalFrame.setIcon(boolean b) 如果外观支持图标化,则图标化或取消图标化此内部框架。void定义此组件将显示的图标。void设置要显示的图标。void将index处的图标设置为icon,可以是null。voidJInternalFrame.setIconifiable(boolean b) 设置iconable属性,该属性必须为true,用户才能使JInternalFrame成为图标。voidAbstractButton.setIconTextGap(int iconTextGap) 如果同时设置了 icon 和 text 属性,则此属性定义它们之间的空间。voidJLabel.setIconTextGap(int iconTextGap) 如果同时设置了 icon 和 text 属性,则此属性定义它们之间的空间。voidJComponent.setInheritsPopupMenu(boolean value) 如果此组件没有分配给它的JPopupMenu,则设置getComponentPopupMenu是否应委托给父级。voidJOptionPane.setInitialSelectionValue(Object newValue) 设置最初显示为已选择给用户的输入值。voidJOptionPane.setInitialValue(Object newInitialValue) 设置要启用的初始值——最初显示窗格时具有焦点的Component。voidJOptionPane.setInputValue(Object newValue) 设置用户选择或输入的输入值。voidJComponent.setInputVerifier(InputVerifier inputVerifier) 设置此组件的输入验证器。voidJTable.setIntercellSpacing(Dimension intercellSpacing) 将rowMargin和columnMargin(单元格之间空间的高度和宽度)设置为intercellSpacing。voidJSlider.setInverted(boolean b) 指定 true 以反转为滑块显示的值范围,指定 false 以正常顺序放置值范围。voidJPopupMenu.setInvoker(Component invoker) 设置此弹出菜单的调用程序——要在其中显示弹出菜单菜单的组件。voidJTree.setInvokesStopCellEditing(boolean newValue) 确定通过选择树中的另一个节点、树数据的更改或其他方式中断编辑时会发生什么。voidJApplet.setJMenuBar(JMenuBar menuBar) 已弃用,将被删除:此 API 元素可能会在未来版本中删除。设置此小程序的菜单栏。voidJDialog.setJMenuBar(JMenuBar menu) 设置此对话框的菜单栏。voidJFrame.setJMenuBar(JMenuBar menubar) 设置此框架的菜单栏。voidJInternalFrame.setJMenuBar(JMenuBar m) 为此JInternalFrame设置menuBar属性。voidJComboBox.setKeySelectionManager(JComboBox.KeySelectionManager aManager) 设置将键盘字符转换为列表选择的对象。void已弃用。- 替换为setText(text)void设置弹出菜单的标签。voidJLabel.setLabelFor(Component c) 设置这是标签的组件。voidJSlider.setLabelTable(Dictionary labels) 用于指定将在任何给定值处绘制的标签。voidJTree.setLargeModel(boolean newValue) 指定 UI 是否应使用大型模型。voidJSplitPane.setLastDividerLocation(int newLastLocation) 将分隔线所在的最后位置设置为newLastLocation。voidJInternalFrame.setLayer(int layer) 设置该组件层属性的便捷方法。void设置该组件层属性的便捷方法。voidJApplet.setLayeredPane(JLayeredPane layeredPane) 已弃用,将被删除:此 API 元素可能会在未来版本中删除。设置 layeredPane 属性。voidJDialog.setLayeredPane(JLayeredPane layeredPane) 设置layeredPane属性。voidJFrame.setLayeredPane(JLayeredPane layeredPane) 设置layeredPane属性。voidJInternalFrame.setLayeredPane(JLayeredPane layered) 设置此JInternalFrame的layeredPane属性。voidJWindow.setLayeredPane(JLayeredPane layeredPane) 设置layeredPane属性。voidJList.setLayoutOrientation(int layoutOrientation) 定义列表单元格的布局方式。voidJTree.setLeadSelectionPath(TreePath newPath) 设置标识为前导的路径。voidJComboBox.setLightWeightPopupEnabled(boolean aFlag) 设置lightWeightPopupEnabled属性,它提供了关于是否应使用轻量级Component来包含JComboBox以及重量级Component(例如Panel或Window)的提示。voidJPopupMenu.setLightWeightPopupEnabled(boolean aFlag) 设置lightWeightPopupEnabled属性的值,默认情况下为true。voidJTextArea.setLineWrap(boolean wrap) 设置文本区域的换行策略。voidJPopupMenu.setLocation(int x, int y) 使用 x、y 坐标设置弹出菜单左上角的位置。voidJSlider.setMajorTickSpacing(int n) 此方法设置主刻度间距。void设置按钮边框和标签之间的边距空间。void设置菜单栏边框与其菜单之间的边距。void设置工具栏边框与其按钮之间的边距。voidJInternalFrame.setMaximizable(boolean b) 设置maximizable属性,该属性确定JInternalFrame是否可以通过某些用户操作最大化。voidJInternalFrame.setMaximum(boolean b) 最大化并恢复此内部框架。voidJProgressBar.setMaximum(int n) 将进度条的最大值(存储在进度条的数据模型中)设置为n。voidJScrollBar.setMaximum(int maximum) 设置模型的最大属性。voidJSlider.setMaximum(int maximum) 将滑块的最大值设置为maximum。voidJComboBox.setMaximumRowCount(int count) 设置JComboBox显示的最大行数。voidJComponent.setMaximumSize(Dimension maximumSize) 将此组件的最大大小设置为常量值。voidJOptionPane.setMessage(Object newMessage) 设置选项窗格的消息对象。voidJOptionPane.setMessageType(int newType) 设置选项窗格的消息类型。voidJProgressBar.setMinimum(int n) 将进度条的最小值(存储在进度条的数据模型中)设置为n。voidJScrollBar.setMinimum(int minimum) 设置模型的最小属性。voidJSlider.setMinimum(int minimum) 将滑块的最小值设置为minimum。voidJComponent.setMinimumSize(Dimension minimumSize) 将此组件的最小大小设置为常量值。voidJSlider.setMinorTickSpacing(int n) 此方法设置次刻度间距。voidAbstractButton.setMnemonic(char mnemonic) 此方法现已废弃,请使用setMnemonic(int)为按钮设置助记符。voidAbstractButton.setMnemonic(int mnemonic) 在当前模型上设置键盘助记符。voidJTabbedPane.setMnemonicAt(int tabIndex, int mnemonic) 设置用于访问指定选项卡的键盘助记符。voidAbstractButton.setModel(ButtonModel newModel) 设置此按钮代表的模型。voidJComboBox.setModel(ComboBoxModel<E> aModel) 设置JComboBox用于获取项目列表的数据模型。void设置表示列表内容或“值”的模型,通知属性更改监听,然后清除列表的选择。voidJProgressBar.setModel(BoundedRangeModel newModel) 设置JProgressBar使用的数据模型。voidJScrollBar.setModel(BoundedRangeModel newModel) 设置处理滚动条的四个基本属性的模型:最小值、最大值、值、范围。voidJSlider.setModel(BoundedRangeModel newModel) 设置BoundedRangeModel来处理滑块的三个基本属性:最小值、最大值和值。voidJSpinner.setModel(SpinnerModel model) 更改表示此微调器值的模型。voidJTabbedPane.setModel(SingleSelectionModel model) 设置要与此选项卡式窗格一起使用的模型。voidJTable.setModel(TableModel dataModel) 将此表的数据模型设置为dataModel并向其注册以接收来自新数据模型的监听器通知。void设置将提供数据的TreeModel。voidJFileChooser.setMultiSelectionEnabled(boolean b) 设置文件选择器以允许选择多个文件。voidJSplitPane.setOneTouchExpandable(boolean newValue) 设置oneTouchExpandable属性的值,对于JSplitPane必须是true才能在分隔线上提供 UI 小部件以快速展开/折叠分隔线。voidJComponent.setOpaque(boolean isOpaque) 如果为真,则该组件会绘制其边界内的每个像素。voidJOptionPane.setOptions(Object[] newOptions) 设置此窗格显示的选项。voidJOptionPane.setOptionType(int newType) 设置要显示的选项。voidJProgressBar.setOrientation(int newOrientation) 将进度条的方向设置为newOrientation,它必须是SwingConstants.VERTICAL或SwingConstants.HORIZONTAL。voidJScrollBar.setOrientation(int orientation) 将滚动条的方向设置为垂直或水平。voidJSeparator.setOrientation(int orientation) 设置分隔符的方向。voidJSlider.setOrientation(int orientation) 将滑块的方向设置为SwingConstants.VERTICAL或SwingConstants.HORIZONTAL。voidJSplitPane.setOrientation(int orientation) 设置方向,或拆分器的划分方式。voidJToolBar.setOrientation(int o) 设置工具栏的方向。void设置当前显示的 URL。voidJSlider.setPaintLabels(boolean b) 确定标签是否绘制在滑块上。voidJSlider.setPaintTicks(boolean b) 确定是否在滑块上绘制刻度线。voidJSlider.setPaintTrack(boolean b) 确定轨道是否绘制在滑块上。voidJMenu.setPopupMenuVisible(boolean b) 设置菜单弹出窗口的可见性。voidJPopupMenu.setPopupSize(int width, int height) 将弹出窗口的大小设置为指定的宽度和高度。voidJPopupMenu.setPopupSize(Dimension d) 使用Dimension对象设置弹出窗口的大小。voidJTable.setPreferredScrollableViewportSize(Dimension size) 为此表设置视口的首选大小。voidJComponent.setPreferredSize(Dimension preferredSize) 设置此组件的首选大小。voidAbstractButton.setPressedIcon(Icon pressedIcon) 设置按钮的按下图标。voidJColorChooser.setPreviewPanel(JComponent preview) 设置当前预览面板。voidJList.setPrototypeCellValue(E prototypeCellValue) 设置prototypeCellValue属性,然后(如果新值为non-null),通过从单元格渲染器请求单元格渲染器组件的给定值(和索引 0)并使用该组件的首选大小来计算fixedCellWidth和fixedCellHeight属性。voidJComboBox.setPrototypeDisplayValue(E prototypeDisplayValue) 设置用于计算 UI 部分显示大小的原型显示值。voidJComboBox.setRenderer(ListCellRenderer<? super E> aRenderer) 设置绘制列表项和从 JComboBox 字段中的列表中选择的项的渲染器。voidJInternalFrame.setResizable(boolean b) 设置JInternalFrame是否可以通过某些用户操作调整大小。voidJSplitPane.setResizeWeight(double value) 指定当拆分窗格的大小发生变化时如何分配额外空间。voidJSplitPane.setRightComponent(Component comp) 将组件设置到分隔线的右侧(或下方)。voidJToolBar.setRollover(boolean rollover) 设置此工具栏的翻转状态。voidAbstractButton.setRolloverEnabled(boolean b) 设置rolloverEnabled属性,该属性必须为true才能发生翻转效果。voidAbstractButton.setRolloverIcon(Icon rolloverIcon) 设置按钮的翻转图标。voidAbstractButton.setRolloverSelectedIcon(Icon rolloverSelectedIcon) 设置按钮的鼠标悬停选定图标。protected voidJApplet.setRootPaneCheckingEnabled(boolean enabled) 已弃用,将被删除:此 API 元素可能会在未来版本中删除。设置是否将对add和setLayout的调用转发到contentPane。protected voidJDialog.setRootPaneCheckingEnabled(boolean enabled) 设置是否将对add和setLayout的调用转发到contentPane。protected voidJFrame.setRootPaneCheckingEnabled(boolean enabled) 设置是否将对add和setLayout的调用转发到contentPane。protected voidJInternalFrame.setRootPaneCheckingEnabled(boolean enabled) 设置是否将对add和setLayout的调用转发到contentPane。protected voidJWindow.setRootPaneCheckingEnabled(boolean enabled) 设置是否将对add和setLayout的调用转发到contentPane。voidJTree.setRootVisible(boolean rootVisible) 确定TreeModel的根节点是否可见。voidJScrollPane.setRowHeader(JViewport rowHeader) 删除旧的 rowHeader(如果存在);如果新的 rowHeader 不是null,则将其 viewPosition 的 y 坐标与视口(如果有的话)同步,然后将其添加到滚动窗格。voidJTable.setRowHeight(int rowHeight) 将所有单元格的高度(以像素为单位)设置为rowHeight,重新验证并重新绘制。voidJTable.setRowHeight(int row, int rowHeight) 将row的高度设置为rowHeight,重新验证并重新绘制。voidJTree.setRowHeight(int rowHeight) 设置每个单元格的高度,以像素为单位。voidJTable.setRowMargin(int rowMargin) 设置相邻行中单元格之间的空白空间量。voidJTextArea.setRows(int rows) 设置此 TextArea 的行数。voidJTable.setRowSelectionAllowed(boolean rowSelectionAllowed) 设置是否可以选择此模型中的行。voidJTable.setRowSorter(RowSorter<? extends TableModel> sorter) 设置RowSorter。voidJViewport.setScrollMode(int mode) 用于控制滚动视口内容的方法。voidJTree.setScrollsOnExpand(boolean newValue) 设置scrollsOnExpand属性,该属性确定树是否可以滚动以显示以前隐藏的子项。voidJInternalFrame.setSelected(boolean selected) 选择或取消选择显示的内部框架。voidJMenu.setSelected(boolean b) 设置菜单的选择状态。voidJPopupMenu.setSelected(Component sel) 设置当前选择的组件,这将导致选择模型发生变化。voidJTabbedPane.setSelectedComponent(Component c) 为此选项卡式窗格设置所选组件。voidJFileChooser.setSelectedFile(File file) 设置选择的文件。voidJFileChooser.setSelectedFiles(File[] selectedFiles) 如果文件选择器设置为允许多项选择,则设置所选文件的列表。voidAbstractButton.setSelectedIcon(Icon selectedIcon) 设置按钮的选定图标。voidJComboBox.setSelectedIndex(int anIndex) 选择索引anIndex处的项目。voidJList.setSelectedIndex(int index) 选择单个单元格。voidJTabbedPane.setSelectedIndex(int index) 为此选项卡式窗格设置选定索引。voidJComboBox.setSelectedItem(Object anObject) 将组合框显示区域中的选定项目设置为参数中的对象。voidJList.setSelectionBackground(Color selectionBackground) 设置用于绘制所选项目背景的颜色,单元格渲染器可以使用该颜色填充所选单元格。voidJTable.setSelectionBackground(Color selectionBackground) 设置选定单元格的背景颜色。voidJList.setSelectionForeground(Color selectionForeground) 设置用于绘制所选项目前景的颜色,单元格渲染器可用于渲染文本和图形。voidJTable.setSelectionForeground(Color selectionForeground) 设置选定单元格的前景色。voidJList.setSelectionMode(int selectionMode) 设置列表的选择模式。voidJTable.setSelectionMode(int selectionMode) 将表的选择模式设置为仅允许单个选择、单个连续间隔或多个间隔。voidJColorChooser.setSelectionModel(ColorSelectionModel newModel) 设置包含所选颜色的模型。voidJList.setSelectionModel(ListSelectionModel selectionModel) 将列表的selectionModel设置为非nullListSelectionModel实现。voidJMenuBar.setSelectionModel(SingleSelectionModel model) 设置模型对象以处理单个选择。voidJPopupMenu.setSelectionModel(SingleSelectionModel model) 设置模型对象以处理单个选择。voidJTable.setSelectionModel(ListSelectionModel selectionModel) 将此表的行选择模型设置为selectionModel并注册来自新选择模型的监听器通知。voidJTree.setSelectionModel(TreeSelectionModel selectionModel) 设置树的选择模型。voidJOptionPane.setSelectionValues(Object[] newValues) 设置窗格的输入选择值,该窗格为用户提供可供选择的项目列表。voidJTable.setShowGrid(boolean showGrid) 设置表格是否在单元格周围绘制网格线。voidJTable.setShowHorizontalLines(boolean showHorizontalLines) 设置表格是否在单元格之间绘制水平线。voidJTree.setShowsRootHandles(boolean newValue) 设置showsRootHandles属性的值,该属性指定是否应显示节点句柄。voidJTable.setShowVerticalLines(boolean showVerticalLines) 设置表格是否在单元格之间绘制垂直线。voidJSlider.setSnapToTicks(boolean b) 指定 true 会使旋钮(及其代表的数据值)解析为用户放置旋钮的位置旁边最近的刻度线。voidJCheckBoxMenuItem.setState(boolean b) 设置项目的选定状态。void设置进度字符串的值。voidJProgressBar.setStringPainted(boolean b) 设置stringPainted属性的值,该属性确定进度条是否应呈现进度字符串。voidJTabbedPane.setTabComponentAt(int index, Component component) 设置负责呈现指定选项卡标题的组件。voidJTabbedPane.setTabLayoutPolicy(int tabLayoutPolicy) 设置当所有选项卡不适合一次运行时选项卡窗格将用于布置选项卡的策略。voidJTable.setTableHeader(JTableHeader tableHeader) 将与此JTable一起工作的tableHeader设置为newHeader。voidJTabbedPane.setTabPlacement(int tabPlacement) 设置此选项卡窗格的选项卡位置。voidJTextArea.setTabSize(int size) 设置要将选项卡扩展到的字符数。void设置按钮的文本。void将此TextComponent的文本设置为指定的内容,该内容应采用此编辑器的内容类型的格式。void定义此组件将显示的单行文本。voidvoidJToolTip.setTipText(String tipText) 设置显示工具提示时显示的文本。void设置JInternalFrame标题。voidJTabbedPane.setTitleAt(int index, String title) 将位于index的标题设置为title,可以是null。voidJTree.setToggleClickCount(int clickCount) 设置节点展开或关闭前的鼠标点击次数。voidJComponent.setToolTipText(String text) 注册要在工具提示中显示的文本。voidJTabbedPane.setToolTipTextAt(int index, String toolTipText) 将index处的工具提示文本设置为toolTipText,可以是null。voidJSplitPane.setTopComponent(Component comp) 将组件设置在分隔线上方或左侧。voidJApplet.setTransferHandler(TransferHandler newHandler) 已弃用,将被删除:此 API 元素可能会在未来版本中删除。设置transferHandler属性,这是一种支持将数据传输到此组件的机制。voidJComponent.setTransferHandler(TransferHandler newHandler) 设置TransferHandler,它支持通过剪切/复制/粘贴和拖放将数据传入和传出此组件。voidJDialog.setTransferHandler(TransferHandler newHandler) 设置transferHandler属性,这是一种支持将数据传输到此组件的机制。voidJFrame.setTransferHandler(TransferHandler newHandler) 设置transferHandler属性,这是一种支持将数据传输到此组件的机制。voidJWindow.setTransferHandler(TransferHandler newHandler) 设置transferHandler属性,这是一种支持将数据传输到此组件的机制。void设置呈现此组件的 L&F 对象。voidJColorChooser.setUI(ColorChooserUI ui) 设置呈现此组件的 L&F 对象。voidJComboBox.setUI(ComboBoxUI ui) 设置呈现此组件的 L&F 对象。protected voidJComponent.setUI(ComponentUI newUI) 设置此组件的外观委托。voidJDesktopPane.setUI(DesktopPaneUI ui) 设置呈现此组件的 L&F 对象。voidJInternalFrame.setUI(InternalFrameUI ui) 为此JInternalFrame设置 UI 委托。void设置呈现此组件的 L&F 对象。void设置ListUI,呈现此组件的外观对象。void设置呈现此组件的 L&F 对象。voidJMenuItem.setUI(MenuItemUI ui) 设置呈现此组件的外观对象。voidJOptionPane.setUI(OptionPaneUI ui) 设置实现此组件的 L&F 的 UI 对象。void设置呈现此组件的外观 (L&F) 对象。voidJPopupMenu.setUI(PopupMenuUI ui) 设置呈现此组件的 L&F 对象。voidJProgressBar.setUI(ProgressBarUI ui) 设置呈现此组件的外观对象。voidJRootPane.setUI(RootPaneUI ui) 设置呈现此组件的 L&F 对象。voidJScrollBar.setUI(ScrollBarUI ui) 设置呈现此组件的 L&F 对象。voidJSeparator.setUI(SeparatorUI ui) 设置呈现此组件的 L&F 对象。void设置实现此组件的 L&F 的 UI 对象。voidJTabbedPane.setUI(TabbedPaneUI ui) 设置实现此组件的 L&F 的 UI 对象。void设置呈现此组件并重新绘制的 L&F 对象。void设置呈现此组件的 L&F 对象。void设置呈现此组件的 L&F 对象。voidJViewport.setUI(ViewportUI ui) 设置呈现此组件的 L&F 对象。voidJScrollBar.setUnitIncrement(int unitIncrement) 设置 unitIncrement 属性。voidJTable.setUpdateSelectionOnSort(boolean update) 指定是否应在排序后更新选择。void设置将由从当前AbstractFormatterFactory获得的AbstractFormatter格式化的值。void设置用户选择的值。voidJProgressBar.setValue(int n) 将进度条的当前值设置为n。voidJScrollBar.setValue(int value) 设置滚动条的值。voidJSlider.setValue(int n) 将滑块的当前值设置为n。voidJScrollBar.setValueIsAdjusting(boolean b) 设置模型的 valueIsAdjusting 属性。voidJSlider.setValueIsAdjusting(boolean b) 设置模型的valueIsAdjusting属性。voidJComponent.setVerifyInputWhenFocusTarget(boolean verifyInputWhenFocusTarget) 设置值以指示是否在此组件请求焦点之前调用当前焦点所有者的输入验证程序。voidAbstractButton.setVerticalAlignment(int alignment) 设置图标和文本的垂直对齐方式。voidJLabel.setVerticalAlignment(int alignment) 设置标签内容沿 Y 轴的对齐方式。voidJScrollPane.setVerticalScrollBar(JScrollBar verticalScrollBar) 将控制视口垂直视图位置的滚动条添加到滚动窗格。voidJScrollPane.setVerticalScrollBarPolicy(int policy) 确定垂直滚动条何时出现在滚动窗格中。voidAbstractButton.setVerticalTextPosition(int textPosition) 设置文本相对于图标的垂直位置。voidJLabel.setVerticalTextPosition(int textPosition) 设置标签文本相对于其图像的垂直位置。voidJScrollPane.setViewport(JViewport viewport) 删除旧视口(如果有的话);强制新视口的 viewPosition 位于 +x,+y 象限;将行和列标题(如果有的话)与新视口同步;最后将滚动条和标题与新视口同步。voidJScrollPane.setViewportBorder(Border viewportBorder) 在视口周围添加边框。voidJComponent.setVisible(boolean aFlag) 使组件可见或不可见。voidJPopupMenu.setVisible(boolean b) 设置弹出菜单的可见性。voidJScrollBar.setVisibleAmount(int extent) 设置模型的范围属性。voidJList.setVisibleRowCount(int visibleRowCount) 设置visibleRowCount属性,该属性根据布局方向具有不同的含义:对于VERTICAL布局方向,这设置了无需滚动即可显示的首选行数;对于其他方向,它会影响单元格的包裹。voidJTree.setVisibleRowCount(int newCount) 设置要显示的行数。voidJOptionPane.setWantsInput(boolean newValue) 设置wantsInput属性。voidJScrollPane.setWheelScrollingEnabled(boolean handleWheel) 启用/禁用响应鼠标滚轮移动的滚动。voidJRootPane.setWindowDecorationStyle(int windowDecorationStyle) 设置JRootPane应提供的窗口装饰类型(例如边框、用于关闭窗口的小部件、标题...)。voidJTextArea.setWrapStyleWord(boolean word) 设置文本区域换行时使用的换行样式。 -
BeanProperty 在 javax.swing.colorchooser 中的用法
具有类型为 BeanProperty 的注解的 javax.swing.colorchooser 中的方法修饰符和类型方法描述voidAbstractColorChooserPanel.setColorTransparencySelectionEnabled(boolean b) 设置颜色选择器面板是否允许选择颜色的透明度(alpha 值)。 -
BeanProperty 在 javax.swing.table 中的用法
具有类型为 BeanProperty 的注解的 javax.swing.table 中的方法修饰符和类型方法描述voidTableColumn.setCellEditor(TableCellEditor cellEditor) 将编辑器设置为在编辑此列中的单元格时使用。voidTableColumn.setCellRenderer(TableCellRenderer cellRenderer) 设置JTable使用的TableCellRenderer为该列绘制单独的值。voidJTableHeader.setColumnModel(TableColumnModel columnModel) 将此表的列模型设置为newModel并注册来自新列模型的监听器通知。voidTableColumn.setHeaderRenderer(TableCellRenderer headerRenderer) 将用于绘制TableColumn的标头的TableCellRenderer设置为headerRenderer。voidTableColumn.setHeaderValue(Object headerValue) 设置Object,其字符串表示形式将用作headerRenderer的值。voidTableColumn.setIdentifier(Object identifier) 将TableColumn的标识符设置为anIdentifier。voidTableColumn.setMaxWidth(int maxWidth) 将TableColumn的最大宽度设置为maxWidth或者,如果maxWidth小于最小宽度,则设置为最小宽度。voidTableColumn.setMinWidth(int minWidth) 将TableColumn的最小宽度设置为minWidth,必要时调整新的最小宽度以确保 0 <=minWidth<=maxWidth。voidTableColumn.setModelIndex(int modelIndex) 设置此列的模型索引。voidTableColumn.setPreferredWidth(int preferredWidth) 将此列的首选宽度设置为preferredWidth。voidJTableHeader.setReorderingAllowed(boolean reorderingAllowed) 设置用户是否可以拖动列标题以重新排列列。voidTableColumn.setResizable(boolean isResizable) 设置此列是否可以调整大小。voidJTableHeader.setResizingAllowed(boolean resizingAllowed) 设置用户是否可以通过在标题之间拖动来调整列的大小。void设置与此标题关联的表。voidTableColumn.setWidth(int width) 此方法不应用于设置JTable中列的宽度,请改用setPreferredWidth。 -
BeanProperty 在 javax.swing.text 中的用法
具有类型为 BeanProperty 的注解的 javax.swing.text 中的方法修饰符和类型方法描述JTextComponent.getAccessibleContext()获取与此JTextComponent关联的AccessibleContext。Action[]JTextComponent.getActions()获取编辑器的命令列表。JTextComponent.getCaretListeners()返回在此文本组件上注册的所有插入符号监听的数组。JTextComponent.getDropLocation()返回此组件在组件上的 DnD 操作期间应直观指示为放置位置的位置,如果当前没有要显示的位置,则返回null。JTextComponent.getInputMethodRequests()JTextComponent.getPreferredScrollableViewportSize()返回视图组件视口的首选大小。booleanJTextComponent.getScrollableTracksViewportHeight()如果视口应始终强制此Scrollable的高度与视口的高度匹配,则返回 true。booleanJTextComponent.getScrollableTracksViewportWidth()如果视口应始终强制此Scrollable的宽度与视口的宽度匹配,则返回 true。JTextComponent.getSelectedText()返回此TextComponent中包含的选定文本。void设置要使用的插入符号。voidJTextComponent.setCaretColor(Color c) 设置用于呈现插入符号的当前颜色。voidJTextComponent.setCaretPosition(int position) 为TextComponent设置文本插入符号的位置。voidJTextComponent.setDisabledTextColor(Color c) 设置用于呈现禁用文本的当前颜色。voidJTextComponent.setDocument(Document doc) 将编辑器与文本文档相关联。voidJTextComponent.setDragEnabled(boolean b) 打开或关闭自动拖动处理。voidJTextComponent.setEditable(boolean b) 设置指定的boolean以指示此TextComponent是否应可编辑。voidJTextComponent.setFocusAccelerator(char aKey) 设置将导致接收文本组件获得焦点的快捷键。voidJTextComponent.setHighlighter(Highlighter h) 设置要使用的荧光笔。void设置用于将事件绑定到操作的键映射。void设置文本组件的边框与其文本之间的边距空间。voidJTextComponent.setSelectedTextColor(Color c) 设置用于呈现所选文本的当前颜色。voidJTextComponent.setSelectionColor(Color c) 设置用于呈现选择的当前颜色。voidJTextComponent.setSelectionEnd(int selectionEnd) 将选择结束设置到指定位置。voidJTextComponent.setSelectionStart(int selectionStart) 将选择开始设置到指定位置。void将此TextComponent的文本设置为指定的文本。 -
BeanProperty 在 javax.swing.tree 中的用法
具有类型为 BeanProperty 的注解的 javax.swing.tree 中的方法修饰符和类型方法描述void设置此组件的边框。void设置将提供数据的TreeModel。voidAbstractLayoutCache.setRootVisible(boolean rootVisible) 确定TreeModel的根节点是否可见。voidVariableHeightLayoutCache.setRootVisible(boolean rootVisible) 确定TreeModel的根节点是否可见。voidAbstractLayoutCache.setRowHeight(int rowHeight) 设置每个单元格的高度。voidVariableHeightLayoutCache.setRowHeight(int rowHeight) 设置每个单元格的高度。
JList.getSelectedValuesList()取代