I want to make a program with a BorderLayout where the center and the east part is graphically separated. I tried the following, but unfortunately the separator is on the left side of the JFrame and not between the centerPanel and the rightPanel.
setLayout(new BorderLayout());
JPanel centerPanel = new JPanel();
JPanel rightPanel = new JPanel();
centerPanel.add(new JLabel("center"));
rightPanel.add(new JLabel("right"));
getContentPane().add(centerPanel, BorderLayout.CENTER);
getContentPane().add(rightPanel, BorderLayout.EAST);
getContentPane().add(new JSeparator(JSeparator.VERTICAL), BorderLayout.LINE_START);
Can someone please help me out?