0

Is there a way to show the split view button on my Frame in El Capitan? Currently, I just get the "+" (maximize) button, but I'd like my application to be compatible with split view.

It's easy to reproduce with any Frame.

public class Test {
    public static void main(String [] args)
    {
        JFrame frame = new JFrame();
        JPanel pane = new JPanel();
        pane.add(new JLabel("Hello World!"));
        frame.setContentPane(pane);
        frame.pack();
        frame.setVisible(true);
    }
}
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
Amber
  • 2,413
  • 1
  • 15
  • 20

2 Answers2

2

As shown here, you can enable the full-screen button to get the effect you want.

image

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
1

Based on what you have mentioned, it appears you are looking to split the pane into two. I have tested this on Mac and it works. Can you check if this is what you are looking for?

package swingex;

import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSplitPane;

public class Test {
  public static void main(String [] args)
  {
    JPanel pane = new JPanel();
    JPanel pane2 = new JPanel();

    pane.add(new JLabel("First Panel"));
    pane2.add(new JLabel("Second Panel"));

    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, pane, pane2);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(150);

    Dimension minimumSize = new Dimension(100, 50);
    pane.setMinimumSize(minimumSize);
    pane2.setMinimumSize(minimumSize);

    splitPane.setPreferredSize(new Dimension(400, 200));

    JFrame frame = new JFrame("SplitPane example");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(splitPane);

    frame.pack();
    frame.setVisible(true);
  }
}
Suparna
  • 1,132
  • 1
  • 8
  • 20