All Packages Class Hierarchy This Package Previous Next Index
Class jp.kyasu.awt.List
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----jp.kyasu.awt.KContainer
|
+----jp.kyasu.awt.EventProxyContainer
|
+----jp.kyasu.awt.List
- public class List
- extends EventProxyContainer
- implements ItemSelectable, ActionListener, ItemListener
The List
component presents the user with a scrolling list
of text items. The list can be set up so that the user can choose either
one item or multiple items.
A List is an MVC-based component. The model of the List is a
TextListModel
object, the view of the List is a
TextListView
object, and the controller of the List
is a TextListController
object.
A List emits a ListActionEvent
and a ListItemEvent
.
- Version:
- 12 Dec 1998
- Author:
- Kazuki YASUMATSU
- See Also:
- ListModel, TextListModel, TextListView, TextListController, ListActionEvent, ListItemEvent
-
MULTIPLE_SELECTIONS
- Allows AWT style multiple selections.
-
SHIFT_MULTIPLE_SELECTIONS
- Allows Windows style multiple selections.
-
SINGLE_SELECTION
- Allows single selection.
-
List()
- Creates a new scrolling list.
-
List(int)
- Creates a new scrolling list initialized with the specified
number of visible lines.
-
List(int, boolean)
- Creates a new scrolling list initialized to display the specified
number of rows.
-
List(int, boolean, int)
- Creates a new scrolling list initialized to display the specified
number of rows, multipleMode, and scroll bar visibility..
-
List(RichTextStyle, int)
- Creates a new scrolling list with the specified style and number of rows.
-
List(RichTextStyle, int, boolean)
- Creates a new scrolling list with the specified style, number of rows,
and multipleMode.
-
List(RichTextStyle, int, boolean, int)
- Creates a new scrolling list with the specified style, number of rows,
multipleMode, and scroll bar visibility.
-
List(TextListModel, int)
- Creates a new scrolling list with the specified model and number of rows.
-
List(TextListModel, int, boolean)
- Creates a new scrolling list with the specified model, number of rows,
and multipleMode.
-
List(TextListModel, int, boolean, int)
- Creates a new scrolling list with the specified model, number of rows,
multipleMode, and scroll bar visibility.
-
List(TextListModel, int, boolean, int, VBorder)
- Creates a new scrolling list with the specified model, number of rows,
multipleMode, scroll bar visibility, and border visual.
-
actionPerformed(ActionEvent)
- Invoked when an action occurs.
-
add(String)
- Adds the specified item to the end of scrolling list.
-
add(String, int)
- Adds the specified item to the the scrolling list.
-
add(Text)
- Adds the specified text item to the end of scrolling list.
-
add(Text, int)
- Adds the specified item to the scrolling list.
-
addActionListener(ActionListener)
- Adds the specified action listener to receive action events from
this list.
-
addItem(String)
- Adds the specified item to the end of scrolling list.
-
addItem(String, int)
- Adds the specified item to the the scrolling list.
-
addItem(Text)
- Adds the specified text item to the end of scrolling list.
-
addItem(Text, int)
- Adds the specified text item to the scrolling list.
-
addItemListener(ItemListener)
- Adds the specified item listener to receive item events from this list.
-
addTextItem(Text)
- Adds the specified text item to the end of the scrolling list.
-
addTextItem(Text, int)
- Adds the specified text item to the end of the scrolling list.
-
allowsMultipleSelections()
-
Deprecated.
-
clear()
-
Deprecated.
-
countItems()
-
Deprecated.
-
delItem(int)
- Removes the item at the specified position from this list.
-
delItems(int, int)
-
Deprecated.
-
deselect(int)
- Deselects the item at the specified index.
-
getController()
- Returns the controller of this list.
-
getItem(int)
- Returns the item associated with the specified index.
-
getItemCount()
- Returns the number of items in the list.
-
getItems()
- Returns the items in the list.
-
getMinimumSize()
- Returns the minimum size of this scrolling list.
-
getMinimumSize(int)
- Returns the minumum dimensions for a list with the specified number
of rows.
-
getModel()
- Returns the model of this list.
-
getPopupMenu()
- Returns the popup menu of this list.
-
getPreferredSize()
- Returns the preferred size of this scrolling list.
-
getPreferredSize(int)
- Returns the preferred dimensions for a list with the specified number
of rows.
-
getRows()
- Get the number of visible lines in this list.
-
getScrollbarThickness()
- Returns the thickness of the scroll bar.
-
getSelectedIndex()
- Gets the index of the selected item on the list,
-
getSelectedIndexes()
- Gets the selected indexes on the list.
-
getSelectedItem()
- Get the selected item on this scrolling list.
-
getSelectedItems()
- Get the selected items on this scrolling list.
-
getSelectedObjects()
- Returns the selected items on the list in an array of Objects.
-
getSelectedTextItem()
- Get the selected text item on this scrolling list.
-
getSelectedTextItems()
- Get the selected text items on this scrolling list.
-
getSelectionBackground()
- Returns the selection background color.
-
getSelectionForeground()
- Returns the selection foreground color.
-
getSelectionMode()
- Returns the selection mode.
-
getTextItem(int)
- Returns the text item associated with the specified index.
-
getTextItems()
- Returns the text items in the list.
-
getView()
- Returns the view of this list.
-
getVisibleIndex()
- Gets the index of the item that was last made visible by the method
makeVisible
.
-
isClickToFocus()
- Tests if the list requests the focus when the mouse is clicked.
-
isDeselectionEnabled()
- Tests if the deselection is enabled when the selection mode is a single
selection.
-
isIndexSelected(int)
- Determines if the specified item in this scrolling list is selected.
-
isMouseFocus()
- Tests if the list requests the focus when the mouse enters the list.
-
isMultipleMode()
- Determines whether this list allows multiple selections.
-
isSelected(int)
-
Deprecated.
-
itemStateChanged(ItemEvent)
- Invoked when an item's state has been changed.
-
makeVisible(int)
- Makes the item at the specified index visible.
-
minimumSize(int)
-
Deprecated.
-
preferredSize(int)
-
Deprecated.
-
remove(int)
- Remove the item at the specified position from this scrolling list.
-
remove(int, int)
- Remove the items at the specified row range.
-
remove(int[])
- Remove the items at the specified row indices.
-
remove(String)
- Removes the first occurrence of an item from the list.
-
removeActionListener(ActionListener)
- Removes the specified action listener so that it no longer receives
action events from this list.
-
removeAll()
- Removes all items from this list.
-
removeItemListener(ItemListener)
- Removes the specified item listener so that it no longer receives
item events from this list.
-
removeSelectedIndexes()
- Remove the items at the indices of the selected rows.
-
replaceItem(String, int)
- Replaces the item at the specified index in the scrolling list
with the new string.
-
replaceItem(Text, int)
- Replaces the item at the specified index in the scrolling list
with the new text.
-
replaceTextItem(Text, int)
- Replaces the item at the specified index in the scrolling list
with the new text.
-
select(int)
- Selects the item at the specified index in the scrolling list.
-
select(String)
- Sets the selected item in this list to be the item whose name is
equal to the specified string.
-
setBackground(Color)
- Sets the background color of this list.
-
setClickToFocus()
- Makes the list request the focus when the mouse is clicked.
-
setCursor(Cursor)
- Sets the cursor of this list.
-
setDeselectionEnabled(boolean)
- Makes the deselection enabled when the selection mode is a single
selection.
-
setEnabled(boolean)
- Enables or disables this list.
-
setFont(Font)
- Sets the font of this list.
-
setForeground(Color)
- Sets the foreground color of this list.
-
setItems(String[])
- Sets the items of the list to the specified string items.
-
setItems(Text[])
- Sets the items of the list to the specified text items.
-
setMouseFocus()
- Makes the list request the focus when the mouse enters the list.
-
setMultipleMode(boolean)
- Sets the flag that determines whether this list allows multiple
selections.
-
setMultipleSelections(boolean)
-
Deprecated.
-
setPopupMenu(PopupMenu)
- Sets the popup menu of this list.
-
setRows(int)
- Sets the number of visible lines in this list.
-
setScrollbarThickness(int)
- Sets the thickness of the scroll bar.
-
setSelectionBackground(Color)
- Sets the selection background color.
-
setSelectionForeground(Color)
- Sets the selection foreground color.
-
setSelectionMode(int)
- Sets the selection mode.
-
setTextItems(Text[])
- Sets the items of the list to the specified text items.
SINGLE_SELECTION
public static final int SINGLE_SELECTION
- Allows single selection.
MULTIPLE_SELECTIONS
public static final int MULTIPLE_SELECTIONS
- Allows AWT style multiple selections.
SHIFT_MULTIPLE_SELECTIONS
public static final int SHIFT_MULTIPLE_SELECTIONS
- Allows Windows style multiple selections.
List
public List()
- Creates a new scrolling list. Initially there are no visible
lines, and only one item can be selected from the list.
List
public List(int rows)
- Creates a new scrolling list initialized with the specified
number of visible lines. By default, multiple selections are
not allowed.
- Parameters:
- rows - the number of items to show.
List
public List(int rows,
boolean multipleMode)
- Creates a new scrolling list initialized to display the specified
number of rows. If the value of
multipleMode
is
true
, then the user can select multiple items from
the list. If it is false
, only one item at a time
can be selected.
- Parameters:
- rows - the number of items to show.
- multipleMode - if
true
, then multiple selections
are allowed; otherwise, only one item can be
selected at a time.
List
public List(int rows,
boolean multipleMode,
int scrollbars)
- Creates a new scrolling list initialized to display the specified
number of rows, multipleMode, and scroll bar visibility..
- Parameters:
- rows - the number of items to show.
- multipleMode - if
true
, then multiple selections
are allowed; otherwise, only one item can be
selected at a time.
- scrollbars - a constant that determines what scrollbars are
created to view the list.
List
public List(RichTextStyle richTextStyle,
int rows)
- Creates a new scrolling list with the specified style and number of rows.
- Parameters:
- richTextStyle - the style of the text list model.
- rows - the number of items to show.
List
public List(RichTextStyle richTextStyle,
int rows,
boolean multipleMode)
- Creates a new scrolling list with the specified style, number of rows,
and multipleMode.
- Parameters:
- richTextStyle - the style of the text list model.
- rows - the number of items to show.
- multipleMode - if
true
, then multiple selections
are allowed; otherwise, only one item can be
List
public List(RichTextStyle richTextStyle,
int rows,
boolean multipleMode,
int scrollbars)
- Creates a new scrolling list with the specified style, number of rows,
multipleMode, and scroll bar visibility.
- Parameters:
- richTextStyle - the style of the text list model.
- rows - the number of items to show.
- multipleMode - if
true
, then multiple selections
are allowed; otherwise, only one item can be
- scrollbars - a constant that determines what scrollbars are
created to view the list.
List
public List(TextListModel textListModel,
int rows)
- Creates a new scrolling list with the specified model and number of rows.
- Parameters:
- textListModel - the text list model.
- rows - the number of items to show.
List
public List(TextListModel textListModel,
int rows,
boolean multipleMode)
- Creates a new scrolling list with the specified model, number of rows,
and multipleMode.
- Parameters:
- textListModel - the text list model.
- rows - the number of items to show.
- multipleMode - if
true
, then multiple selections
are allowed; otherwise, only one item can be
List
public List(TextListModel textListModel,
int rows,
boolean multipleMode,
int scrollbars)
- Creates a new scrolling list with the specified model, number of rows,
multipleMode, and scroll bar visibility.
- Parameters:
- textListModel - the text list model.
- rows - the number of items to show.
- multipleMode - if
true
, then multiple selections
are allowed; otherwise, only one item can be
- scrollbars - a constant that determines what scrollbars are
created to view the list.
List
public List(TextListModel textListModel,
int rows,
boolean multipleMode,
int scrollbars,
VBorder border)
- Creates a new scrolling list with the specified model, number of rows,
multipleMode, scroll bar visibility, and border visual.
- Parameters:
- textListModel - the text list model.
- rows - the number of items to show.
- multipleMode - if
true
, then multiple selections
are allowed; otherwise, only one item can be
- scrollbars - a constant that determines what scrollbars are
created to view the list.
- border - the border visual of the list.
addItemListener
public synchronized void addItemListener(ItemListener l)
- Adds the specified item listener to receive item events from this list.
- Parameters:
- l - the item listener.
removeItemListener
public synchronized void removeItemListener(ItemListener l)
- Removes the specified item listener so that it no longer receives
item events from this list.
- Parameters:
- l - the item listener.
addActionListener
public synchronized void addActionListener(ActionListener l)
- Adds the specified action listener to receive action events from
this list. Action events occur when a user double-clicks
on a list item.
- Parameters:
- l - the action listener.
removeActionListener
public synchronized void removeActionListener(ActionListener l)
- Removes the specified action listener so that it no longer receives
action events from this list. Action events occur when a user
double-clicks on a list item.
- Parameters:
- l - the action listener.
itemStateChanged
public void itemStateChanged(ItemEvent e)
- Invoked when an item's state has been changed.
- See Also:
- ItemListener
actionPerformed
public void actionPerformed(ActionEvent e)
- Invoked when an action occurs.
- See Also:
- ActionListener
setForeground
public synchronized void setForeground(Color c)
- Sets the foreground color of this list.
- Overrides:
- setForeground in class Component
setBackground
public synchronized void setBackground(Color c)
- Sets the background color of this list.
- Overrides:
- setBackground in class Component
setFont
public synchronized void setFont(Font f)
- Sets the font of this list.
- Overrides:
- setFont in class Component
setCursor
public synchronized void setCursor(Cursor c)
- Sets the cursor of this list.
- Overrides:
- setCursor in class Component
setEnabled
public synchronized void setEnabled(boolean b)
- Enables or disables this list.
- Overrides:
- setEnabled in class KContainer
getItemCount
public int getItemCount()
- Returns the number of items in the list.
- Returns:
- the number of items in the list.
- See Also:
- getItem
countItems
public int countItems()
- Note: countItems() is deprecated.
As of JDK version 1.1,
replaced by
getItemCount()
.
getItem
public String getItem(int index)
- Returns the item associated with the specified index.
- Parameters:
- index - the position of the item.
- Returns:
- an item that is associated with the specified index.
- See Also:
- getItemCount
getItems
public String[] getItems()
- Returns the items in the list.
- Returns:
- a string array containing items of the list.
add
public void add(String item)
- Adds the specified item to the end of scrolling list.
- Parameters:
- item - the item to be added.
addItem
public void addItem(String item)
- Adds the specified item to the end of scrolling list.
add
public void add(String item,
int index)
- Adds the specified item to the the scrolling list.
The index is zero-based. If value of the index is
-1
then the item is added to the end. If value of the index is greater
than the number of items in the list, the item is added at the end.
- Parameters:
- item - the item to be added.
- index - the position at which to add the item.
addItem
public synchronized void addItem(String item,
int index)
- Adds the specified item to the the scrolling list.
The index is zero-based. If value of the index is
-1
then the item is added to the end. If value of the index is greater
than the number of items in the list, the item is added at the end.
- Parameters:
- item - the item to be added.
- index - the position at which to add the item.
replaceItem
public synchronized void replaceItem(String newValue,
int index)
- Replaces the item at the specified index in the scrolling list
with the new string.
- Parameters:
- newValue - a new string to replace an existing item.
- index - the position of the item to replace.
removeAll
public synchronized void removeAll()
- Removes all items from this list.
- Overrides:
- removeAll in class Container
- See Also:
- remove, delItems
clear
public void clear()
- Note: clear() is deprecated.
As of JDK version 1.1,
replaced by
removeAll()
.
remove
public synchronized void remove(String item)
- Removes the first occurrence of an item from the list.
- Parameters:
- item - the item to remove from the list.
remove
public synchronized void remove(int position)
- Remove the item at the specified position from this scrolling list.
- Parameters:
- position - the index of the item to delete.
- Overrides:
- remove in class Container
- See Also:
- add
delItem
public void delItem(int position)
- Removes the item at the specified position from this list.
delItems
public synchronized void delItems(int start,
int end)
- Note: delItems() is deprecated.
As of JDK version 1.1,
getSelectedIndex
public synchronized int getSelectedIndex()
- Gets the index of the selected item on the list,
- Returns:
- the index of the selected item, or
-1
if no
item is selected, or if more that one item is selected.
getSelectedIndexes
public synchronized int[] getSelectedIndexes()
- Gets the selected indexes on the list.
- Returns:
- an array of the selected indexes of this scrolling list.
getSelectedItem
public synchronized String getSelectedItem()
- Get the selected item on this scrolling list.
- Returns:
- the selected item on the list, or null if no item is selected.
getSelectedItems
public synchronized String[] getSelectedItems()
- Get the selected items on this scrolling list.
- Returns:
- an array of the selected items on this scrolling list.
getSelectedObjects
public Object[] getSelectedObjects()
- Returns the selected items on the list in an array of Objects.
- See Also:
- ItemSelectable
select
public synchronized void select(int index)
- Selects the item at the specified index in the scrolling list.
- Parameters:
- index - the position of the item to select.
deselect
public synchronized void deselect(int index)
- Deselects the item at the specified index.
If the item at the specified index is not selected, or if the
index is out of range, then the operation is ignored.
- Parameters:
- index - the position of the item to deselect.
isIndexSelected
public boolean isIndexSelected(int index)
- Determines if the specified item in this scrolling list is selected.
- Parameters:
- index - the item to be checked.
- Returns:
-
true
if the specified item has been selected;
false
otherwise.
isSelected
public boolean isSelected(int index)
- Note: isSelected() is deprecated.
As of JDK version 1.1,
replaced by
isIndexSelected(int)
.
getRows
public int getRows()
- Get the number of visible lines in this list.
- Returns:
- the number of visible lines in this scrolling list.
- See Also:
- setRows
setRows
public void setRows(int rows)
- Sets the number of visible lines in this list.
- Parameters:
- rows - the number of visible lines in this scrolling list.
- See Also:
- getRows
isMultipleMode
public boolean isMultipleMode()
- Determines whether this list allows multiple selections.
- Returns:
-
true
if this list allows multiple selections;
false
otherwise.
- See Also:
- setMultipleMode, getSelectionMode, setSelectionMode
allowsMultipleSelections
public boolean allowsMultipleSelections()
- Note: allowsMultipleSelections() is deprecated.
As of JDK version 1.1,
replaced by
isMultipleMode()
.
setMultipleMode
public synchronized void setMultipleMode(boolean b)
- Sets the flag that determines whether this list allows multiple
selections.
- Parameters:
- b - if
true
then multiple selections are allowed;
otherwise, only one item from the list can be selected at once.
- See Also:
- isMultipleMode, getSelectionMode, setSelectionMode
setMultipleSelections
public void setMultipleSelections(boolean b)
- Note: setMultipleSelections() is deprecated.
As of JDK version 1.1,
replaced by
setMultipleMode(boolean)
.
getVisibleIndex
public int getVisibleIndex()
- Gets the index of the item that was last made visible by the method
makeVisible
.
- Returns:
- the index of the item that was last made visible.
- See Also:
- makeVisible
makeVisible
public synchronized void makeVisible(int index)
- Makes the item at the specified index visible.
- Parameters:
- index - the position of the item.
- See Also:
- getVisibleIndex
getPreferredSize
public Dimension getPreferredSize(int rows)
- Returns the preferred dimensions for a list with the specified number
of rows.
- Parameters:
- rows - number of rows in the list.
- Returns:
- the preferred dimensions for displaying this scrolling list.
preferredSize
public Dimension preferredSize(int rows)
- Note: preferredSize() is deprecated.
As of JDK version 1.1,
replaced by
getPreferredSize(int)
.
getPreferredSize
public Dimension getPreferredSize()
- Returns the preferred size of this scrolling list.
- Returns:
- the preferred dimensions for displaying this scrolling list.
- Overrides:
- getPreferredSize in class KContainer
getMinimumSize
public Dimension getMinimumSize(int rows)
- Returns the minumum dimensions for a list with the specified number
of rows.
- Parameters:
- rows - number of rows in the list.
- Returns:
- the minimum dimensions for displaying this scrolling list.
minimumSize
public Dimension minimumSize(int rows)
- Note: minimumSize() is deprecated.
As of JDK version 1.1,
replaced by
getMinimumSize(int)
.
getMinimumSize
public Dimension getMinimumSize()
- Returns the minimum size of this scrolling list.
- Returns:
- the minimum dimensions needed to display this scrolling list.
- Overrides:
- getMinimumSize in class KContainer
select
public synchronized void select(String item)
- Sets the selected item in this list to be the item whose name is
equal to the specified string. If more than one item matches
(is equal to) the specified string, the one with the smallest
index is selected.
- Parameters:
- item - the specified string
getModel
public TextListModel getModel()
- Returns the model of this list.
getView
public TextListView getView()
- Returns the view of this list.
getController
public TextListController getController()
- Returns the controller of this list.
getSelectionForeground
public Color getSelectionForeground()
- Returns the selection foreground color.
- See Also:
- setSelectionForeground
setSelectionForeground
public synchronized void setSelectionForeground(Color c)
- Sets the selection foreground color.
- See Also:
- getSelectionForeground
getSelectionBackground
public Color getSelectionBackground()
- Returns the selection background color.
- See Also:
- setSelectionBackground
setSelectionBackground
public synchronized void setSelectionBackground(Color c)
- Sets the selection background color.
- See Also:
- getSelectionBackground
getPopupMenu
public PopupMenu getPopupMenu()
- Returns the popup menu of this list.
- See Also:
- setPopupMenu
setPopupMenu
public synchronized void setPopupMenu(PopupMenu menu)
- Sets the popup menu of this list.
- See Also:
- getPopupMenu
isClickToFocus
public boolean isClickToFocus()
- Tests if the list requests the focus when the mouse is clicked.
- Returns:
-
true
if the list requests the focus when the
mouse is clicked, false
if the list requests
the focus when the mouse enters the view.
- See Also:
- isMouseFocus
isMouseFocus
public boolean isMouseFocus()
- Tests if the list requests the focus when the mouse enters the list.
- See Also:
- isClickToFocus
setClickToFocus
public void setClickToFocus()
- Makes the list request the focus when the mouse is clicked.
- See Also:
- isClickToFocus, setMouseFocus
setMouseFocus
public void setMouseFocus()
- Makes the list request the focus when the mouse enters the list.
- See Also:
- isMouseFocus, setClickToFocus
isDeselectionEnabled
public boolean isDeselectionEnabled()
- Tests if the deselection is enabled when the selection mode is a single
selection.
- See Also:
- setDeselectionEnabled
setDeselectionEnabled
public synchronized void setDeselectionEnabled(boolean b)
- Makes the deselection enabled when the selection mode is a single
selection.
- See Also:
- isDeselectionEnabled
getSelectionMode
public int getSelectionMode()
- Returns the selection mode.
- See Also:
- setSelectionMode, SINGLE_SELECTION, MULTIPLE_SELECTIONS, SHIFT_MULTIPLE_SELECTIONS
setSelectionMode
public synchronized void setSelectionMode(int mode)
- Sets the selection mode.
- See Also:
- getSelectionMode, SINGLE_SELECTION, MULTIPLE_SELECTIONS, SHIFT_MULTIPLE_SELECTIONS
setItems
public synchronized void setItems(String items[])
- Sets the items of the list to the specified string items.
setItems
public void setItems(Text items[])
- Sets the items of the list to the specified text items.
setTextItems
public synchronized void setTextItems(Text items[])
- Sets the items of the list to the specified text items.
getTextItem
public Text getTextItem(int index)
- Returns the text item associated with the specified index.
- Parameters:
- index - the position of the item.
- Returns:
- a text item that is associated with the specified index.
getTextItems
public Text[] getTextItems()
- Returns the text items in the list.
- Returns:
- a text array containing items of the list.
add
public void add(Text item)
- Adds the specified text item to the end of scrolling list.
- Parameters:
- item - the text item to be added.
addItem
public void addItem(Text item)
- Adds the specified text item to the end of scrolling list.
add
public void add(Text item,
int index)
- Adds the specified item to the scrolling list.
The index is zero-based. If value of the index is
-1
then the item is added to the end. If value of the index is greater
than the number of items in the list, the item is added at the end.
- Parameters:
- item - the text item to be added.
- index - the position at which to add the item.
addItem
public void addItem(Text item,
int index)
- Adds the specified text item to the scrolling list.
The index is zero-based. If value of the index is
-1
then the item is added to the end. If value of the index is greater
than the number of items in the list, the item is added at the end.
- Parameters:
- item - the text item to be added.
- index - the position at which to add the item.
addTextItem
public void addTextItem(Text item)
- Adds the specified text item to the end of the scrolling list.
- Parameters:
- item - the text item to be added.
addTextItem
public synchronized void addTextItem(Text item,
int index)
- Adds the specified text item to the end of the scrolling list.
The index is zero-based. If value of the index is
-1
then the item is added to the end. If value of the index is greater
than the number of items in the list, the item is added at the end.
- Parameters:
- item - the text item to be added.
- index - the position at which to add the item.
replaceItem
public void replaceItem(Text newValue,
int index)
- Replaces the item at the specified index in the scrolling list
with the new text.
- Parameters:
- newValue - a new text to replace an existing item.
- index - the position of the item to replace.
replaceTextItem
public synchronized void replaceTextItem(Text newValue,
int index)
- Replaces the item at the specified index in the scrolling list
with the new text.
- Parameters:
- newValue - a new text to replace an existing item.
- index - the position of the item to replace.
getSelectedTextItem
public synchronized Text getSelectedTextItem()
- Get the selected text item on this scrolling list.
- Returns:
- the selected item on the list, or null if no item is selected.
getSelectedTextItems
public synchronized Text[] getSelectedTextItems()
- Get the selected text items on this scrolling list.
- Returns:
- an array of the selected items on this scrolling list.
remove
public synchronized void remove(int start,
int end)
- Remove the items at the specified row range.
- Parameters:
- start - the starting row position, inclusive.
- end - the ending row position, inclusive.
remove
public synchronized void remove(int indices[])
- Remove the items at the specified row indices.
- Parameters:
- indices - the row indices to be removed.
removeSelectedIndexes
public synchronized void removeSelectedIndexes()
- Remove the items at the indices of the selected rows.
getScrollbarThickness
public int getScrollbarThickness()
- Returns the thickness of the scroll bar.
- See Also:
- setScrollbarThickness
setScrollbarThickness
public synchronized void setScrollbarThickness(int thickness)
- Sets the thickness of the scroll bar.
- See Also:
- setScrollbarThickness
All Packages Class Hierarchy This Package Previous Next Index