aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Example code of JFrame with a line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Example code of JFrame with a line" Watch "Example code of JFrame with a line" New topic
Author

Example code of JFrame with a line

john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

I am trying to learn Java 2D. I need an example to get me started. Could someone provide me a working example of a JFrame with a line. This is all i need. I have looked at many tutorials and am trying to get started.
Thanks,
cc11rocks


“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2203
    
    7
Start with the Custom Painting section from the Swing tutorial. Read the Graphics API to find the method that is used to draw a line.
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

Thank you very much!
Thank you,
cc11rocks
 
wood burning stoves
 
subject: Example code of JFrame with a line