List of usage examples for javax.swing JSplitPane getMaximumDividerLocation
@BeanProperty(bound = false) public int getMaximumDividerLocation()
From source file:net.sourceforge.pmd.util.designer.Designer.java
public Designer(String[] args) { if (args.length > 0) { exitOnClose = !args[0].equals("-noexitonclose"); }/* ww w . j a v a2s.com*/ Initializer.initialize(); xpathQueryArea.setFont(new Font("Verdana", Font.PLAIN, 16)); JSplitPane controlSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, createCodeEditorPanel(), createXPathQueryPanel()); JSplitPane astAndSymbolTablePane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, createASTPanel(), createSymbolTableResultPanel()); JSplitPane resultsSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, astAndSymbolTablePane, createXPathResultPanel()); JTabbedPane tabbed = new JTabbedPane(); tabbed.addTab("Abstract Syntax Tree / XPath / Symbol Table", resultsSplitPane); tabbed.addTab("Data Flow Analysis", dfaPanel); tabbed.setMnemonicAt(0, KeyEvent.VK_A); tabbed.setMnemonicAt(1, KeyEvent.VK_D); JSplitPane containerSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, controlSplitPane, tabbed); containerSplitPane.setContinuousLayout(true); JMenuBar menuBar = createMenuBar(); frame.setJMenuBar(menuBar); frame.getContentPane().add(containerSplitPane); frame.setDefaultCloseOperation(exitOnClose ? JFrame.EXIT_ON_CLOSE : WindowConstants.DISPOSE_ON_CLOSE); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int screenHeight = screenSize.height; int screenWidth = screenSize.width; frame.pack(); frame.setSize(screenWidth * 3 / 4, screenHeight * 3 / 4); frame.setLocation((screenWidth - frame.getWidth()) / 2, (screenHeight - frame.getHeight()) / 2); frame.setVisible(true); int horozontalMiddleLocation = controlSplitPane.getMaximumDividerLocation() * 3 / 5; controlSplitPane.setDividerLocation(horozontalMiddleLocation); containerSplitPane.setDividerLocation(containerSplitPane.getMaximumDividerLocation() / 2); astAndSymbolTablePane.setDividerLocation(astAndSymbolTablePane.getMaximumDividerLocation() / 3); resultsSplitPane.setDividerLocation(horozontalMiddleLocation); loadSettings(); }