Reputation: 6797
How could I put a JPanel
into a cell of a JTable
?
(There would be a column what would contain String
objects, and an other column with JPanel
objects. )
Upvotes: 2
Views: 6996
Reputation: 61
Actually you can do that by adding an editor to the data type that the panel covers
Upvotes: 0
Reputation: 290
http://download.oracle.com/javase/tutorial/uiswing/components/table.html#renderer
Read the part that talks about using Custom Renderers. The ColorRenderer example puts a JLabel in a cell. You could easily change that to use a JLabel instead.
Upvotes: 1