Monday, June 15, 2015

DEVOLOPING CHOICE COMPONENT IN APPLETS IN JAVA

9:57 AM

DEVOLOPING CHOICE COMPONENT IN APPLETS

CHOICE:

Choice is the GUI component which allows us to add ‘n’ number of items. This component  allows selecting a single item at a time. Creating a choice component is nothing but creating an object of Choice class.

Choice API:

Constructors:
choice ();
Instance methods:
public void add (String); 1
public void addItem (String); 2
public void add (int pos, String); 3
public void addItem (int pos, String); 4
public String getSelectedItem (); 5
public int getSelectedIndex (); 6
public void remove (String); 7
public void remove (int); 8
public void removeAll (); 9
public void addItemListener (ItemListener); 10
public void removeItemListener (ItemListener); 11

• Methods 1 and 2 are used for adding items to the choice component at end.
• Methods 3 and 4 are used for adding the items at the specified position.
Methods 5 and 6 are used for obtaining the items either based on its name or on its index.
• Methods 7 and 8 are used for removing the item of the choice component either based on its
name or on its index (position).
• Method 9 is used for removing all the items of choice components.
• Methods 10 and 11 are used for registering and unregistering the events of choice components

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 comments:

Post a Comment

 

© 2013 Java Tutorials. All rights resevered. Designed by Templateism

Back To Top