0

I understand how to add rows to a Jtable, but I don't know how to add particular styles to certain cells within those rows I. E.

When I utilise the following code:

Example.insertRow(0, new Object[]{ "A", "B", "C", "D", "E" });

I would like to know how I could make text within cell "A" underlined, cell "B" bold and cell "C" a different colour for instance "blue".

I'm sure this is possible, I just don't know how.

  • 3
    Please read the JTable tutorial (Google can help you find this), and read up on table cell renderers. Also search this site as similar questions get answered weekley. – Hovercraft Full Of Eels Feb 12 '14 at 03:47
  • 3
    Adding on the above comment, Oracle [tutorials](http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#editrender) are a great place to look – Paul Samsotha Feb 12 '14 at 03:53
  • 2
    You can use some HTML in a custom `TableCellRenderer`, seen [here](http://stackoverflow.com/a/17164751/230513). – trashgod Feb 12 '14 at 09:59

0 Answers0