Possible Duplicate:
Java swing Table transparency
It is not so easy to make a JTable background transparent. I want to see only the text content of my cells.
opacity: . 0; in different combinations in the script i.e. after each line of code for the colour or only certain ones but not others but the whole table and the text go completely transparent and not just the background colour.
The table will be transparent if neither itself nor the cells are opaque:
table.setOpaque(false);
((DefaultTableCellRenderer)table.getDefaultRenderer(Object.class)).setOpaque(false);
If the table is in a ScrollPane
, it is to make transparent as well:
scrollPane.setOpaque(false);
scrollPane.getViewport().setOpaque(false);
At least, you can remove the grid lines:
table.setShowGrid(false);
Quite a big work for a simply result...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With