PROGRAM:
~~~~~~~~~~~
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class JCombo extends JApplet implements ItemListener
{
public void init()
{
String country[]={"India","Pakistan","Austrailia","Europe","SouthAfrica"};
setLayout(new FlowLayout());
JLabel jl=new JLabel("SELECT CONTRY");
JComboBox jcb=new JComboBox(country);
jcb.addItemListener(this);
add(jl);
add(jcb);
}
public void itemStateChanged(ItemEvent ie)
{
}
}
~~~~~~~~~~~
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class JCombo extends JApplet implements ItemListener
{
public void init()
{
String country[]={"India","Pakistan","Austrailia","Europe","SouthAfrica"};
setLayout(new FlowLayout());
JLabel jl=new JLabel("SELECT CONTRY");
JComboBox jcb=new JComboBox(country);
jcb.addItemListener(this);
add(jl);
add(jcb);
}
public void itemStateChanged(ItemEvent ie)
{
}
}
No comments:
Post a Comment