I’m coding a simple application with DB connections and one of the components I’m using most is jInternalFrame inside a jDesktopPane.
After pressing a specific button (File > Connect) a jInternalFrame gets added inside the jDekstopPane and is automatically maximized to fit the entire desktop pane. The problem is that the jToolBar on the top of the internal frame gets resized (as you can see by clicking here).
Of course, if I de-maximize the internal frame the sizes of the components are correct (as seen here).
If it can be of help, this is the snippet of code I’m using to maximize the internal frame on its opening:
try {
this.setMaximum(true);
} catch (PropertyVetoException e) {
System.out.println("ERRORE!");
}
Edit: I also tried messing with the Layout Space but I’m not sure that’s the right spot to look for an answer.
>Solution :
You can set a preferred, minimum and maximum size for components. Just try setting the maximum size of your JToolBar with
.setMaximumSize(new Dimension(Integer.MAX_VALUE, desiredHeight))