import javax.swing.*; import java.awt.*; public class Pixel extends JApplet { JLabel l1; public void init() { System.out.println("Pixel"); getContentPane().setLayout(null); l1 = new JLabel("Pixel", JLabel.CENTER); l1.setBackground(Color.BLUE); l1.setSize(200, 100); l1.setLocation(50, 100); l1.setVisible(true); l1.setOpaque(true); add(l1); } }