setLayout(new BorderLayout());
setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
    private void initGUI() {        setLayout(new BorderLayout());        setBorder(BorderFactory.createLineBorder(Color.GRAY));        JPanel northPanel = new JPanel();        northPanel.setLayout(new BoxLayout(northPanel, BoxLayout.LINE_AXIS));        routeStopIcon = createImageIcon("icons/route_stop.png", "", this);        routeStartIcon = createImageIcon("icons/route_start.png", "", this);        nameLabel = new JLabel(route.getName());        iconLabel = new JLabel(routeStopIcon);        routingProgress =            new JProgressBar(SwingConstants.HORIZONTAL, 0, route                .getRouteItems().size());        routingProgress.setPreferredSize(new Dimension((int) routingProgress            .getPreferredSize().getWidth(), 8));        routingProgress.setBorder(BorderFactory.createEmptyBorder());        routingProgress.setBackground(Color.RED);        routingProgress.setForeground(Color.GREEN);        addMouseListener(new MouseAction());        northPanel.add(Box.createHorizontalStrut(5));        northPanel.add(nameLabel, BorderLayout.WEST);        northPanel.add(Box.createGlue());        northPanel.add(Box.createHorizontalStrut(5));        northPanel.add(iconLabel, BorderLayout.EAST);        northPanel.add(Box.createHorizontalStrut(5));        southPanel = new JPanel();        southPanel.add(routingProgress);        add(northPanel, BorderLayout.CENTER);        add(southPanel, BorderLayout.SOUTH);    }