📄 jtoolbar.html
字号:
<DL><DD>Checks whether the border should be painted.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the border should be painted, else false<DT><B>See Also: </B><DD><A HREF="../../javax/swing/JToolBar.html#setBorderPainted(boolean)"><CODE>setBorderPainted(boolean)</CODE></A></DL></DD></DL><HR><A NAME="setBorderPainted(boolean)"><!-- --></A><H3>setBorderPainted</H3><PRE>public void <B>setBorderPainted</B>(boolean b)</PRE><DL><DD>Sets whether the border should be painted.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>b</CODE> - if true, the border is painted<DT><B>See Also: </B><DD><A HREF="../../javax/swing/JToolBar.html#isBorderPainted()"><CODE>isBorderPainted()</CODE></A></DL></DD></DL><HR><A NAME="paintBorder(java.awt.Graphics)"><!-- --></A><H3>paintBorder</H3><PRE>protected void <B>paintBorder</B>(<A HREF="../../java/awt/Graphics.html">Graphics</A> g)</PRE><DL><DD>Paint the toolbar's border if <code>BorderPainted</code> property is true.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../javax/swing/JComponent.html#paintBorder(java.awt.Graphics)">paintBorder</A></CODE> in class <CODE><A HREF="../../javax/swing/JComponent.html">JComponent</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>g</CODE> - the <code>Graphics</code> context in which the painting is done<DT><B>See Also: </B><DD><A HREF="../../javax/swing/JComponent.html#paint(java.awt.Graphics)"><CODE>JComponent.paint(java.awt.Graphics)</CODE></A>, <A HREF="../../javax/swing/JComponent.html#setBorder(javax.swing.border.Border)"><CODE>JComponent.setBorder(javax.swing.border.Border)</CODE></A></DL></DD></DL><HR><A NAME="isFloatable()"><!-- --></A><H3>isFloatable</H3><PRE>public boolean <B>isFloatable</B>()</PRE><DL><DD>Returns true if the <code>JToolbar</code> can be dragged out by the user.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the <code>JToolbar</code> can be dragged out by the user, false otherwise</DL></DD></DL><HR><A NAME="setFloatable(boolean)"><!-- --></A><H3>setFloatable</H3><PRE>public void <B>setFloatable</B>(boolean b)</PRE><DL><DD>Sets whether the toolbar can be made to float.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>b</CODE> - if true, the toolbar can be dragged out; false otherwise<DT><B>See Also: </B><DD><A HREF="../../javax/swing/JToolBar.html#isFloatable()"><CODE>isFloatable()</CODE></A></DL></DD></DL><HR><A NAME="getOrientation()"><!-- --></A><H3>getOrientation</H3><PRE>public int <B>getOrientation</B>()</PRE><DL><DD>Returns the current orientation of the toolbar. The value is either <code>HORIZONTAL</code> or <code>VERTICAL</code>.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an integer representing the current orientation -- either <code>HORIZONTAL</code> or <code>VERTICAL</code><DT><B>See Also: </B><DD><A HREF="../../javax/swing/JToolBar.html#setOrientation(int)"><CODE>setOrientation(int)</CODE></A></DL></DD></DL><HR><A NAME="setOrientation(int)"><!-- --></A><H3>setOrientation</H3><PRE>public void <B>setOrientation</B>(int o)</PRE><DL><DD>Sets the orientation of the toolbar. The orientation must have either the value <code>HORIZONTAL</code> or <code>VERTICAL</code>. If <code>orientation</code> is an invalid value, an exception will be thrown.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>o</CODE> - the new orientation -- either <code>HORIZONTAL</code> or </code>VERTICAL</code><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if orientation is neither <code>HORIZONTAL</code> nor <code>VERTICAL</code><DT><B>See Also: </B><DD><A HREF="../../javax/swing/JToolBar.html#getOrientation()"><CODE>getOrientation()</CODE></A></DL></DD></DL><HR><A NAME="addSeparator()"><!-- --></A><H3>addSeparator</H3><PRE>public void <B>addSeparator</B>()</PRE><DL><DD>Appends a toolbar separator of default size to the end of the toolbar. The default size is determined by the current look and feel.<DD><DL></DL></DD></DL><HR><A NAME="addSeparator(java.awt.Dimension)"><!-- --></A><H3>addSeparator</H3><PRE>public void <B>addSeparator</B>(<A HREF="../../java/awt/Dimension.html">Dimension</A> size)</PRE><DL><DD>Appends a toolbar separator of a specified size to the end of the toolbar.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>size</CODE> - the <code>Dimension</code> of the separator</DL></DD></DL><HR><A NAME="add(javax.swing.Action)"><!-- --></A><H3>add</H3><PRE>public <A HREF="../../javax/swing/JButton.html">JButton</A> <B>add</B>(<A HREF="../../javax/swing/Action.html">Action</A> a)</PRE><DL><DD>Adds a new <code>JButton</code> which dispatches the action. <p> As of 1.3, this is no longer the preferred method for adding <code>Action</code>s to a container. Instead it is recommended to configure a control with an action using using <code>setAction</code>, and then add that control directly to the <code>Container</code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - the <code>Action</code> object to add as a new menu item<DT><B>Returns:</B><DD>the new button which dispatches the action</DL></DD></DL><HR><A NAME="createActionComponent(javax.swing.Action)"><!-- --></A><H3>createActionComponent</H3><PRE>protected <A HREF="../../javax/swing/JButton.html">JButton</A> <B>createActionComponent</B>(<A HREF="../../javax/swing/Action.html">Action</A> a)</PRE><DL><DD>Factory method which creates the <code>JButton</code> for <code>Action</code>s added to the <code>JToolBar</code>. The default name is empty if a <code>null</code> action is passed. <p> As of 1.3, this is no longer the preferred method for adding <code>Action</code>s to a <code>Container</code>. Instead it is recommended to configure a control with an action using <code>setAction</code>, and then add that control directly to the <code>Container</code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - the <code>Action</code> for the button to be added<DT><B>Re
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -