hey i select any image from combobox.. the label should updated to display that image.. i tried this code. I am not getting through.,
Just see dis.. please help me... reply fast.. its urgent..
import java.awt.*;
import java.awt.event.ItemEvent;
import javax.swing.*;
public class x extends JFrame
{
JLabel l;
ImageIcon lh0, lh1;
public void init()
{
Container c= getContentPane();
c.setLayout(new FlowLayout());
JComboBox jc= new JComboBox();
jc.addItem("lh0");
jc.addItem("lh1");
c.add(jc);
l= new JLabel (new ImageIcon("lh0.gif"));
c.add(l);
}
public void itemstatechanged(ItemEvent ie)
{
String s=(String)ie.getItem();
l.setIcon(new ImageIcon(s+".gif"));
}
}