Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code explanation sort. 1

Status
Not open for further replies.

JProg

Programmer
Apr 4, 2002
88
JP
Dear Everyone,

I am using some really neat code to listen to a group of JComboBoxes.

The four JComboBoxes in question sit on a JFrame and each of the boxes presents the program user with ten numberical choices, namely 0-9.

The Listener method for one of the JComboBoxes, named Millennia is shown below:

Millennia.addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent e){
Millenniaxx = Millennia.getSelectedIndex();
}});

If anybody can explain to me what the above code does it would be greatly appreciated.

Thanks
 
This is called an anonymous class. Do a search for anonymous classes and you will find plenty of information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top