JSeparator « Layout « Java Swing Q&A





1. JSeparator wont show with GridBagLayout    stackoverflow.com

I want to add a vertical JSeparator between two components using a GridBagLayout. The code I have is as follows:

public MainWindowBody(){
    setLayout(new GridBagLayout());

    JPanel leftPanel ...

2. Vertical JSeparator incorrectly positioned by GridBagLayout    stackoverflow.com

Somewhat related to this question. I'm trying to create a window with two panels that have widths in the ratio 2:1 (with the left-side panel wider than the right-side one) and ...

4. JSeparator on a GridBagLayout    coderanch.com

Hello, This is my code: JTextPane colorLab1; JTextPane colorLab2; JLabel cleLab = new JLabel(); cleLab.setLayout(new GridBagLayout()); c = new GridBagConstraints(); c.insets = new Insets(0,0,0,0); c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 3; c.gridx = 0; c.gridy = 0; colorLab1 = new JTextPane (); colorLab1.setText("UneCle"); colorLab1.setOpaque(true); colorLab1.setBackground(Color.GRAY); colorLab1.setAutoscrolls(true); colorLab1.setEditable(false); colorLab1.setFont(font2); cleLab.add(colorLab1, c); c.gridy = 1; JSeparator js = new JSeparator(); c.fill ...