📄 abstractbutton.html
字号:
Sets the action command for this button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setBorderPainted(boolean)">setBorderPainted</A></B>(boolean b)</CODE><BR> Sets whether the border should be painted.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setContentAreaFilled(boolean)">setContentAreaFilled</A></B>(boolean b)</CODE><BR> Sets whether the button should paint the content area or leave it transparent.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setDisabledIcon(javax.swing.Icon)">setDisabledIcon</A></B>(<A HREF="../../javax/swing/Icon.html">Icon</A> disabledIcon)</CODE><BR> Sets the disabled icon for the button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setDisabledSelectedIcon(javax.swing.Icon)">setDisabledSelectedIcon</A></B>(<A HREF="../../javax/swing/Icon.html">Icon</A> disabledSelectedIcon)</CODE><BR> Sets the disabled selection icon for the button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setEnabled(boolean)">setEnabled</A></B>(boolean b)</CODE><BR> Enables (or disables) the button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setFocusPainted(boolean)">setFocusPainted</A></B>(boolean b)</CODE><BR> Sets whether focus should be painted.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setHorizontalAlignment(int)">setHorizontalAlignment</A></B>(int alignment)</CODE><BR> Sets the horizontal alignment of the icon and text.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setHorizontalTextPosition(int)">setHorizontalTextPosition</A></B>(int textPosition)</CODE><BR> Sets the horizontal position of the text relative to the icon.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setIcon(javax.swing.Icon)">setIcon</A></B>(<A HREF="../../javax/swing/Icon.html">Icon</A> defaultIcon)</CODE><BR> Sets the button's default icon.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setLabel(java.lang.String)">setLabel</A></B>(<A HREF="../../java/lang/String.html">String</A> label)</CODE><BR> <B>Deprecated.</B> <I>- Replaced by <code>setText(text)</code></I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setMargin(java.awt.Insets)">setMargin</A></B>(<A HREF="../../java/awt/Insets.html">Insets</A> m)</CODE><BR> Sets space for margin between the button's border and the label.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setMnemonic(char)">setMnemonic</A></B>(char mnemonic)</CODE><BR> Specifies the mnemonic value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setMnemonic(int)">setMnemonic</A></B>(int mnemonic)</CODE><BR> Sets the keyboard mnemonic on the current model.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setModel(javax.swing.ButtonModel)">setModel</A></B>(<A HREF="../../javax/swing/ButtonModel.html">ButtonModel</A> newModel)</CODE><BR> Sets the model that this button represents.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setPressedIcon(javax.swing.Icon)">setPressedIcon</A></B>(<A HREF="../../javax/swing/Icon.html">Icon</A> pressedIcon)</CODE><BR> Sets the pressed icon for the button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setRolloverEnabled(boolean)">setRolloverEnabled</A></B>(boolean b)</CODE><BR> Sets whether rollover effects should be enabled.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setRolloverIcon(javax.swing.Icon)">setRolloverIcon</A></B>(<A HREF="../../javax/swing/Icon.html">Icon</A> rolloverIcon)</CODE><BR> Sets the rollover icon for the button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setRolloverSelectedIcon(javax.swing.Icon)">setRolloverSelectedIcon</A></B>(<A HREF="../../javax/swing/Icon.html">Icon</A> rolloverSelectedIcon)</CODE><BR> Sets the rollover selected icon for the button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setSelected(boolean)">setSelected</A></B>(boolean b)</CODE><BR> Sets the state of the button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setSelectedIcon(javax.swing.Icon)">setSelectedIcon</A></B>(<A HREF="../../javax/swing/Icon.html">Icon</A> selectedIcon)</CODE><BR> Sets the selected icon for the button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setText(java.lang.String)">setText</A></B>(<A HREF="../../java/lang/String.html">String</A> text)</CODE><BR> Sets the button's text.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setUI(javax.swing.plaf.ButtonUI)">setUI</A></B>(<A HREF="../../javax/swing/plaf/ButtonUI.html">ButtonUI</A> ui)</CODE><BR> Sets the L&F object that renders this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setVerticalAlignment(int)">setVerticalAlignment</A></B>(int alignment)</CODE><BR> Sets the vertical alignment of the icon and text.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#setVerticalTextPosition(int)">setVerticalTextPosition</A></B>(int textPosition)</CODE><BR> Sets the vertical position of the text relative to the icon.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/AbstractButton.html#updateUI()">updateUI</A></B>()</CODE><BR> Notification from the <code>UIFactory</code> that the L&F has changed.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_javax.swing.JComponent"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class javax.swing.<A HREF="../../javax/swing/JComponent.html">JComponent</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../javax/swing/JComponent.html#addAncestorListener(javax.swing.event.AncestorListener)">addAncestorListener</A>, <A HREF="../../javax/swing/JComponent.html#addNotify()">addNotify</A>, <A HREF="../../javax/swing/JComponent.html#addPropertyChangeListener(java.beans.PropertyChangeListener)">addPropertyChangeListener</A>, <A HREF="../../javax/swing/JComponent.html#addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)">addPropertyChangeListener</A>, <A HREF="../../javax/swing/JComponent.html#addVetoableChangeListener(java.beans.VetoableChangeListener)">addVetoableChangeListener</A>, <A HREF="../../javax/swing/JComponent.html#computeVisibleRect(java.awt.Rectangle)">computeVisibleRect</A>, <A HREF="../../javax/swing/JComponent.html#contains(int, int)">contains</A>, <A HREF="../../javax/swing/JComponent.html#createToolTip()">createToolTip</A>, <A HREF="../../javax/swing/JComponent.html#disable()">disable</A>, <A HREF="../../javax/swing/JComponent.html#enable()">enable</A>, <A HREF="../../javax/swing/JComponent.html#firePropertyChange(java.lang.String, boolean, boolean)">firePropertyChange</A>, <A HREF="../../javax/swing/JComponent.html#firePropertyChange(java.lang.String, byte, byte)">firePropertyChange</A>, <A HREF="../../javax/swing/JComponent.html#firePropertyChange(java.lang.String, char, char)">firePropertyChange</A>, <A HREF="../../javax/swing/JComponent.html#firePropertyChange(java.lang.String, double, double)">firePropertyChange</A>, <A HREF="../../javax/swing/JComponent.html#firePropertyChange(java.lang.String, float, float)">firePropertyChange</A>, <A HREF="../../javax/swing/JComponent.html#firePropertyChange(java.lang.String, int, int)">firePropertyChange</A>, <A HREF="../../javax/swing/JComponent.html#firePropertyChange(java.lang.String, long, long)">firePropertyChange</A>, <A HREF="../../javax/swing/JComponent.html#firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)">firePropertyChange</A>, <A HREF="../../javax/swing/JComponent.html#firePropertyChange(java.lang.String, short, short)">firePropertyChange</A>, <A HREF="../../javax/swing/JComponent.html#fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object)">fireVetoableChange</A>, <A HREF="../../javax/swing/JComponent.html#getAccessibleContext()">getAccessibleContext</A>, <A HREF="../../javax/swing/JComponent.html#getActionForKeyStroke(javax.swing.KeyStroke)">getActionForKeyStroke</A>, <A HREF="../../javax/swing/JComponent.html#getActionMap()">getActionMap</A>, <A HREF="../../javax/swing/JComponent.html#getAlignmentX()">getAlignmentX</A>, <A HREF="../../javax/swing/JComponent.html#getAlignmentY()">getAlignmentY</A>, <A HREF="../../javax/swing/JComponent.html#getAutoscrolls()">getAutoscrolls</A>, <A HREF="../../javax/swing/JComponent.html#getBorder()">getBorder</A>, <A HREF="../../javax/swing/JComponent.html#getBounds(java.awt.Rectangle)">getBounds</A>, <A HREF="../../javax/swing/JComponent.html#getClientProperty(java.lang.Object)">getClientProperty</A>, <A HREF="../../javax/swing/JComponent.html#getComponentGraphics(java.awt.Graphics)">getComponentGraphics</A>, <A HREF="../../javax/swing/JComponent.html#getConditionForKeyStroke(javax.swing.KeyStroke)">getConditionForKeyStroke</A>, <A HREF="../../javax/swing/JComponent.html#getDebugGraphicsOptions()">getDebugGraphicsOptions</A>, <A HREF="../../javax/swing/JComponent.html#getGraphics()">getGraphics</A>, <A HREF="../../javax/swing/JComponent.html#getHeight()">getHeight</A>, <A HREF="../../javax/swing/JComponent.html#getInputMap()">getInputMap</A>, <A HREF="../../javax/swing/JComponent.html#getInputMap(int)">getInputMap</A>, <A HREF="../../javax/swing/JComponent.html#getInputVerifier()">getInputVerifier</A>, <A HREF="../../javax/swing/JComponent.html#getInsets()">getInsets</A>, <A HREF="../../javax/swing/JComponent.html#getInsets(java.awt.Insets)">getInsets</A>, <A HREF="../../javax/swing/JComponent.html#getListeners(java.lang.Class)">getListeners</A>, <A HREF="../../javax/swing/JComponent.html#getLocation(java.awt.Point)">getLocation</A>, <A HREF="../../javax/swing/JComponent.html#getMaximumSize()">getMaximumSize</A>, <A HREF="../../javax/swing/JComponent.html#getMinimumSize()">getMinimumSize</A>, <A HREF="../../javax/swing/JComponent.html#getNextFocusableComponent()">getNextFocusableComponent</A>, <A HREF="../../javax/swing/JComponent.html#getPreferredSize()">getPreferredSize</A>, <A HREF="../../javax/swing/JComponent.html#getRegisteredKeyStrokes()">getRegisteredKeyStrokes</A>, <A HREF="../../javax/swing/JComponent.html#getRootPane()">getRootPane</A>, <A HREF="../../javax/swing/JComponent.html#getSize(java.awt.Dimension)">getSize</A>, <A HREF="../../javax/swing/JComponent.html#getToolTipLocation(java.awt.event.MouseEvent)">getToolTipLocation</A>, <A HREF="../../javax/swing/JComponent.html#getToolTipText()">getToolTipText</A>, <A HREF="../../javax/swing/JComponent.html#getToolTipText(java.awt.event.MouseEvent)">getToolTipText</A>, <A HREF="../../javax/swing/JComponent.html#getTopLevelAncestor()">getTopLevelAncestor</A>, <A HREF="../../javax/swing/JComponent.html#getUIClassID()">getUIClassID</A>, <A HREF="../../javax/swing/JComponent.html#getVerifyInputWhenFocusTarget()">getVerifyInputWhenFocusTarget</A>, <A HREF="../../javax/swing/JComponent.html#getVisibleRect()">getVisibleRect</A>, <A HREF="../../javax/swing/JComponent.html#getWidth()">getWidth</A>, <A HREF="../../javax/swing/JComponent.html#getX()">getX</A>, <A HREF="../../javax/swing/JComponent.html#getY()">getY</A>, <A HREF="../../javax/swing/JComponent.html#grabFocus()">grabFocus</A>, <A HREF="../../javax/swing/JComponent.html#hasFocus()">hasFocus</A>, <A HREF="../../javax/swing/JComponent.html#hide()">hide</A>, <A HREF="../../javax/swing/JComponent.html#isDoubleBuffered()">isDoubleBuffered</A>, <A HREF="../../javax/swing/JComponent.html#isFocusCycleRoot()">isFocusCycleRoot</A>, <A HREF="../../javax/swing/JComponent.html#isLightweightComponent(java.awt.Component)">isLightweightComponent</A>, <A HREF="../../javax/swing/JComponent.html#isManagingFocus()">isManagingFocus</A>, <A HREF="../../javax/swing/JComponent.html#isMaximumSizeSet()">isMaximumSizeSet</A>, <A HREF="../../javax/swing/JComponent.html#isMinimumSizeSet()">isMinimumSizeSet</A>, <A HREF="../../javax/swing/JComponent.html#isOpaque()">isOpaque</A>, <A HREF="../../javax/swing/JComponent.html#isOptimizedDrawingEnabled()">isOptimizedDrawingEnabled</A>, <A HREF="../../javax/swing/JComponent.html#isPaintingTile()">isPaintingTile</A>, <A HREF="../../javax/swing/JComponent.html#isPreferredSizeSet()">isPreferredSizeSet</A>, <A HREF="../../javax/swing/JComponent.html#isRequestFocusEnabled()">isRequestFocusEnabled</A>, <A HREF="../../javax/swing/JComponent.html#isValidateRoot()">isValidateRoot</A>, <A HREF="../../javax/swing/JComponent.html#paint(java.awt.Graphics)">paint</A>, <A HREF="../../javax/swing/JComponent.html#paintChildren(java.awt.Graphics)">paintChildren</A>, <A HREF="../../javax/swing/JComponent.html#paintComponent(java.awt.Graphics)">paintComponent</A>, <A HREF="../../javax/swing/JComponent.html#paintImmediately(int, int, int, int)">paintImmediately</A>, <A HREF="../../javax/swing/JComponent.html#paintImmediately(java.awt.Rectangle)">paintImmediately</A>, <A HREF="../../javax/swing/JComponent.html#print(java.awt.Graphics)">print</A>, <A HREF="../../javax/swing/JComponent.html#printAll(java.awt.Graphics)">printAll</A>, <A HREF="../../javax/swing/JComponent.html#printBorder(java.awt.Graphics)">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -