1>public class JLabelDemo extends JApplet {
2> public void init() {
3> Container contentPane=getContentPane();
4> ImageIcon ii=new ImageIcon("USA.gif");
5> JLabel j1=new JLabel("USA",ii,JLabel.CENTER);
6>
7> contentPane.add(j1);
8> }
9>}
/**** Doubts*****************/
line 5 doubt: basically the constructor JLabel structure is JLabel(
String s,Icon i,int align)
it accepts Icon i ,but in line 5 it is accepting ii which is a ImageIcon class reference how come is it true??
and how come JLabel.CENTER returns a int?