javaswingjtablejpaneljscrollpane

Java table in table with auto resize


I want to make a table which can contain small tables and supports resize.

enter image description here

My solution use a JScrollpane which contains the table and the gridbaglayout contains the row which is a JPanel and this row JPanel contains JLabels and ETable (flowlayout).

How I can solve the resize problem? When I resize the window the column align automatically with the window.

enter image description here

The columns are not aligned correctly in the big table.


Solution

    1. I see there J(X)TreeTable or Outline with Custom Look and Feel (Renderer talking about Nimbus L&F, because isn't there correctly used background for Boolean value)

    2. put JComponents (from top) top the JPanel and there use GridBagLayout

    3. put JScrollPane with J(X)TreeTable or Outline put to the Center area

    4. please which type of TreeTable is there used ??? (for calculating PreferredSize of Columns)

    EDIT

    In this case replace the table with a black box. It's not relevant.

    JFrame has implemented BorderLayout in the API, then