Creating glasspane?

Please check out my answer to some other question where I present a way in which a glass pane can be used to simulated dialog behaviour. There you have shown how to show it and hide it on mouse click in my case right mouse click. This example should get you started nicely.

Your example help me start. Thank you :) – edi233 May 13 at 10:36 @edi233 Pleasure to help. Enjoy.

:) – Boro May 13 at 10:37.

I see no problem creating a glasspane and attaching it to a RootPaneContainer from inside moussePressed() method. However, I may wonder why create a new glass pane every time the user clicks the mouse; that wouldn't be very performant; it is probably wiser to create and attach a glass pane up front and then change its content during mouse click). Now, regarding "painting on the glass pane", it depends on what you mean by "painting", if this means using a "Graphics" instance to directly draw on the glass pane, the answer is NO (well, actually you could but, your painting would disappear at first UI refresh...) Such painting must occur in paintComponent() method of your glass pane (that you must override).

I want using a Graphics2D to draw rectangle on glass pane using mouseDragged. My idea is: 1) I click mouse button and my glass pane is visible. 2) I use mouse dragged to draw rectangle.3) When I release mouse button my glass pane disapear.

I want drawing rectangle in real time and change his size using mousedragged – edi233 May 13 at 10:32 Then you have to record mouse coordinates during mouseDragged and force a repaint() of the pane. You still need to override paintComponent(). – jfpoilpret May 13 at 11:21.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions