I have a JFrame named
frame
If i use the default layout(BorderLayout) or FlowLayout then the below code,
does not throw errors.
But if i use BoxLayout, then the below code
throws an exception at runtime:
java.awt.AWTError: BoxLayout can't be shared
I re-wrote the code as below and it worked.
So why is that other layout managers work directly with JFrame but
BoxLayout works only with JFrame.getContentPane() ?