how can button the java swing table?

i am trying to put a button inside a jswing table, so that the last slot runs some code how can i do that?
4 Replies
JavaBot
JavaBot7mo ago
This post has been reserved for your question.
Hey @Ferra! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Peter Rader
Peter Rader7mo ago
I would add the JButton as an Sibling to the JTable and use the LayoutManager to place it in the geometrical middle of the JTable.
Defective
Defective7mo ago
You'd have to create a custom TableCellRenderer (preferably by extending DefaultTableCellRenderer) to render your button inside the table. It will still be just visual, so you have to also manually handle user clicking on that button For an easier solution this should do though, depending on your current layout
JavaBot
JavaBot7mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?