Java Glossary : opaque

CMP home Java glossary home Menu no menu Last updated 2004-06-28 by Roedy Green ©1996-2004 Canadian Mind Products

Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

You are here : home : Java Glossary : O words : opaque.

opaque
In Swing, you can do a JComponent.setOpaque( true ) to notify everyone that when your component paints, it covers the entire region with no background showing through, so there is no need for Swing to clear the background before calling your paintComponent method. This replaces the AwT update/paint mechanism.

The symptom of failing to call setOpaque( true ) is flicker, where the image gets repeatedly repainted to the background colour. The symptom of calling setOpaque( true ), when you should not are artifacts -- little bits of left over painting from other work in where your component should be. These are areas you did not paint, which should have been background.

If in your TableCellRenderer you create your own JLabels to return, rather than using the one from DefaultTableCellRenderer, make sure you call JLabel.setOpaque( true ) or else your JLabel.setBackground will be ignored.


CMP logo
CMP_home
home
Canadian Mind Products CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[24.87.56.253]
Your IP:[80.134.30.163]
You are visitor number 968.
Please send errors, omissions and suggestions
to improve this page to Roedy Green.
You can get a fresh copy of this page from: or possibly from your local J: drive mirror:
http://mindprod.com/jgloss/opaque.html J:\mindprod\jgloss\opaque.html