每当我在标签下面添加表格时,会出现某种填充,我想让标签与表格一致。
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);
任何想法如何平等对齐?