import java.awt.*;
import javax.swing.*;
//<applet code=tarlayered.class width=300 height=350></applet>
public class tarlayered extends JApplet
{
JLabel labels[];
public void init()
{
Container cp=getContentPane();
cp.setLayout(null);
labels=new JLabel[6];
labels[0]=new JLabel("Label 0");
labels[0].setOpaque(false);
labels[0].setBorder(BorderFactory.createEtchedBorder());
cp.add(labels[0]);
labels[1]=new JLabel("Label 1");
// labels[1].setOpaque(true);
labels[1].setBorder(BorderFactory.createEtchedBorder());
cp.add(labels[1]);
labels[2]=new JLabel("Label 2");
// labels[2].setOpaque(true);
labels[2].setBorder(BorderFactory.createEtchedBorder());
cp.add(labels[2]);
labels[3]=new JLabel("Label 3");
// labels[3].setOpaque(true);
labels[3].setBorder(BorderFactory.createEtchedBorder());
cp.add(labels[3]);
labels[4]=new JLabel("Label 4");
labels[4].setOpaque(false);
labels[4].setBorder(BorderFactory.createEtchedBorder());
cp.add(labels[4]);
labels[5]=new JLabel("Label 5");
// labels[5].setOpaque(true);
labels[5].setBorder(BorderFactory.createEtchedBorder());
cp.add(labels[5]);
for(int i=0;i<6;i++){
labels[i].setBounds(40*i,40*i,100,60);
}
}
}
No comments:
Post a Comment