📄 jlist.html
字号:
<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/JList.html#addListSelectionListener(javax.swing.event.ListSelectionListener)">addListSelectionListener</A></B>(<A HREF="../../javax/swing/event/ListSelectionListener.html">ListSelectionListener</A> listener)</CODE><BR> Adds a listener to the list that's notified each time a change to the selection occurs.</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/JList.html#addSelectionInterval(int, int)">addSelectionInterval</A></B>(int anchor, int lead)</CODE><BR> Sets the selection to be the union of the specified interval with current selection.</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/JList.html#clearSelection()">clearSelection</A></B>()</CODE><BR> Clears the selection - after calling this method <code>isSelectionEmpty</code> will return true.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../javax/swing/ListSelectionModel.html">ListSelectionModel</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#createSelectionModel()">createSelectionModel</A></B>()</CODE><BR> Returns an instance of <code>DefaultListSelectionModel</code>.</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/JList.html#ensureIndexIsVisible(int)">ensureIndexIsVisible</A></B>(int index)</CODE><BR> Scrolls the viewport to make the specified cell completely visible.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#fireSelectionValueChanged(int, int, boolean)">fireSelectionValueChanged</A></B>(int firstIndex, int lastIndex, boolean isAdjusting)</CODE><BR> Notifies <code>JList</code> <code>ListSelectionListener</code>s that the selection model has changed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../javax/accessibility/AccessibleContext.html">AccessibleContext</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getAccessibleContext()">getAccessibleContext</A></B>()</CODE><BR> Gets the AccessibleContext associated with this JList.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getAnchorSelectionIndex()">getAnchorSelectionIndex</A></B>()</CODE><BR> Returns the first index argument from the most recent <code>addSelectionModel</code> or <code>setSelectionInterval</code> call.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/awt/Rectangle.html">Rectangle</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getCellBounds(int, int)">getCellBounds</A></B>(int index0, int index1)</CODE><BR> Returns the bounds of the specified range of items in <code>JList</code> coordinates.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../javax/swing/ListCellRenderer.html">ListCellRenderer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getCellRenderer()">getCellRenderer</A></B>()</CODE><BR> Returns the object that renders the list items.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getFirstVisibleIndex()">getFirstVisibleIndex</A></B>()</CODE><BR> Returns the index of the cell in the upper left corner of the <code>JList</code> or -1 if nothing is visible or the list is empty.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getFixedCellHeight()">getFixedCellHeight</A></B>()</CODE><BR> Returns the fixed cell height value -- the value specified by setting the <code>fixedCellHeight</code> property, rather than that calculated from the list elements.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getFixedCellWidth()">getFixedCellWidth</A></B>()</CODE><BR> Returns the fixed cell width value -- the value specified by setting the <code>fixedCellWidth</code> property, rather than that calculated from the list elements.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getLastVisibleIndex()">getLastVisibleIndex</A></B>()</CODE><BR> Returns the index of the cell in the lower right corner of the <code>JList</code> or -1 if nothing is visible or the list is empty.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getLeadSelectionIndex()">getLeadSelectionIndex</A></B>()</CODE><BR> Returns the second index argument from the most recent <code>addSelectionInterval</code> or <code>setSelectionInterval</code> call.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getMaxSelectionIndex()">getMaxSelectionIndex</A></B>()</CODE><BR> Returns the largest selected cell index.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getMinSelectionIndex()">getMinSelectionIndex</A></B>()</CODE><BR> Returns the smallest selected cell index.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../javax/swing/ListModel.html">ListModel</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getModel()">getModel</A></B>()</CODE><BR> Returns the data model that holds the list of items displayed by the <code>JList</code> component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/awt/Dimension.html">Dimension</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getPreferredScrollableViewportSize()">getPreferredScrollableViewportSize</A></B>()</CODE><BR> Computes the size of the viewport needed to display <code>visibleRowCount</code> rows.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getPrototypeCellValue()">getPrototypeCellValue</A></B>()</CODE><BR> Returns the cell width of the "prototypical cell" -- a cell used for the calculation of cell widths, because it has the same value as all other list items.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JList.html#getScrollableBlockIncrement(java.awt.Rectangle, int, int)">getScrollableBlockIncrement</A></B>(<A HREF="../../java/awt/Rectangle.html">Rectangle</A> visibleRect, int orientation, int direction)</CODE><BR> Returns the block increment amount.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -