aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes fillRect method, can't call it properly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "fillRect method, can Watch "fillRect method, can New topic
Author

fillRect method, can't call it properly

Erjan Kenjegalee
Greenhorn

Joined: Apr 19, 2010
Posts: 22

i m writing a java applet that accepts 4 parameters to draw a rectangle - x, y, width, height

my problem is, i don't know how to call it in another method - square of asterisks,

it needs a variable Graphics g to be supplied, but i don't know where to give this "g" variable!



here is the problem, how to initialize Graphics g variable?

Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

it needs a variable Graphics g to be supplied, but i don't know where to give this "g" variable!

By calling that method from an appropriate painting method override. Here's where to learn more about that: Performing Custom Painting

Edit: Moving this thread to the GUIs section.


luck, db
There are no new questions, but there may be new answers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: fillRect method, can't call it properly