aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JScrollPane 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 "JScrollPane" Watch "JScrollPane" New topic
Author

JScrollPane

cardwell cupp
Ranch Hand

Joined: Aug 16, 2001
Posts: 66
Is there a transparent version of the JScrollPanel?
I have been using components (i.e. JTextArea, JLabel...)
they can be made transparent by using setOpaque(false). It wont working on a JScrollPanel, any suggestions?
Thanks all
Cardwell
cardwell cupp
Ranch Hand

Joined: Aug 16, 2001
Posts: 66
Just for everyone's info...JScrollPane is lightweight and can be set transparent by setOpaque(false), but you must also set the veiw port to opaque! scrollpane.getViewport().setOpaque(false)...
Cardwell
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I have set other componets to opaque(false) and I never see a change. What do you mean by transparent. Can you see through the JFrame or JButton or whatever? Like I said, I never notice a diffrence in the components.

------------------
Happy Coding,
Gregg Bolinger


GenRocket - Experts at Building Test Data
cardwell cupp
Ranch Hand

Joined: Aug 16, 2001
Posts: 66
When using most swing components, you can make them transparent in that you can see the component that they are on top of's back ground. For example, I place an image on a Frame, I then place a JScrollPane on top of it, if I set the opaque as false, i then can see the image through it...Does that make since???
Greenest horn
Cardwell
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

That makes sense. thanks.

------------------
Happy Coding,
Gregg Bolinger
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JScrollPane