0

I'd like to be able to add a row into the middle of a JTable that acts as an information or title bar for the data below it. I'd like to do this multiple times within the JTable. Perfect example would be to show a row with the date of all the following entries. I've searched over API and can't seem to find a solution. Thanks!

I'm looking for the following which was found here JTable with varying number of columns per row

However, I'd like the section title row to be fixed when scrolling horizontally


A1 Section Title Row With long Text  (FIXED WHEN SCROLLING HORIZONTALLY)
A2          B2          C2          D2
A3          B3          C3          D3
A4          B4          C4          D4
A5 Section Title Row With long Text (FIXED WHEN SCROLLING HORIZONTALLY)
A6          B6          C6          D6
A7 Section Title Row With long Text  (FIXED WHEN SCROLLING HORIZONTALLY)
A8          B8          C8          D8
A9          B9          C9          D9
oscar
  • 3
  • 3
  • *Perfect example would be to show a row with the date of all the following entries.* - Perfect example would be for you to give us an ascii representation of how you expect the data to be displayed. A JTable is designed to display rows of data. Each row should contain the same type of data and the same number of columns. – camickr May 11 '20 at 14:10
  • I updated question to be more clear.Thanks – oscar May 12 '20 at 03:04
  • Maybe something like this: https://stackoverflow.com/questions/21856733/how-to-merge-cell-in-defaulttablemodel-jtable/21977825#21977825 – camickr May 12 '20 at 03:56
  • A JTable is not a spreadsheet. You might be able to get something like what you want with a component sometimes referred to as an accordion. – Gilbert Le Blanc May 12 '20 at 04:20
  • camickr... that unfortunately wont allow the data in the information to stay put when user scrolls horizontally – oscar May 12 '20 at 07:14
  • Instead of making the information bar a separate row, Can I put an information label between rows somehow? – oscar May 19 '20 at 15:08

0 Answers0