jLabel and jTable conflict

36 Views Asked by At

Whenever I add the table under the labels there arises a padding of some sort, I want to make the labels to be equally aligned with table.

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

Any ideas how to align them equally?

0

There are 0 best solutions below