In a bit of a panic. Been working on a project for the past two months. I changed a few of the box sizes a couple of days ago and saved it. Reloaded it this morning and the window size has gone stupidly small and I get the error:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: javax.swing.JButton[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.synth.SynthBorder@ce623f,flags=288,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Search,defaultCapable=true] is not attached to a horizontal group
Any ideas??!?!?!?!
The error message says it all. You have a certain component (a
JButton) which you have added to a vertical group but forgot to add it to a horizontal group as well in yourGroupLayout. See the How to useGroupLayoutpart of theLayoutManagertutorial and the corresponding sample codeIf you would remove the
addComponent(c3)part from the first line you would receive a similar exception.Of course, without seeing your code I cannot pinpoint where exactly in your project you messed up, but a decent VCS-based diff tool to compare between those 2 versions should reveal this pretty quickly