After creating 2nd Canvas, the 1st Canvas has no response to any mouse event
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ady_Wang
Posted On:   Tuesday, January 4, 2005 09:36 AM

Hi, all. I have a problem with my JInternalFrame application. A javax.swing.JToolbar and a java.awt.Canvas is attached to each JInternalFrame. Once such an internal frame is created, I can draw some lines and dots on the Canvas. However, when a 2nd intenral frame is created, I can only draw lines/dots on the 2nd internal frame, the objects that has been drawn on the 1st internal frame remains there, but I can't draw any more on the 1st frame. The weird thing is that both JToolbars inside two JInternal frams works fine. I can swtich back and forward to click on the Toolbar icons and throw some actions. Just the canvas doesn't work. Can anyone give me some hint on how to solve this? I will appreciate very much!    More>>

Hi, all.

I have a problem with my JInternalFrame application.

A javax.swing.JToolbar and a java.awt.Canvas is attached to each JInternalFrame. Once such an internal frame is created, I can draw some lines and dots on the Canvas. However, when a 2nd intenral frame is created, I can only draw lines/dots on the 2nd internal frame, the objects that has been drawn on the 1st internal frame remains there, but I can't draw any more on the 1st frame.

The weird thing is that both JToolbars inside two JInternal frams works fine. I can swtich back and forward to click on the Toolbar icons and throw some actions. Just the canvas doesn't work.

Can anyone give me some hint on how to solve this? I will appreciate very much!

I know I shouldn't have mixed Canvas with JInternalFrame, but I can't afford changing the Canvas to JPanel. I have done too much on my Canvas class.

I think it's something wrong with the event handling But I don't know how to solve it.

Can anyone please teach me how to handle the event handling among swing JInternalFrame and awt.Canvas?

Thanks a lot!!!

   <<Less
About | Sitemap | Contact