File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Draw dotted Rect Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Draw dotted Rect" Watch "Draw dotted Rect" New topic
Author

Draw dotted Rect

Sarone Thach
Ranch Hand

Joined: Jun 25, 2003
Posts: 89
Hi there,
The Graphics class has a drawRect method. Does it have a method that will draw a rectangle but with dotted lines?
thanks,
Sarone
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Not Graphics, but Graphics2D does... As long as you're using any version of the JDK newer than 1.2 you can just cast the Graphics parameter of the paint() method to a Graphics2D object.



-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Sarone Thach
Ranch Hand

Joined: Jun 25, 2003
Posts: 89
Perfect! Thank you so much Nate.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Draw dotted Rect
 
Similar Threads
Drawing dotted/dashed lines in a scaled JPanel?
Rational XDE - create stereotype ?
how do i draw a dotted straight line on an applet.
Draw Rectangle dotted line the selected Image area
Drawing a rectangular box