Solved

Java - Transparent JScrollPane

Posted on 2010-08-18
7
860 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

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…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This video teaches viewers about errors in exception handling.

728 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