IntelliJ Java IDE
The moose likes Swing / AWT / SWT / JFace and the fly likes JInternalFrames:  sharing a graphics context Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "JInternalFrames:  sharing a graphics context" Watch "JInternalFrames:  sharing a graphics context" New topic
Author

JInternalFrames: sharing a graphics context

Marie Henry
Greenhorn

Joined: Sep 06, 2001
Posts: 2
I am currently developing an application that uses many internal frames. On one of the frames, the user can draw shapes on by clicking on it (Sort of like a draw/paint program). However, when I switch back and forth between this internal frame and another one, the drawn shapes (drawn by using GeneralPath) appear to "jump" to a new location. I know that when you select a JInternalFrame it calls a repaint of the last selected one and then the newly selected one. I'm thinking it must somehow be confusing graphics and bounds. I'm figuring that the graphics context is being shared between all the frames since the object is sometimes drawn completely off the frame it should be on. Has anyone encountered this behavior before? Any suggestions?

Thanks is advance,
Marie
 
IntelliJ Java IDE
 
subject: JInternalFrames: sharing a graphics context
 
Threads others viewed
drawing on a JPanel without erasing the underlying drawings
Link internal frame to menu item
How does this code work
drawing lines between two internal frames on a desktop pane
Quick Question about Images
IntelliJ Java IDE