I want to create a JTable with few columns which has JButtons on it. I can create JCheckBoxes and also JComboBoxes in the JTable cells but not the JButtons. How do i do this ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In my project, this is how I did it for a 4-row table with 3 columns where the first column has
JToggleButtonin every row:The necessary objects…
and under the code where we create the table…
JToggleButtonRenderer.java
As you can see, the important part is the table model,
table1ModelTo add a new row…
edited:
Added missing JToggleButton cell renderer