aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Issue regarding Glass Pane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Issue regarding Glass Pane" Watch "Issue regarding Glass Pane" New topic
Author

Issue regarding Glass Pane

Chandrashekhar Nathile
Greenhorn

Joined: Sep 22, 2006
Posts: 5
Hello Friends ,
I have an outer panel which includes panel & scrollpane ( scrollpane contains text area) what i want is whenever user click on that outer panel, i need to draw a vertical line on that outer panel & when user again click on that same line , that line will be deleted but along with this , scrolling of that scroll pane is also possible.

so what i think is to set glass pane on that outer panel & trap mouse event , so it works fine but in this case i don't have any controll on the scrolling of the scroll pane .

so what i need to do to handle both things (drawing a line & handeling scrolling) .


so please help me out , Thanks in advance .
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
See the second code snippet in The Glass Pane section of How to Use Root Panes for the technique of re–dispatching events to the component below the glass pane.
Chandrashekhar Nathile
Greenhorn

Joined: Sep 22, 2006
Posts: 5
Thanks Craig for your quick reply ,

But i want to ask you is it possible to set glasspane on panel ?
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
is it possible to set glasspane on panel
Strictly speaking, no. A glass pane is set on a JRootPane - see api.
There is another way. You can set a non–opaque JPanel over another JPanel with an OverlayLayout.
Chandrashekhar Nathile
Greenhorn

Joined: Sep 22, 2006
Posts: 5
Thanks Craig ,
According to your suggestion i have added another panel on same location with Opaque as False but now i want trap & dispatch event on JScrollpane when ever user click on scroll bar of JScrollpane so i used Dispatch Event Method but it is working ,
so please help me out .
Chandrashekhar Nathile
Greenhorn

Joined: Sep 22, 2006
Posts: 5
sorry , Dispatch event method is not working (means i can't dispatch event to scrollbar) .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issue regarding Glass Pane
 
Similar Threads
JScrollPane with multiple JEditorPanes
Which JScrollPane ?
How to add scrolling Functionality to a JButton?
How to let a scrollBar of one pane to control the other pane?
Need ScrollPane with just VERTICAL Scrolling facility