Hi,
This is not random resizing - this is based on the GridBasedLayout specification that you have added. Substance adds a mouse listener to track rollover effects, and this listener validates the current selected tab as its first step. As you add text to the text area, its preferred size grows, and so all the other elements are repositioned.
Just add this after creating your tabbed pane (under the Metal or any other LAF):
jtp.addMouseMotionListener(new MouseAdapter() {
@Override
public void
mouseMoved(MouseEvent e) {
System.out.println(jtp.getUI().tabForCoordinate(jtp,
e.getX(), e.getY()));
}
});
You will see the same exact behavior - just calling the tabForCoordinate method on the UI delegate.
I would highly recommend not using GridBagLayout. FormLayout and MigLayout are much better alternatives for grid-based UIs.
Thanks
Kirill