0
To give a table effect, you will have to create a class that will inherit the DefaultTableCellRenderer
and overwrite the method getTableCellRendererComponent
You can do as in the example below, in this it changes beyond the background, the edge and the source.
private class TableRowHeaderCellRenderer extends DefaultTableCellRenderer {
@Override
public Component getTableCellRendererComponent(
JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
setFont(new java.awt.Font("Arial Black", 0, 21 ));
setBorder(new SoftBevelBorder(SoftBevelBorder.RAISED));
setBackground(new Color(244, 242, 228));
setValue((String) value);
return this;
}
}
I closed it as a duplicate because that’s not possible with Jtextarea, as it says documentation. But in the linked answer is exemplified how to do the same thing with the appropriate component for this.
– user28595