|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcontrol.ui.vole.Component jcontrol.ui.vole.List
public class List
The List
component shows a list of text items
with a vertical scroll bar on the right. List items can be added
and removed by the application even when the list is already showing.
(c) Copyright 2003-2007 DOMOLOGIC GmbH
Field Summary |
---|
Fields inherited from class jcontrol.ui.vole.Component |
---|
eventQueue, focusOwner, font, g, height, listener, parent, visible, width, x, y |
Constructor Summary | |
---|---|
List()
Create a new empty list without scroll bar. |
|
List(int x,
int y,
boolean scrollbar)
Create a new empty list at the given x- and y-coordinates. |
|
List(int x,
int y,
int width,
int height,
boolean scrollbar)
Create a new List with the specified items
at the given x- and y-coordinates. |
|
List(String[] items,
int x,
int y,
int width,
int height,
boolean scrollbar)
Create a new List with the specified list of items
at the given x- and y-coordinates with the specified width and height. |
Method Summary | |
---|---|
void |
add(String item)
Adds an item to this ComboBox . |
protected void |
deSelect(int selItem)
De-invert last selected item |
protected void |
drawItems()
Draw currently visible items of the list. |
boolean |
onKeyEvent(KeyEvent e)
Handle key events. |
void |
paint()
Paint this List . |
void |
paintScrollbar()
Paint the ScrollBar. |
boolean |
remove(String item)
Removes the first occurrence of item from the
ComboBox . |
void |
setActionListener(ActionListener listener)
Sets an ActionListener for the ComboBox . |
void |
validate()
Compute this component's preferred size and assign internal values width and height. |
Methods inherited from class jcontrol.ui.vole.Component |
---|
getBounds, getParent, isVisible, onActionEvent, remove, removeFocus, requestFocus, setBounds, setFont, setGraphics, setParent, setVisible, transferFocus |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, notifyAll, toString, wait |
Constructor Detail |
---|
public List()
public List(int x, int y, boolean scrollbar)
x
- The x-coordinate of the List
.y
- The y-coordinate of the List
.scrollbar
- Select whether a scrollbar should be displayed.public List(int x, int y, int width, int height, boolean scrollbar)
List
with the specified items
at the given x- and y-coordinates. The preferred width and height is
internally computed by taking the contained items dimensions.
x
- The x-coordinate of this List
.y
- The y-coordinate of this List
.width
- The width of this List
.height
- The height of this List
.scrollbar
- Select whether a scrollbar should be displayed.public List(String[] items, int x, int y, int width, int height, boolean scrollbar)
List
with the specified list of items
at the given x- and y-coordinates with the specified width and height.
items
- An array of text-items.x
- The x-coordinate of this List
.y
- The y-coordinate of this List
.width
- The width of this List
.height
- The height of this List
.scrollbar
- Select whether a scrollbar should be displayed.Method Detail |
---|
public void add(String item)
ComboBox
.
item
- The item to add to the ComboBox
.public boolean remove(String item)
item
from the
ComboBox
.
item
- The item to remove from the ComboBox
.
public void setActionListener(ActionListener listener)
ActionListener
for the ComboBox
. It will
receive ActionEvents
everytime a combo box item is pressed.
listener
- The ActionListener
to assign to this ComboBox
.public boolean onKeyEvent(KeyEvent e)
ActionEvent
is fired.
onKeyEvent
in class Component
e
- the KeyEvent
Container
.public void paint()
List
.
paint
in class Component
protected void drawItems()
protected void deSelect(int selItem)
public void validate()
validate
in class Component
public void paintScrollbar()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |