Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating GridLines in Java Swing

Status
Not open for further replies.

URLJones

Programmer
Jun 14, 2004
42
CA
Hi. I've created an application using a JInternalFrame which sits on a JDesktopPane. Within the JInternalFrame, I have place a JScrollPane which holds a number of horizontaly thin panels 1200(width) x 30(height). What I'd like to do is place some vertical gridlines over these panels. What I have done so far is create a JPanel with vertical gridLines (using Java.awt.Graphics drawLine() method) and used this panel as a GlassPane for the JInternalFrame (ie, frame.setGlassPane(gridPanel); ). Now the problem is that when I resize the frame or minimize it, the gridLines dissappear. I used a ComponentListener for the window (for when you resize it) but it only "works" when the frame gets Maximized. When I say "works" I mean that the Gridline panel shows up, but it is opaque (so I can't see the panels in the scrollpane). oh, and yes, I have set the panel to opaque = false. So, right now I am stuck. I kinda need this application complete in about a week, and this is the only thing holding me back. I am contemplating using a JLayeredPane to overcome this, but I'm not sure if it will do what I want it to. Any help would be much appreciated.

Thanks,

URL
 
The JInterFrame in this example does not work for my JDK 1.4
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top