jLabel和jTable冲突

时间:2015-06-16 15:06:10

标签: java swing awt

每当我在标签下面添加表格时,会出现某种填充,我想让标签与表格一致。

JPanel availablePackages = new JPanel();
availablePackages.setLayout(new BoxLayout(availablePackages, BoxLayout.Y_AXIS));
JLabel availablePackagesTitle = new JLabel("Availablee Packages");
availablePackagesTitle.setFont(availablePackagesTitle.getFont().deriveFont(16f));
JLabel availablePackagesContent = new JLabel("<html>Below is a summary of availabal packages. Please choose at least one package to proceed</html>");
availablePackages.add(availablePackagesTitle);
availablePackages.add(availablePackagesContent);
JTable table = new JTable(model)
JScrollPane scrollPane = new JScrollPane(table);
availablePackages.add(scrollPane);

enter image description here

任何想法如何平等对齐?

0 个答案:

没有答案