so heres what i have
public class MyPanel extends JPanel { public MyPanel(){ setSize(100, 250); setLocation(0, 0); setOpaque(true); this.setForeground(new Color(100,100,100)); //setVisible(true); } public void paintComponents(Graphics g) { super.paintComponent(g); g.fillRect(3, 5,100, 100); } public static void main(String [] args) { JFrame f = new JFrame("Frame"); f.setSize(500, 500); f.setVisible(true); f.getContentPane().add(new MyPanel()); f.show(); } }
when i run it i get a blank JFrame screen.........is there something i missed or did wrong?