jv.objectGui
Class PsList
- java.lang.Object
-
- java.awt.Component
-
- java.awt.List
-
- jv.objectGui.PsList
-
- All Implemented Interfaces:
- java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
public class PsList extends java.awt.ListExtends and corrects java.awt.list.- See Also:
- Serialized Form
- Author:
- Konrad Polthier
- Version:
- 19.04.13, 1.00 created (kp)
-
-
Field Summary
-
Constructor Summary
Constructors Constructor and Description PsList()Creates a new scrolling list.PsList(int rows)Creates a new scrolling list initialized with the specified number of visible lines.PsList(int rows, boolean multipleMode)Creates a new scrolling list initialized to display the specified number of rows.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddItemListener(java.awt.event.ItemListener l)Adds the specified item listener to receive item events from this list.voidremoveItemListener(java.awt.event.ItemListener l)Removes the specified item listener so that it no longer receives item events from this list.voidselect(int index)Selects the item at the specified index in the scrolling list.-
Methods inherited from class java.awt.List
add, add, addActionListener, addItem, addItem, addNotify, allowsMultipleSelections, clear, countItems, delItem, delItems, deselect, getAccessibleContext, getActionListeners, getItem, getItemCount, getItemListeners, getItems, getListeners, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, getRows, getSelectedIndex, getSelectedIndexes, getSelectedItem, getSelectedItems, getSelectedObjects, getVisibleIndex, isIndexSelected, isMultipleMode, isSelected, makeVisible, minimumSize, minimumSize, preferredSize, preferredSize, remove, remove, removeActionListener, removeAll, removeNotify, replaceItem, setMultipleMode, setMultipleSelections
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
-
-
-
-
Constructor Detail
-
PsList
public PsList()
Creates a new scrolling list. By default, there are four visible lines and multiple selections are not allowed. Note that this is a convenience method forList(0, false). Also note that the number of visible lines in the list cannot be changed after it has been created. returns true.
-
PsList
public PsList(int rows)
Creates a new scrolling list initialized with the specified number of visible lines. By default, multiple selections are not allowed. Note that this is a convenience method forList(rows, false). Also note that the number of visible rows in the list cannot be changed after it has been created.- Parameters:
rows- the number of items to show.- Since:
- JDK1.1
-
PsList
public PsList(int rows, boolean multipleMode)Creates a new scrolling list initialized to display the specified number of rows. Note that if zero rows are specified, then the list will be created with a default of four rows. Also note that the number of visible rows in the list cannot be changed after it has been created. If the value ofmultipleModeistrue, then the user can select multiple items from the list. If it isfalse, only one item at a time can be selected.- Parameters:
rows- the number of items to show.multipleMode- iftrue, then multiple selections are allowed; otherwise, only one item can be selected at a time.
-
-
Method Detail
-
select
public void select(int index)
Selects the item at the specified index in the scrolling list.Note that passing out of range parameters is invalid, and will result in unspecified behavior.
Note that this method should be primarily used to initially select an item in this component. Programmatically calling this method will not trigger an
ItemEvent. The only way to trigger anItemEventis by user interaction.- Overrides:
selectin classjava.awt.List- Parameters:
index- the position of the item to select- See Also:
List.getSelectedItem(),List.deselect(int),List.isIndexSelected(int)
-
addItemListener
public void addItemListener(java.awt.event.ItemListener l)
Adds the specified item listener to receive item events from this list. Item events are sent in response to user input, but not in response to calls toselectordeselect. If listenerlisnull, no exception is thrown and no action is performed.Refer to AWT Threading Issues for details on AWT's threading model.
- Specified by:
addItemListenerin interfacejava.awt.ItemSelectable- Overrides:
addItemListenerin classjava.awt.List- Parameters:
l- the item listener- Since:
- JDK1.1
- See Also:
removeItemListener(java.awt.event.ItemListener),List.getItemListeners(),select(int),List.deselect(int),ItemEvent,ItemListener
-
removeItemListener
public void removeItemListener(java.awt.event.ItemListener l)
Removes the specified item listener so that it no longer receives item events from this list. If listenerlisnull, no exception is thrown and no action is performed.Refer to AWT Threading Issues for details on AWT's threading model.
- Specified by:
removeItemListenerin interfacejava.awt.ItemSelectable- Overrides:
removeItemListenerin classjava.awt.List- Parameters:
l- the item listener- Since:
- JDK1.1
- See Also:
addItemListener(java.awt.event.ItemListener),List.getItemListeners(),ItemEvent,ItemListener
-
-
"