BoxLayout exception

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joseph

    BoxLayout exception

    I can't seem to determine why I receive this exceptio when executing the
    code below. I get a "BoxLayout can't be shared" exception whenever i
    execute. Any reasons and solutions is appreciated. Thanx in advance.


    public class test {
    JFrame myFrame;

    public test() {
    myFrame = new JFrame("Test");
    myFrame.getCont entPane().setLa yout(new
    BoxLayout(myFra me,BoxLayout.Y_ AXIS));
    myFrame.setDefa ultCloseOperati on(JFrame.EXIT_ ON_CLOSE);
    myFrame.pack();
    myFrame.setVisi ble(true);
    }

    public static void main(String[] args) {
    test mine = new test();
    }
    }


  • mromarkhan@rogers.com

    #2
    Re: BoxLayout exception

    If you have the time try changing it to this:
    myFrame.getCont entPane().setLa yout(new
    BoxLayout(myFra me.getContentPa ne(),BoxLayout. Y_AXIS));

    Comment

    Working...