我怎么能填补我的GridLayoutmanager面板

问题描述 投票:0回答:1

首先看一下https://imgur.com/a/1r6sK31

我有一个项目,我想告诉一个表的一些数据。它显示的数据,但面板不垂直和水平填充。我使用com.intellij.uiDesigner.core的GridLayoutManager

thats how it looks right now

该表有自己的面板和阶级那里得到的数据表格下面的类只是一个与所有按钮(所以我不需要重写类所有的时间)和面板表,它应该充满基类,并在我想添加的tableView并在应补充面板填充它的MAINVIEW。查看第一图片

编辑:我添加的所有面板与mainPanel.add(panelToAdd,new GridConstraints());

intellij-idea gridlayoutmanager
1个回答
0
投票

我发现一个可行的解决方案。您需要添加GridConstraints并设置布局管理这些JPanels

GridConstraints constraints = new GridConstraints();
constraints.setFill(GridConstraints.FILL_BOTH);
this.setLayout(new GridLayoutManager(1,1));

this.add(mainPanel, constraints);
© www.soinside.com 2019 - 2024. All rights reserved.