import java.awt.*; 
import java.awt.event.*; 
import java.awt.geom.*; 
import javax.swing.*; 

public class LabelTestiSW extends JApplet { 
    protected String iconname1="bird.gif"; 
    ImageIcon icon1; 
    protected String iconname2="dog.gif"; 
    ImageIcon icon2; 
    protected JLabel j1,j2,j3;  
    public LabelTestiSW()  
    { 
        getRootPane().putClientProperty("defeatSystemEventQueueCheck", 
        Boolean.TRUE); 
    } 
    public void init()  
    {  
       icon1=new ImageIcon(iconname1); 
       icon2=new ImageIcon(iconname2); 
       j1 = new JLabel(icon1); 
       j2 = new JLabel("Label yazisi",icon2,JLabel.CENTER); 
       j2.setVerticalTextPosition(JLabel.BOTTOM); 
       j2.setHorizontalTextPosition(JLabel.CENTER); 
       j3 = new JLabel("Font 16 mavi Label"); 
       Font font=j3.getFont(); 
       j3.setFont(new Font(font.getName(),Font.BOLD,16));  
       j3.setForeground(Color.blue); 
       JPanel pane=new JPanel(); 
       JPanel pane1=new JPanel(); 
       JPanel pane2=new JPanel(); 
       pane1.add(j1); 
       pane1.add(j2); 
       pane1.add(j3); 
       pane1.setBackground(new Color(255,255,204)); 
       pane1.setForeground(Color.black); 
       pane1.setBorder(BorderFactory.createMatteBorder(1,1,2,2,Color.black)); 
       pane.setLayout(new BorderLayout()); 
       pane.add(pane1,BorderLayout.NORTH);  
       setContentPane(pane);  
    } 
    public static void main(String s[]) { 
        JFrame f = new JFrame("Label testi "); 
        f.addWindowListener(new WindowAdapter() { 
            public void windowClosing(WindowEvent e) {System.exit(0);} 
        }); 
        JApplet applet = new LabelTestiSW(); 
        f.getContentPane().add("Center", applet); 
        applet.init(); 
        f.pack(); 
        f.setSize(new Dimension(550,200)); 
        f.show(); 
    } 
}
