Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transparent Label 1

Status
Not open for further replies.

daniel87dec

Technical User
Jan 7, 2004
9
CA
Can somebody please tell me how to create a transparent label.

Thank you in advance!
 
JLabel is colourless and transparent by default, so you can see the text in JLabel without background colour.
myJLabel.setOpaque(true);
MyJLabel.setBackground(Color.yellow);
This will make the myJLabel become yellow in background colour

myJLabel.setOpaque(false);
will myJLabel become transparent

myJLabel.setForeground(Color.blue);
If the color of text of the myJLabel is equals to the place(e.g. JPanel)where the myJLabel is placed and myJLabel.setOpaque(false), the JLabel seems to be transparent.
 
How do you create a button with a picture in AWT?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top