I would like to create an interactive JTable. For this, I would like to add JPanels in the cells of the table. Once the JPanels are in the cells, I can add my various components to the JPanels thus making the table interactive. Each JPanel could have different components. Would it be possible to accomplish this and only have to create 1 table cell editor and 1 table cell tenderer. Does anyone know of a better way to do it?
Thanks
EDIT: Thanks for the responses. I actually already have a framework I am using. I just needed a JTable that users could drag and drop images in, play movies, display graphs, etc... I already have the functionality to do those things, I just needed a JPanel to add them too. I wanted it to be displayed in a JTable so the cells could be sorted, moved, add/delete rows/col, and well structured. I couldn't get it to work using the JTable, so I went ahead an created my own. Its just a JPanel that contains smaller JPanels (the table cells) using the GridLayout. It works well enough for my puposes. Just a pain to rewrite all of the functionality from scratch that a table has.
This is hard. JTable actually uses the cell renderers only for painting the cell content. I would recommend to check if a gridlayout packaged into a scrollpane would be the easier solution.
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