sunexcedent
2011-03-01 12:57:43 UTC
public class dots extends JComponent
{
private int pwidth = 400;
private int pheight = 500;
Graphics dbg = new Graphics();
public dots()
{
draw(dbg);
}
public void draw(Graphics g)
{
g.setColor(Color.WHITE);
g.fillRect(0,0, pwidth, pheight);
g.fillOval(50,50, 25, 25);
}
}
and here's the class to run it:
public class dotshower extends JPanel
{
public static void main (String args[])
{
dots dotter = new dots();
JPanel p = new JPanel();
p.add(dotter);
}
}
Any help on solving this issue / helping me understand what I'm doing wrong is greatly appreciated. I've tried so many different things and nothing seems to be working.