This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 154
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
 
 
subject: Variable transparency cover for Swing layout.
 
Similar Threads
Nice Round Title Bar Icons?
Best Swing Component For Icons
what is your favorite color?
java newbee guidance
Can I implement a transparent eraser in Java GUI?