import java.awt.*; import javax.swing.*; class MiniJFrame { public static void main (String[] u) { JFrame frame = new JFrame(); // create JFrame-object frame.setSize(300,200); frame.setLocation(500,400); // location on computer screen JLabel label = new JLabel("Lilla My"); label.setBackground(Color.pink); label.setOpaque(true); // otherwise the JLabel-object is transparent, // and the pink colour unvisible frame.add(label); frame.setVisible(true); // to make the JFrame-object appear on the screen frame.pack(); // pack to minimal size (much smaller than 300x200) } }