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
⌛
This post has been reserved for your question.
Hey @Ferra! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
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.
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💤
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.