| setOpaque Usage | ||
|---|---|---|
| setOpaque(?) | call super.paintComponent
in paintComponent? |
Meaning |
| false | There is no point in doing this. | |
| false | You will paint only some of the pixels or use some transparent pixels to deliberately let what is painted underneath show through. | |
| true | You paint every pixel of the region, with no transparent pixels, and you want Swing to clear the region to the background colour for you automatically. | |
| true | You paint every pixel of the region, with no transparent pixels, and you will clear the background as needed with clearRect yourself in your paintComponent method. | |
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.
![]() |
and suggestions to improve this page to Roedy Green : | ||
| Canadian Mind Products | |||
| mindprod.com IP:[65.110.21.43] | |||
| Your face IP:[38.103.63.16] | ![]() | ||
| You are visitor number 9,779. | |||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/Mindprod website mirror) | ||
| http://mindprod.com/jgloss/opaque.html | J:\mindprod\jgloss\opaque.html | ||