简体   繁体   中英

Java Swing display problem

I wrote a gui program in SWING but i have a strange problem. I have a frame, a panel, a menu and the components. I put all the components in the panel and then i add this and the menu to the frame.

When I run the program it shows up only a window with the menu but if i maximaze the window or just change a little the dimesions of the window while it's running all the components shows up!

Is this a bug or something?

重复的次数不够多:请使用LayoutManager!

What you're probably seeing is that components have not been laid out by your layout manager at first, which only happens when the frame is resized.

I suspect you will want to call frame.pack() after adding your components.....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM