[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Java - Transparent JScrollPane

Posted on 2010-08-18
7
Medium Priority
?
879 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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

649 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