hi im implimenting a gui applicaion so i have a list of shapes =>array of objects
and i want to select a shape from the list im stuck in implimenting the listener class
how do i know the selected object that is in my list it wont work with me
this is part of the code....
private JList list;
private shape []shapesList= {new line(),new rectangle(),new oval()};
private JLabel l1;
private JComboBox bx1;
private String[] clr={"red","yellow","green","blue","black"};
private int selctIndex1,selectedIndx1;//will contain the index of the index (list,combo box)
private class listHandler implements ListSelectionListener
{
public void valueChanged(ListSelectionEvent ev)
{
if(ev.getSource()==shapesList[0])
{
//im stuck here how to do it
System.out.println("yubeeeeeee");
}
}
}