且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JPanel会填充所有JFrame空间

更新时间:2023-12-05 18:42:04

您必须使用适当的布局管理器.默认情况下,JFrame的BorderLayout.

You have to use the appropriate Layout Manager. A JFrame by default has a BorderLayout.

查看本教程的LayoutManagers:

Check out this tutorial for LayoutManagers:

http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html