Java Help

Soldato
Joined
30 Nov 2005
Posts
3,084
Location
London
I need some help with a Java Novice,

What I have been trying to do for a few hours now is link a Button in a Java Apllet to draw a rectangles on the screen.

I have created a button which when pressed I would like to draw around 10 boxes in a specific area.

Thanks
 
Right ok,

In the
public void init()
{



I have added


squares = new Button("Squares");
add(squares);
squares.addActionListener(this);



How do I get the button to draw when clicked, I have become confused by the Tutorials and other information on the net.

I think its to do with the


public void paint(Graphics g)
{



and
public void actionPerformed(ActionEvent event)
{



But cant for the life of me work it out.
 
Back
Top Bottom