java - boxLayout cant be shared -


have java jframe class, in want use boxlayout, error saying java.awt.awterror: boxlayout can't shared

here code

public class securechat {      private jframe myframe;      private int width;     private int height;      private jpanel allpanel;     private jpanel titlepanel;     private jpanel holdpanel;     private jpanel serverpanel;     private jpanel portpanel;     private jpanel encryppanel;     private jpanel decryppanel;       public static void main(string[] args) {         securechat s = new securechat();     }      public securechat()     {         width = 600;         height = 480;         myframe = new jframe();         myframe.setlocation(450, 200);         myframe.settitle("secure chat");         myframe.setdefaultcloseoperation(jframe.exit_on_close);         myframe.setsize(width, height);          allpanel = new jpanel();         myframe.add(allpanel);         allpanel.setlayout(new boxlayout(allpanel, boxlayout.y_axis));         allpanel.setbackground(color.blue);          titlepanel = new jpanel();         allpanel.add(titlepanel);         titlepanel.setlayout(new boxlayout(titlepanel, boxlayout.x_axis));          holdpanel = new jpanel();         allpanel.add(holdpanel);         holdpanel.setlayout(new boxlayout(holdpanel, boxlayout.x_axis));     } } 

any apreciated


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -