• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Issue regarding Glass Pane

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Craig for your quick reply ,

But i want to ask you is it possible to set glasspane on panel ?
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry , Dispatch event method is not working (means i can't dispatch event to scrollbar) .
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic