Java Code Examples for javax.swing.JSplitPane

The following examples show how to use javax.swing.JSplitPane. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 *
 */
public UnitsPanel(PreferencesExt prefs) {
  this.prefs = prefs;

  unitDataset = new UnitDatasetCheck((PreferencesExt) prefs.node("unitDataset"));
  unitConvert = new UnitConvert((PreferencesExt) prefs.node("unitConvert"));
  dateFormatMark = new DateFormatMark((PreferencesExt) prefs.node("dateFormatMark"));

  split2 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, unitConvert, dateFormatMark);
  split2.setDividerLocation(prefs.getInt("splitPos2", 500));

  split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, new JScrollPane(unitDataset), split2);
  split.setDividerLocation(prefs.getInt("splitPos", 500));

  setLayout(new BorderLayout());
  add(split, BorderLayout.CENTER);
}
 
Example 2
Source Project: jdal   Source File: TableEditorFrame.java    License: Apache License 2.0 6 votes vote down vote up
public void init() {
	
	tableIcon = FormUtils.getIcon(tableIcon, DEFAULT_TABLE_ICON);
	for (TableEditor<?> editor : editors)
		editor.getPanel().setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0));
		
	list = new JList(editors);
	list.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0));
	list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	list.setVisibleRowCount(-1);
	JScrollPane scroll = new JScrollPane(list);
	split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scroll, editorPanel);
	getContentPane().add(split);
	list.addListSelectionListener(this);
	list.setCellRenderer(new ListCellRenderer());
	list.setSelectedIndex(0);
	setSize(800, 600);
}
 
Example 3
Source Project: ghidra   Source File: DataTypeSyncDialog.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a data type synchronization dialog
 * @param plugin the data type manager plug-in
 * @param synchronizer the data type synchronizer for synchronizing a program and archive.
 * @param list the list of data types to be displayed to the user.
 * @param commit true means data types from the program data types are to be committed 
 * back to the associated data types in the archive. false means update the program data 
 * types with changes that were made in the archive.
 */
public DataTypeSyncDialog(DataTypeManagerPlugin plugin, String clientName, String sourceName,
		List<DataTypeSyncInfo> list, Set<DataTypeSyncInfo> preselectedInfos,
		String operationName, String title) {
	super(title, true);
	this.plugin = plugin;
	this.operationName = operationName;

	syncPanel = new DataTypeSyncPanel(list, preselectedInfos, this);
	comparePanel = new DataTypeComparePanel(clientName, sourceName);
	JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, syncPanel, comparePanel);
	splitPane.setResizeWeight(0.6);
	mainPanel = new JPanel(new BorderLayout());
	mainPanel.add(splitPane, BorderLayout.CENTER);
	addWorkPanel(mainPanel);
	initialize();
	createActions();
}
 
Example 4
/**
 * overrides to hardcode the size of the divider
 * PENDING(jeff) - rewrite JSplitPane so that this ins't needed
 */
public void setDividerSize(int newSize) {
    Insets          insets = getInsets();
    int             borderSize = 0;
    if (getBasicSplitPaneUI().getOrientation() ==
        JSplitPane.HORIZONTAL_SPLIT) {
        if (insets != null) {
            borderSize = insets.left + insets.right;
        }
    }
    else if (insets != null) {
        borderSize = insets.top + insets.bottom;
    }
    if (newSize < pad + minimumThumbSize + borderSize) {
        setDividerSize(pad + minimumThumbSize + borderSize);
    } else {
        vThumbHeight = hThumbWidth = newSize - pad - borderSize;
        super.setDividerSize(newSize);
    }
}
 
Example 5
Source Project: jdk8u-jdk   Source File: Test6657026.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws InterruptedException {
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()){
        throw new Error("unexpected traversal keys");
    }
    new JSplitPane() {
        public void setFocusTraversalKeys(int id, Set keystrokes) {
            keystrokes.clear();
            super.setFocusTraversalKeys(id, keystrokes);
        }
    };
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    KEYBOARD_DIVIDER_MOVE_OFFSET = -KEYBOARD_DIVIDER_MOVE_OFFSET;

    ThreadGroup group = new ThreadGroup("$$$");
    Thread thread = new Thread(group, new Test6657026());
    thread.start();
    thread.join();
}
 
Example 6
Source Project: TencentKona-8   Source File: Test6657026.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws InterruptedException {
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()){
        throw new Error("unexpected traversal keys");
    }
    new JSplitPane() {
        public void setFocusTraversalKeys(int id, Set keystrokes) {
            keystrokes.clear();
            super.setFocusTraversalKeys(id, keystrokes);
        }
    };
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    KEYBOARD_DIVIDER_MOVE_OFFSET = -KEYBOARD_DIVIDER_MOVE_OFFSET;

    ThreadGroup group = new ThreadGroup("$$$");
    Thread thread = new Thread(group, new Test6657026());
    thread.start();
    thread.join();
}
 
Example 7
Source Project: DominionSim   Source File: DomGui.java    License: MIT License 6 votes vote down vote up
private void initializeComponent()	{
  setJMenuBar( createMenu() );
  
     myVPLineChart = new DomLineChart(myEngine.getPlayers(), "VP");
  myBarChart = new DomBarChart(myEngine.getPlayers());
     myMoneyLineChart = new DomLineChart(myEngine.getPlayers(), "Money");

     myTopSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, new JScrollPane(getControlPanel()), myVPLineChart.getChartPanel());
     myBottomSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, myBarChart.getChartPanel(), myMoneyLineChart.getChartPanel());
  myBigSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, myTopSplit, myBottomSplit);
     myBigSplit.setResizeWeight(0.8);
     myTopSplit.setResizeWeight(0.50);
     myBottomSplit.setResizeWeight(0.5);
     myBottomSplit.setDividerSize(5);
     myBigSplit.setDividerSize(5);
     myTopSplit.setDividerSize(5);

  add(myBigSplit);
}
 
Example 8
Source Project: openjdk-jdk8u   Source File: Test6657026.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    SunToolkit.createNewAppContext();
    if (new JSplitPane().getFocusTraversalKeys(0).isEmpty()) {
        throw new Error("shared traversal keys");
    }
    JSplitPane pane = new JSplitPane();
    pane.setUI(this);

    createFocusListener().focusGained(null); // allows actions
    test(pane, "positiveIncrement", 3);
    test(pane, "negativeIncrement", 0);
}
 
Example 9
Source Project: swift-k   Source File: TasksRenderer.java    License: Apache License 2.0 5 votes vote down vote up
protected JComponent createFileStuff() {
	JSplitPane t = new JSplitPane(VERTICAL_SPLIT);
	t.setResizeWeight(0.5);
	t.setTopComponent(createTransferTable());
	t.setBottomComponent(createFileopTable());
	return t;
}
 
Example 10
Source Project: ramus   Source File: RSFViewer2.java    License: GNU General Public License v3.0 5 votes vote down vote up
public RSFViewer2(final Engine engine) {
    this.engine = engine;
    this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    this.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            try {
                ((FileIEngineImpl) engine.getDeligate()).close();
            } catch (IOException e1) {
                e1.printStackTrace();
            }
            System.exit(0);
        }
    });
    this.setTitle("Ramus files viewer sample 2");

    JSplitPane pane = new JSplitPane();

    pane.setLeftComponent(createQualifiersList());
    pane.setRightComponent(createTreeView());

    this.setContentPane(pane);

    this.pack();
    this.setSize(800, 600);
    this.setLocationRelativeTo(null);
}
 
Example 11
Source Project: osp   Source File: ControlSplitPanel.java    License: GNU General Public License v3.0 5 votes vote down vote up
public void setDefaultValue(int _index) {
  switch(_index) {
     case 0 :
       splitpanel.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
       break;
     case 1 :
       splitpanel.setOneTouchExpandable(true);
       break;
     default :
       super.setDefaultValue(_index-2);
       break;
  }
}
 
Example 12
Source Project: netbeans   Source File: SplitDocumentVerticallyAction.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public final void actionPerformed(ActionEvent evt) {
    final TopComponent tc = WindowManager.getDefault().getRegistry().getActivated();

    if (tc != null) {
        SplitAction.splitWindow(tc, JSplitPane.VERTICAL_SPLIT, -1);
    }
}
 
Example 13
Source Project: jdk8u-jdk   Source File: Test6910490.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void init() {
    Insets insets = new Insets(10, 10, 10, 10);
    Dimension size = new Dimension(getWidth() / 2, getHeight());
    JSplitPane pane = new JSplitPane(
            JSplitPane.HORIZONTAL_SPLIT,
            create("Color", size, new MatteBorder(insets, RED)),
            create("Icon", size, new MatteBorder(insets, this)));
    pane.setDividerLocation(size.width - pane.getDividerSize() / 2);
    add(pane);
}
 
Example 14
/**
 * Maps {@code JSplitPane.setLeftComponent(Component)} through queue
 */
public void setLeftComponent(final Component component) {
    runMapping(new MapVoidAction("setLeftComponent") {
        @Override
        public void map() {
            ((JSplitPane) getSource()).setLeftComponent(component);
        }
    });
}
 
Example 15
protected void prepareControls() {
    JFrame frame = new JFrame("SplitPane Mixing");
    JPanel p = new JPanel(new GridLayout());
    p.setPreferredSize(new Dimension(500, 500));
    propagateAWTControls(p);
    sp1 = new JScrollPane(p);

    JButton button = new JButton("JButton");
    button.setBackground(Color.RED);
    button.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            clicked = true;
        }
    });
    sp2 = new JScrollPane(button);

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sp1, sp2);
    splitPane.setOneTouchExpandable(false);
    splitPane.setDividerLocation(150);

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

    frame.getContentPane().add(splitPane);
    frame.pack();
    frame.setVisible(true);
}
 
Example 16
Source Project: Java8CN   Source File: MultiSplitPaneUI.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>getMaximumDividerLocation</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getMaximumDividerLocation(JSplitPane a) {
    int returnValue =
        ((SplitPaneUI) (uis.elementAt(0))).getMaximumDividerLocation(a);
    for (int i = 1; i < uis.size(); i++) {
        ((SplitPaneUI) (uis.elementAt(i))).getMaximumDividerLocation(a);
    }
    return returnValue;
}
 
Example 17
private Container getMainContentContainer() {

        // card pool
        cardPoolDefs = filterPanel.getFilteredCards();

        cardPoolTable = new CardTablePanelB(cardPoolDefs, generatePoolTitle(), false);
        cardPoolTable.addMouseListener(new CardPoolMouseListener());
        cardPoolTable.addCardSelectionListener(this);

        cardPoolTable.setDeckEditorSelectionMode();

        deckDefs = this.deck;
        deckTable = new CardTablePanelB(deckDefs, generateDeckTitle(deckDefs), true);
        deckTable.addMouseListener(new DeckMouseListener());
        deckTable.addCardSelectionListener(this);
        deckTable.setDeckEditorSelectionMode();
        deckTable.showCardCount(true);

        final JPanel deckPanel = new JPanel();
        deckPanel.setOpaque(false);
        deckPanel.setLayout(new MigLayout("insets 0, gap 0, flowy"));
        deckPanel.add(buttonsPanel, "w 100%, h 40!");
        deckPanel.add(deckTable, "w 100%, h 100%");

        cardsSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
        cardsSplitPane.setOneTouchExpandable(false);
        cardsSplitPane.setLeftComponent(cardPoolTable);
        cardsSplitPane.setRightComponent(deckPanel);
        cardsSplitPane.setResizeWeight(0.5);
        cardsSplitPane.setDividerSize(14);
        cardsSplitPane.setBorder(null);
        cardsSplitPane.setOpaque(false);
        cardsSplitPane.setDividerLocation(getDividerPosition());

        // update deck stats
        sideBarPanel.setDeck(this.deck);

        return cardsSplitPane;

    }
 
Example 18
Source Project: openjdk-8   Source File: Test6910490.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void init() {
    Insets insets = new Insets(10, 10, 10, 10);
    Dimension size = new Dimension(getWidth() / 2, getHeight());
    JSplitPane pane = new JSplitPane(
            JSplitPane.HORIZONTAL_SPLIT,
            create("Color", size, new MatteBorder(insets, RED)),
            create("Icon", size, new MatteBorder(insets, this)));
    pane.setDividerLocation(size.width - pane.getDividerSize() / 2);
    add(pane);
}
 
Example 19
Source Project: visualvm   Source File: JCompoundSplitPane.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Component getFirstComponent(JSplitPane splitPane) {
    if (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
        return splitPane.getLeftComponent();
    } else {
        return splitPane.getTopComponent();
    }
}
 
Example 20
Source Project: SproutLife   Source File: PanelController.java    License: MIT License 5 votes vote down vote up
public void buildPanels() {
    gameFrame = new GameFrame(this);
    gameMenu = new GameMenu(this);
    gameFrame.setJMenuBar(gameMenu);
    gameToolbar = new GameToolbar(this);
    
    boardRenderer = new BoardRenderer(getGameModel());
    displayControlPanel = new DisplayControlPanel(this);
    settingsControlPanel = new RulesControlPanel(this);
    statsPanel = new StatsPanel(this);
    tipsPanel = new TipsPanel(this);
    ScrollPanel scrollPanel = getScrollPanel();
    

    JTabbedPane rightPane = new JTabbedPane();
    rightPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
    rightPane.addTab("Display", wrapInScrolPane(displayControlPanel));
    rightPane.addTab("Rules", wrapInScrolPane(settingsControlPanel));
    rightPane.addTab("Stats", statsPanel);
    rightPane.addTab("Tips", tipsPanel);

    JPanel gamePanel = new JPanel(new BorderLayout());
    gamePanel.add(scrollPanel, BorderLayout.CENTER);
    gamePanel.add(gameToolbar, BorderLayout.NORTH);

    splitPane = new JSplitPane();
    splitPane.setResizeWeight(1);
    splitPane.setOneTouchExpandable(true);
    splitPane.setLeftComponent(gamePanel);
    splitPane.setRightComponent(rightPane);

    gameFrame.add(splitPane);
}
 
Example 21
Source Project: netbeans   Source File: MultiSplitPaneTest.java    License: Apache License 2.0 5 votes vote down vote up
protected void resizeSplit( int orientation, int splitSize, int nonResizingSize ) {
    if( orientation == JSplitPane.HORIZONTAL_SPLIT )
        split.setSize( splitSize, nonResizingSize );
    else
        split.setSize( nonResizingSize, splitSize );
    testWindow.getContentPane().add( split );
    split.validate();
}
 
Example 22
Source Project: binnavi   Source File: AbstractScriptPanel.java    License: Apache License 2.0 5 votes vote down vote up
public AbstractScriptPanel(final LayoutManager layout) {
  super(layout);

  languageBox = new LanguageBox(getManager());
  languageBox.addActionListener(new InternalLanguageBoxListener());

  m_inputPane.setEditable(true);
  m_inputPane.setBackground(new Color((float) .97, (float) .97, 1));
  m_inputPane.setFont(new Font(GuiHelper.getMonospaceFont(), 0, 13));

  m_OutputPane.setDocument(m_PythonStdoutDocument);

  m_OutputPane.setEditable(false);
  m_OutputPane.setBackground(new Color((float) .97, (float) .97, 1));
  final JScrollPane inputScrollPane = new JScrollPane(m_inputPane);

  final TitledBorder inputAreaBorder =
      new TitledBorder(new LineBorder(Color.LIGHT_GRAY, 1, true), "Command Line");
  inputScrollPane.setBorder(inputAreaBorder);
  inputScrollPane.setPreferredSize(new Dimension(600, 200));

  final JScrollPane m_OutputScrollPane = new JScrollPane(m_OutputPane);

  final TitledBorder outputAreaBorder =
      new TitledBorder(new LineBorder(Color.LIGHT_GRAY, 1, true), "Output");
  m_OutputScrollPane.setBorder(outputAreaBorder);
  m_OutputScrollPane.setPreferredSize(new Dimension(600, 200));

  add(languageBox, BorderLayout.NORTH);
  add(new JSplitPane(JSplitPane.VERTICAL_SPLIT, false, inputScrollPane, m_OutputScrollPane));

}
 
Example 23
Source Project: netbeans   Source File: JSplitPaneSupport.java    License: Apache License 2.0 5 votes vote down vote up
private int convertPosition(LayoutConstraints desc) {
    if (desc != null) {
        Object position = desc.getConstraintsObject();
        if (JSplitPane.LEFT.equals(position) || JSplitPane.TOP.equals(position))
            return 0;
        if (JSplitPane.RIGHT.equals(position) || JSplitPane.BOTTOM.equals(position))
            return 1;
    }
    return -1;
}
 
Example 24
Source Project: netbeans   Source File: PSheet.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Overridden to handle our layout requirements
 */
public void doLayout() {
    Component[] c = getComponents();

    if (c.length > 0 && getWidth() >= 0 && getHeight() >= 0) {
        Insets ins = getInsets();
        c[0].setBounds(ins.left, ins.top, getWidth() - (ins.right + ins.left), getHeight() - ins.top + ins.bottom);

        if (c[0] instanceof JSplitPane && Boolean.TRUE.equals(firstSplit)) {
            JSplitPane pane = (JSplitPane) c[0];
            pane.setDividerLocation(0.80f);
            pane.resetToPreferredSizes();

            JComponent dc = findDescriptionComponent();

            if (dc != null) {
                if (dc.getHeight() > 0) {
                    firstSplit = Boolean.FALSE;
                }
            } else {
                firstSplit = Boolean.FALSE;
            }
        }

        if (c.length > 1) {
            throw new IllegalStateException("Hmm, something is wrong: " + Arrays.asList(c));
        }
    }
}
 
Example 25
Source Project: mzmine3   Source File: ProcessingComponent.java    License: GNU General Public License v2.0 5 votes vote down vote up
public ProcessingComponent() {
  mainPanel = new JPanel(new BorderLayout());

  mainPanel.setPreferredSize(new Dimension(600, 400));

  cbDiffMSn = GUIUtils.addCheckbox(mainPanel,
      "Use different settings for " + MSLevel.MSONE.toString() + " and "
          + MSLevel.MSMS.toString(),
      this, "CBX_DIFFMSN",
      "If enabled, MS^1 and MS^n processing will use different parameters. The currently used settings are highlighted in green.");
  cbDiffMSn.setSelected(
      DataPointProcessingManager.getInst().getProcessingParameters().isDifferentiateMSn());

  mainPanel.add(cbDiffMSn, BorderLayout.NORTH);

  setupTreeViews();
  split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, tvProcessing, tvAllModules);
  initTreeListeners();
  mainPanel.add(split, BorderLayout.CENTER);
  split.setDividerLocation(300);

  buttonPanel = new JPanel(new FlowLayout());
  GUIUtils.addButton(buttonPanel, "Add", null, this, "BTN_ADD");
  GUIUtils.addButton(buttonPanel, "Remove", null, this, "BTN_REMOVE");
  GUIUtils.addButton(buttonPanel, "Set parameters", null, this, "BTN_SET_PARAMETERS");
  GUIUtils.addButton(buttonPanel, "Load", null, this, "BTN_LOAD");
  GUIUtils.addButton(buttonPanel, "Save", null, this, "BTN_SAVE");
  // GUIUtils.addButton(buttonPanel, "Set Default...", null, this,
  // "BTN_SET_DEFAULT");
  mainPanel.add(buttonPanel, BorderLayout.SOUTH);

  chooser = new FileChooser();
  chooser.setTitle("Select Processing Queue File");
  chooser.getExtensionFilters().add(new ExtensionFilter("XML files", XML_EXTENSION));

  SwingUtilities.invokeLater(() -> {
    this.setContent(mainPanel);
  });
}
 
Example 26
Source Project: openjdk-jdk9   Source File: GUIBrowser.java    License: GNU General Public License v2.0 5 votes vote down vote up
private JSplitPane createUnderPane(JTree tree) {
    JTextArea toStringArea = new JTextArea();
    toStringArea.setLineWrap(true);
    toStringArea.setEditable(false);
    tree.addTreeSelectionListener(new ToStringListener(toStringArea));
    JSplitPane result = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
            new JScrollPane(tree),
            new JScrollPane(toStringArea));
    result.setOneTouchExpandable(true);
    result.setDividerSize(8);
    result.setDividerLocation(0.8);
    return result;
}
 
Example 27
Source Project: BART   Source File: ChartTopComponent.java    License: MIT License 5 votes vote down vote up
private void initLayout()   {
    JSplitPane splitPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    splitPanel.setDividerLocation(230);
    
    JScrollPane scrTextArea = new JScrollPane();
    scrTextArea.setBorder(new TitledBorder(new LineBorder(Color.BLACK),
            Bundle.HINT_ChartTopComponent_SCRPanelTitle(), 
             TitledBorder.CENTER,TitledBorder.TOP));
    scrTextArea.setPreferredSize(new Dimension(220, 300));
    scrTextArea.setViewportView(detailedLog);

    JScrollPane scrTable = new JScrollPane();
    scrTable.setBorder(new TitledBorder(new LineBorder(Color.BLACK),
            Bundle.HINT_ChartTopComponent_SCRPanelTable(), 
             TitledBorder.CENTER,TitledBorder.TOP));
    scrTable.setViewportView(cellChangesTable);
    
    JScrollPane scrTC = new JScrollPane();
    scrTC.setViewportView(panelChart);

    splitPanel.add(scrTextArea);
    splitPanel.add(scrTable);
    
    JPanel tmp = new JPanel(new BorderLayout());
    tmp.add(panelChart,BorderLayout.NORTH);
    tmp.add(splitPanel,BorderLayout.CENTER);
    JScrollPane tmpScr = new JScrollPane();
    tmpScr.setViewportView(tmp);

    add(tmpScr,BorderLayout.CENTER);
}
 
Example 28
Source Project: visualvm   Source File: JCompoundSplitPane.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void mouseReleased(MouseEvent e) {
    SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                ((JSplitPane) getFirstComponent()).setResizeWeight(firstResizeWeight);
                ((JSplitPane) getSecondComponent()).setResizeWeight(secondResizeWeight);
            }
        });
}
 
Example 29
Source Project: visualvm   Source File: OQLControllerUI.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void tweakSplitPaneUI(JSplitPane splitPane) {
    splitPane.setOpaque(false);
    splitPane.setBorder(null);
    splitPane.setDividerSize(3);

    if (!(splitPane.getUI() instanceof BasicSplitPaneUI)) {
        return;
    }

    BasicSplitPaneDivider divider = ((BasicSplitPaneUI) splitPane.getUI()).getDivider();

    if (divider != null) {
        divider.setBorder(null);
    }
}
 
Example 30
private void init() {
    setLayout(new BorderLayout());
    splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    splitPane.setOneTouchExpandable(true);
    splitPane.setBottomComponent(objectTable);
    TreeSearch tSearch = TreeSearch.installForOR(objectTree.getTree());
    splitPane.setTopComponent(tSearch);
    splitPane.setResizeWeight(.5);
    splitPane.setDividerLocation(.5);
    add(splitPane);
}