⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 defaultbuttonmodel.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicates that the mouse is over the button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultButtonModel.html#isSelected()">isSelected</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicates if the button has been selected.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultButtonModel.html#removeActionListener(java.awt.event.ActionListener)">removeActionListener</A></B>(<A HREF="../../java/awt/event/ActionListener.html">ActionListener</A>&nbsp;l)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes an ActionListener from the button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultButtonModel.html#removeChangeListener(javax.swing.event.ChangeListener)">removeChangeListener</A></B>(<A HREF="../../javax/swing/event/ChangeListener.html">ChangeListener</A>&nbsp;l)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes a ChangeListener from the button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultButtonModel.html#removeItemListener(java.awt.event.ItemListener)">removeItemListener</A></B>(<A HREF="../../java/awt/event/ItemListener.html">ItemListener</A>&nbsp;l)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes an ItemListener from the button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultButtonModel.html#setActionCommand(java.lang.String)">setActionCommand</A></B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;actionCommand)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the actionCommand string that gets sent as part of the event when the button is pressed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultButtonModel.html#setArmed(boolean)">setArmed</A></B>(boolean&nbsp;b)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Marks the button as "armed".</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultButtonModel.html#setEnabled(boolean)">setEnabled</A></B>(boolean&nbsp;b)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enables or disables the button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultButtonModel.html#setGroup(javax.swing.ButtonGroup)">setGroup</A></B>(<A HREF="../../javax/swing/ButtonGroup.html">ButtonGroup</A>&nbsp;group)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Identifies the group this button belongs to -- needed for radio buttons, which are mutually exclusive within their group.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultButtonModel.html#setMnemonic(int)">setMnemonic</A></B>(int&nbsp;key)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the keyboard mnemonic (shortcut key or accelerator key) for this button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultButtonModel.html#setPressed(boolean)">setPressed</A></B>(boolean&nbsp;b)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the button to pressed or unpressed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultButtonModel.html#setRollover(boolean)">setRollover</A></B>(boolean&nbsp;b)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets or clears the button's rollover state</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultButtonModel.html#setSelected(boolean)">setSelected</A></B>(boolean&nbsp;b)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Selects or deselects the button.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="stateMask"><!-- --></A><H3>stateMask</H3><PRE>protected int <B>stateMask</B></PRE><DL></DL><HR><A NAME="actionCommand"><!-- --></A><H3>actionCommand</H3><PRE>protected <A HREF="../../java/lang/String.html">String</A> <B>actionCommand</B></PRE><DL></DL><HR><A NAME="group"><!-- --></A><H3>group</H3><PRE>protected <A HREF="../../javax/swing/ButtonGroup.html">ButtonGroup</A> <B>group</B></PRE><DL></DL><HR><A NAME="mnemonic"><!-- --></A><H3>mnemonic</H3><PRE>protected int <B>mnemonic</B></PRE><DL></DL><HR><A NAME="changeEvent"><!-- --></A><H3>changeEvent</H3><PRE>protected transient <A HREF="../../javax/swing/event/ChangeEvent.html">ChangeEvent</A> <B>changeEvent</B></PRE><DL><DD>Only one ChangeEvent is needed per button model instance since the event's only state is the source property.  The source of events generated is always "this".</DL><HR><A NAME="listenerList"><!-- --></A><H3>listenerList</H3><PRE>protected <A HREF="../../javax/swing/event/EventListenerList.html">EventListenerList</A> <B>listenerList</B></PRE><DL></DL><HR><A NAME="ARMED"><!-- --></A><H3>ARMED</H3><PRE>public static final int <B>ARMED</B></PRE><DL><DD>Indicates partial commitment towards choosing the button.</DL><HR><A NAME="SELECTED"><!-- --></A><H3>SELECTED</H3><PRE>public static final int <B>SELECTED</B></PRE><DL><DD>Indicates that the button has been selected. Only needed for certain types of buttons - such as RadioButton or Checkbox.</DL><HR><A NAME="PRESSED"><!-- --></A><H3>PRESSED</H3><PRE>public static final int <B>PRESSED</B></PRE><DL><DD>Indicates that the button has been "pressed" (typically, when the mouse is released).</DL><HR><A NAME="ENABLED"><!-- --></A><H3>ENABLED</H3><PRE>public static final int <B>ENABLED</B></PRE><DL><DD>Indicates that the button can be selected by an input device (such as a mouse pointer).</DL><HR><A NAME="ROLLOVER"><!-- --></A><H3>ROLLOVER</H3><PRE>public static final int <B>ROLLOVER</B></PRE><DL><DD>Indicates that the mouse is over the button.</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="DefaultButtonModel()"><!-- --></A><H3>DefaultButtonModel</H3><PRE>public <B>DefaultButtonModel</B>()</PRE><DL><DD>Constructs a JButtonModel</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="setActionCommand(java.lang.String)"><!-- --></A><H3>setActionCommand</H3><PRE>public void <B>setActionCommand</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;actionCommand)</PRE><DL><DD>Sets the actionCommand string that gets sent as part of the event when the button is pressed.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/swing/ButtonModel.html#setActionCommand(java.lang.String)">setActionCommand</A></CODE> in interface <CODE><A HREF="../../javax/swing/ButtonModel.html">ButtonModel</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the String that identifies the generated event</DL></DD></DL><HR><A NAME="getActionCommand()"><!-- --></A><H3>getActionCommand</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getActionCommand</B>()</PRE><DL><DD>Returns the action command for this button.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/swing/ButtonModel.html#getActionCommand()">getActionCommand</A></CODE> in interface <CODE><A HREF="../../javax/swing/ButtonModel.html">ButtonModel</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the String that identifies the generated event<DT><B>See Also: </B><DD><A HREF="../../javax/swing/DefaultButtonModel.html#setActionCommand(java.lang.String)"><CODE>setActionCommand(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="isArmed()"><!-- --></A><H3>isArmed</H3><PRE>public boolean <B>isArmed</B>()</PRE><DL><DD>Indicates partial commitment towards pressing the button.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/swing/ButtonModel.html#isArmed()">isArmed</A></CODE> in interface <CODE><A HREF="../../javax/swing/ButtonModel.html">ButtonModel</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the button is armed, and ready to be pressed<DT><B>See Also: </B><DD><A HREF="../../javax/swing/DefaultButtonModel.html#setArmed(boolean)"><CODE>setArmed(boolean)</CODE></A></DL></DD></DL><HR><A NAME="isSelected()"><!-- --></A><H3>isSelected</H3><PRE>public boolean <B>isSelected</B>()</PRE><DL><DD>Indicates if the button has been selected. Only needed for certain types of buttons - such as RadioButton or Checkbox.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/swing/ButtonModel.html#isSelected()">isSelected</A></CODE> in interface <CODE><A HREF="../../javax/swing/ButtonModel.html">ButtonModel</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the button is selected</DL></DD></DL><HR><A NAME="isEnabled()"><!-- --></A><H3>isEnabled</H3><PRE>public boolean <B>isEnabled</B>()</PRE><DL><DD>Indicates if the button can be selected or pressed by an input device (such as a mouse pointer). (Checkbox-buttons are selected, regular buttons are "pressed".)<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/swing/ButtonModel.html#isEnabled()">isEnabled</A></CODE> in interface <CODE><A HREF="../../javax/swing/ButtonModel.html">ButtonModel</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the button is enabled, and therefore         selectable (or pressable)</DL></DD></DL><HR><A NAME="isPressed()"><!-- --></A><H3>isPressed</H3><PRE>public boolean <B>isPressed</B>()</PRE><DL><DD>Indicates if button has been pressed.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/swing/ButtonModel.html#isPressed()">isPressed</A></CODE> in interface <CODE><A HREF="../../javax/swing/ButtonModel.html">ButtonModel</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the button has been pressed</DL></DD></DL><HR><A NAME="isRollover()"><!-- --></A><H3>isRollover</H3><PRE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -