posted 16 years ago
> but things seem differnt in swing drawing..
not really.
you have a JPanel with paintComponent(), but you don't add it to anything.
the panel you add to the frame is a separate panel
JPanel panel = new JPanel();
c.add(panel);
even adding the correct panel to the frame won't do anything because
you changed the frame's layout to FlowLayout, meaning the panel with
the graphics, without a component or a preferredSize(), will be sized to 0,0.
leave the frame as a default BorderLayout and the panel will take up all the size 800,600
try these couple of changes