I'd like to create a JTable with a UI similar to this:
where the "+" and "-" indicate buttons that add or remove the associated row or column. To ensure that the buttons align well with the existing rows and columns, it seems easiest to extend the table beyond the data portion to also include the buttons. So, the table above would have 5 rows and 6 columns.
Questions:
- Can I place buttons above the column headers in a JTable?
- My understanding is that I can't remove the cell borders for the buttons and blank cells (see here) at the cell level. Then, are there alternative ways to make the buttons align with the columns or rows?
- Are there similar UI styles you've seen or used that permit the desired behavior? Any libraries? I know this can be accomplished with, e.g., a combo box for choosing a particular row or column to be deleted. However, I'd prefer styles where the option to add/remove a row/column is placed immediately next to the row/column.
Thanks for your help.