Solved

Java - Transparent JScrollPane

Posted on 2010-08-18
7
853 Views
Last Modified: 2012-06-21
I have a JTextArea and it's riding ontop of a JScrollPane. Anyways, I know I can use the `getViewPort()` method to set the opaque of of the view port... but I cannot seem to find any sign of how to do that... anywhere. :S

Here is what I have so far:
     if (e.getKeyCode() == KeyEvent.VK_F)
    {
    	if (sp.isVisible())
    	{
    		sp.setVisible(false);
    	}
    	else
    	{
    		sp.setVisible(true);
    	}
    }

Open in new window

0
Comment
Question by:UrbanTwitch
  • 4
  • 3
7 Comments
 
LVL 92

Expert Comment

by:objects
ID: 33470956
what is it you want to achieve?
0
 
LVL 5

Author Comment

by:UrbanTwitch
ID: 33470973
Make the JTextArea transparent ... like 50%? make it see through.
0
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 33471017
textarea.setOpaque(false);
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 5

Author Comment

by:UrbanTwitch
ID: 33471125
That clears it ALL THE way off. Can't I have it 50% see through? like.. opacity?
0
 
LVL 5

Author Comment

by:UrbanTwitch
ID: 33471132
Maybe I can set the background of a JScrollPane to a .gif image which is 50% transparent?
0
 
LVL 92

Expert Comment

by:objects
ID: 33471154
try this:

textarea.setBackground(new Color(r,g, b, 127));
0
 
LVL 5

Author Comment

by:UrbanTwitch
ID: 33471168
I'm guessing r,g,b is an int ... should be like:
c.setBackground(new Color(255,255,255, 127));
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question