0

I want to insert lines and buttons to jtable while clicking on the button add using netbeans, I used JScrollPane but with only 4 buttons.How can I create a jtable with lines that contain are buttons in the last columns.

Many thanks.

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
  • Take a look at [How to use tables](http://docs.oracle.com/javase/tutorial/uiswing/components/table.html). You're going to need to provide a custom cell renderer and possibly a cell editor, depending on your needs. For [example](http://stackoverflow.com/questions/17565169/unable-to-add-two-buttons-in-a-single-cell-in-a-jtable/17565826#17565826) – MadProgrammer Jan 02 '14 at 21:47

1 Answers1

1

How can I create a jtable with lines that contain are buttons in the last columns.

You need to add a column in the TableModel to display on the button. Then you need to use a custom renderer and editor for that column.

Check out Table Button Column for and class you can use.

camickr
  • 321,443
  • 19
  • 166
  • 288