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) .
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.
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 .