wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Variable transparency cover for Swing layout. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Variable transparency cover for Swing layout." Watch "Variable transparency cover for Swing layout." New topic
Author

Variable transparency cover for Swing layout.

Chris Kimball
Ranch Hand

Joined: Apr 23, 2012
Posts: 32

I'd like to put a jpg graphic of variable transparency over an operable Swing layout.

The Swing tutorials demonstrate graphics with variable transparency within the Graphic, however, the Swing components are outside the graphic. Another example on the web positions an opaque Swing panel over the top of a graphic. But what I'd like is to have the jpg cover the graphic completely at one end of the slider, while at the other end, only the Swing component are visible.

Suggestions would be appreciated.

Chris
m Korbel
Ranch Hand

Joined: Jun 19, 2012
Posts: 155
there aer three ways

1. JLayer (Java7) based on JXLayer(Java6)

2. GlassPane (only for lightweight Swing JComponents otherwise is Glasspane behind heavyweight JComponent)

3. JViewport (notice with JViewport.BLIT_SCROLL_MODE, JViewport.BACKINGSTORE_SCROLL_MODE, JViewport.SIMPLE_SCROLL_MODE to avoiding flickering)
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> But what I'd like is to have the jpg cover the graphic completely at one end of the slider, while at the other end, only the Swing component are visible.

perhaps an OverlayLayout might work
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Variable transparency cover for Swing layout.