Jump to content

Problem adding JPanels to a box layout

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
johnsonk

johnsonk

    Newbie

  • Members
  • PipPip
  • 17 posts
//The BoxLayout JPanel
paymentdetailsPanel = new JPanel();
paymentdetailsPanel.setLayout(new BoxLayout(paymentdetailsPanel, BoxLayout.Y_AXIS));

I'm finding that when I add JPanels to paymentdetailsPanel , it creates a big gap between them, I think it may be to do with some panels having a flow layout?

Please provide some feedback on this

Kyle

#2
kishkabear

kishkabear

    Newbie

  • Members
  • Pip
  • 5 posts
try searching for HGap and VGap in the Layout objects (FlowLayout, BoxLayout, BorderLayout, etc)... these can be set and provide variant on the gaps between panels you add.