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

📄 basiclistui.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 5 页
字号:
 cell renderer component, and then use the CellRendererPane to paint it. Subclasses may want to override this method rather than paint().<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#paint(java.awt.Graphics, javax.swing.JComponent)"><CODE>paint(java.awt.Graphics, javax.swing.JComponent)</CODE></A></DL></DD></DL><HR><A NAME="paint(java.awt.Graphics, javax.swing.JComponent)"><!-- --></A><H3>paint</H3><PRE>public void <B>paint</B>(<A HREF="../../../../java/awt/Graphics.html">Graphics</A>&nbsp;g,                  <A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;c)</PRE><DL><DD>Paint the rows that intersect the Graphics objects clipRect.  This method calls paintCell as necessary.  Subclasses may want to override these methods.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html#paint(java.awt.Graphics, javax.swing.JComponent)">paint</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#paintCell(java.awt.Graphics, int, java.awt.Rectangle, javax.swing.ListCellRenderer, javax.swing.ListModel, javax.swing.ListSelectionModel, int)"><CODE>paintCell(java.awt.Graphics, int, java.awt.Rectangle, javax.swing.ListCellRenderer, javax.swing.ListModel, javax.swing.ListSelectionModel, int)</CODE></A></DL></DD></DL><HR><A NAME="getPreferredSize(javax.swing.JComponent)"><!-- --></A><H3>getPreferredSize</H3><PRE>public <A HREF="../../../../java/awt/Dimension.html">Dimension</A> <B>getPreferredSize</B>(<A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;c)</PRE><DL><DD>The preferredSize of a list is total height of the rows and the maximum width of the cells.  If JList.fixedCellHeight is specified then the total height of the rows is just (cellVerticalMargins + fixedCellHeight) * model.getSize() where rowVerticalMargins is the space we allocate for drawing the yellow focus outline.  Similarly if JListfixedCellWidth is specified then we just use that plus the horizontal margins.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html#getPreferredSize(javax.swing.JComponent)">getPreferredSize</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - The JList component.<DT><B>Returns:</B><DD>The total size of the list.</DL></DD></DL><HR><A NAME="getMinimumSize(javax.swing.JComponent)"><!-- --></A><H3>getMinimumSize</H3><PRE>public <A HREF="../../../../java/awt/Dimension.html">Dimension</A> <B>getMinimumSize</B>(<A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;c)</PRE><DL><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html#getMinimumSize(javax.swing.JComponent)">getMinimumSize</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#getPreferredSize(javax.swing.JComponent)"><CODE>getPreferredSize(javax.swing.JComponent)</CODE></A></DL></DD></DL><HR><A NAME="getMaximumSize(javax.swing.JComponent)"><!-- --></A><H3>getMaximumSize</H3><PRE>public <A HREF="../../../../java/awt/Dimension.html">Dimension</A> <B>getMaximumSize</B>(<A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;c)</PRE><DL><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html#getMaximumSize(javax.swing.JComponent)">getMaximumSize</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#getPreferredSize(javax.swing.JComponent)"><CODE>getPreferredSize(javax.swing.JComponent)</CODE></A></DL></DD></DL><HR><A NAME="selectPreviousIndex()"><!-- --></A><H3>selectPreviousIndex</H3><PRE>protected void <B>selectPreviousIndex</B>()</PRE><DL><DD>Selected the previous row and force it to be visible. Called by the KeyEvent.VK_UP keyboard action.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#installKeyboardActions()"><CODE>installKeyboardActions()</CODE></A>, <A HREF="../../../../javax/swing/JList.html#ensureIndexIsVisible(int)"><CODE>JList.ensureIndexIsVisible(int)</CODE></A></DL></DD></DL><HR><A NAME="selectNextIndex()"><!-- --></A><H3>selectNextIndex</H3><PRE>protected void <B>selectNextIndex</B>()</PRE><DL><DD>Selected the previous row and force it to be visible. Called by the KeyEvent.VK_DOWN keyboard action.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#installKeyboardActions()"><CODE>installKeyboardActions()</CODE></A>, <A HREF="../../../../javax/swing/JList.html#ensureIndexIsVisible(int)"><CODE>JList.ensureIndexIsVisible(int)</CODE></A></DL></DD></DL><HR><A NAME="installKeyboardActions()"><!-- --></A><H3>installKeyboardActions</H3><PRE>protected void <B>installKeyboardActions</B>()</PRE><DL><DD>Register keyboard actions for the up and down arrow keys.  The actions just call out to protected methods, subclasses that want to override or extend keyboard behavior should consider just overriding those methods.  This method is called at installUI() time.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#selectPreviousIndex()"><CODE>selectPreviousIndex()</CODE></A>, <A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#selectNextIndex()"><CODE>selectNextIndex()</CODE></A>, <A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#installUI(javax.swing.JComponent)"><CODE>installUI(javax.swing.JComponent)</CODE></A></DL></DD></DL><HR><A NAME="uninstallKeyboardActions()"><!-- --></A><H3>uninstallKeyboardActions</H3><PRE>protected void <B>uninstallKeyboardActions</B>()</PRE><DL><DD>Unregister keyboard actions for the up and down arrow keys. This method is called at uninstallUI() time - subclassess should ensure that all of the keyboard actions registered at installUI time are removed here.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#selectPreviousIndex()"><CODE>selectPreviousIndex()</CODE></A>, <A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#selectNextIndex()"><CODE>selectNextIndex()</CODE></A>, <A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#installUI(javax.swing.JComponent)"><CODE>installUI(javax.swing.JComponent)</CODE></A></DL></DD></DL><HR><A NAME="installListeners()"><!-- --></A><H3>installListeners</H3><PRE>protected void <B>installListeners</B>()</PRE><DL><DD>Create and install the listeners for the JList, its model, and its selectionModel.  This method is called at installUI() time.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#installUI(javax.swing.JComponent)"><CODE>installUI(javax.swing.JComponent)</CODE></A>, <A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#uninstallListeners()"><CODE>uninstallListeners()</CODE></A></DL></DD></DL><HR><A NAME="uninstallListeners()"><!-- --></A><H3>uninstallListeners</H3><PRE>protected void <B>uninstallListeners</B>()</PRE><DL><DD>Remove the listeners for the JList, its model, and its selectionModel.  All of the listener fields, are reset to null here.  This method is called at uninstallUI() time, it should be kept in sync with installListeners.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#uninstallUI(javax.swing.JComponent)"><CODE>uninstallUI(javax.swing.JComponent)</CODE></A>, <A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#installListeners()"><CODE>installListeners()</CODE></A></DL></DD></DL><HR><A NAME="installDefaults()"><!-- --></A><H3>installDefaults</H3><PRE>protected void <B>installDefaults</B>()</PRE><DL><DD>Initialize JList properties, e.g. font, foreground, and background, and add the CellRendererPane.  The font, foreground, and background properties are only set if their current value is either null or a UIResource, other properties are set if the current value is null.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#uninstallDefaults()"><CODE>uninstallDefaults()</CODE></A>, <A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#installUI(javax.swing.JComponent)"><CODE>installUI(javax.swing.JComponent)</CODE></A>, <A HREF="../../../../javax/swing/CellRendererPane.html"><CODE>CellRendererPane</CODE></A></DL></DD></DL><HR><A NAME="uninstallDefaults()"><!-- --></A><H3>uninstallDefaults</H3><PRE>protected void <B>uninstallDefaults</B>()</PRE><DL><DD>Set the JList properties that haven't been explicitly overriden to null.  A property is considered overridden if its current value is not a UIResource.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#installDefaults()"><CODE>installDefaults()</CODE></A>, <A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#uninstallUI(javax.swing.JComponent)"><CODE>uninstallUI(javax.swing.JComponent)</CODE></A>, <A HREF="../../../../javax/swing/CellRendererPane.html"><CODE>CellRendererPane</CODE></A></DL></DD></DL><HR><A NAME="installUI(javax.swing.JComponent)"><!-- --></A><H3>installUI</H3><PRE>public void <B>installUI</B>(<A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;c)</PRE><DL><DD>Initializes <code>this.list</code> by calling <code>installDefaults()</code>, <code>installListeners()</code>, and <code>installKeyboardActions()</code> in order.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html#installUI(javax.swing.JComponent)">installUI</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#installDefaults()"><CODE>installDefaults()</CODE></A>, <A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#installListeners()"><CODE>installListeners()</CODE></A>, <A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#installKeyboardActions()"><CODE>installKeyboardActions()</CODE></A></DL></DD></DL><HR><A NAME="uninstallUI(javax.swing.JComponent)"><!-- --></A><H3>uninstallUI</H3><PRE>public void <B>uninstallUI</B>(<A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;c)</PRE><DL><DD>Uninitializes <code>this.list</code> by calling <code>uninstallListeners()</code>, <code>uninstallKeyboardActions()</code>, and <code>uninstallDefaults()</code> in order.  Sets this.list to null.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html#uninstallUI(javax.swing.JComponent)">uninstallUI</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#uninstallListeners()"><CODE>uninstallListeners()</CODE></A>, <A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#uninstallKeyboardActions()"><CODE>uninstallKeyboardActions()</CODE></A>, <A HREF="../../../../javax/swing/plaf/basic/BasicListUI.html#uninstallDefaults()"><CODE>uninstallDefaults()</CODE></A></DL></DD></DL><HR><A NAME="createUI(javax.swing.JComponent)"><!-- --></A><H3>createUI</H3><PRE>public static <A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A> <B>createUI</B>(<A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;list)</PRE><DL><DD>Returns a new instance of BasicListUI.  BasicListUI delegates are allocated one per JList.<DD><DL><DT><B>Returns:</B><DD>A new ListUI implementation for the Windows look and feel.</DL></DD></DL><HR><A NAME="locationToIndex(javax.swing.JList, java.awt.Point)"><!-- --></A><H3>locationToIndex</H3><PRE>public int <B>locationToIndex</B>(<A HREF="../../../../javax/swing/JList.html">JList</A>&nbsp;list,                           <A HREF="../../../../java/awt/Point.html">Point</A>&nbsp;location)</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../../javax/swing/plaf/ListUI.html">ListUI</A></CODE></B></DD><DD>Convert a point in JList coordinates to the index of the cell at that location.  Returns -1 if there's no cell the specified location.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ListUI.html#locationToIndex(javax.swing.JList, java.awt.Point)">locationToIndex</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ListUI.html">ListUI</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>The index of the cell at location, or -1.<DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/ListUI.html#locationToIndex(javax.swing.JList, java.awt.Point)"><CODE>ListUI.locationToIndex(javax.swing.JList, java.awt.Point)</CODE></A></DL></DD></DL><HR><A NAME="indexToLocation(javax.swing.JList, int)"><!-- --></A><H3>indexToLocation</H3><PRE>public <A HREF="../../../../java/awt/Point.html">Point</A> <B>indexToLocation</B>(<A HREF="../../../../javax/swing/JList.html">JList</A>&nbsp;list,                             int&nbsp;index)</PRE><DL>

⌨️ 快捷键说明

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