javaswingnetbeansmatisse

Netbeans GUI: Matisse and component layout


I have a Swing application created in Netbeans using Matisse GUI builder. One of the panels I created looks like this:

enter image description here

I want to use this panel in two scenarios:

All this works quite well, but I am wondering about the textfield sizes when the buttons are disabled, as they do not all grow the same. Here you can see the panel in the two scenarios:

enter image description here

enter image description here

While I am pretty sure the correct settings can be done in the GUI builder I am not sure what I need to look at. Where do you edit such constraints as of where a component is anchored (left, right, top, down and whether it is the next sibling or the parent) and how it should move/grow upon resize? I just do not see the relevant buttons or menus in Netbeans/Matisse. Could it be that I just need to look at the correct use of Glue and fillers?

I am aware I could switch to other layout managers but like the optical effect of having a common baseline on the text.


Solution

  • Meanwhile I found some documentation in the Netbeans Tutorials.

    The secret is to tell Matisse how to align the components, and it cannot be done just by dragging and dropping or resizing them. So what I did was to select all the text fields (click them one by one while holding Ctrl), then press the now available "Align left in column" button. Finally I did the same with the buttons.

    enter image description here

    The result is what I expected to have. :-)

    enter image description here

    enter image description here