BoxLayout & Borders
Hi !
I'm trying to add a JPanel to a panel using BoxLayout. When I set a border to the subPanel, it deasapear ! Here is the code :
// Inside a class extending JPanel
privatevoid initComponents()
{
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
setBorder(BorderFactory.createEtchedBorder());
mandatoryPanel =new JPanel(new SpringLayout());
initMandatoryPanelComponents();
mandatoryPanel.setPreferredSize(new Dimension(700, 150));
mandatoryPanel.setMinimumSize(new Dimension(700, 150));
mandatoryPanel.setBorder(BorderFactory.createEtchedBorder());
add(mandatoryPanel);
}
When I comment the line where border is set, the panel is displayed correctly. Else, nothing is displayed.
Can anyone help me ?

