|
-
July 31st, 2003, 02:32 PM
#1
Drawing on a Java JFrame
I need some help with drawing text or rectangles on a Java JFrame. How do you do it?
For an applet it is easy. You set your class to extend JApplet and then use the paint(Graphics g) method. The g object can be used to draw by casting it to a Graphics2D object.
I know you need to do something like getGraphics() to the object necessary to draw, but I can never seem to get it to work.
This is for a system that lets you input some values in to an applet, you click a button, and they should be plotted in a seperate JFrame. I have it working except for the plotting part, and to do this I need to be able to draw on a JFrame.
Thanks a lot!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|