JSplitPane setBottomComponent - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for JSplitPane setBottomComponent method.

This code example shows how to use the following methods:setBottomComponent, setResizeWeight, setTopComponent
		super(); 
		this.setTitle(friendsListViewMessages.getString("friends"));
		this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		this.setSize(400, 800);
		this.setLayout(new BorderLayout());
		JSplitPane splitter = new JSplitPane();
		splitter.setResizeWeight(0.5);
 
		JPanel topPanel = new JPanel(new BorderLayout());
		topPanel.add(new LocalizedJLabel(friendsListViewMessages, "online"), BorderLayout.NORTH);
		this.onlineList = new JList<RosterEntry>();
		this.onlineList.setCellRenderer(new FriendListItemRenderer());
		topPanel.add(new JScrollPane(this.onlineList), BorderLayout.CENTER);
 
		JPanel bottomPanel = new JPanel(new BorderLayout());
		bottomPanel.add(new LocalizedJLabel(friendsListViewMessages, "offline"), BorderLayout.NORTH);
		this.offlineList = new JList<RosterEntry>();
		this.offlineList.setCellRenderer(new FriendListItemRenderer());
		bottomPanel.add(new JScrollPane(this.offlineList), BorderLayout.CENTER);
 

6
CodeRank
This code example shows how to use the following methods:addHierarchyListener, setBottomComponent, setDividerSize, setOneTouchExpandable, setTopComponent
    /** 
     * Creates the main split panel 
     * @return 
     */ 
    protected JSplitPane buildSplitPane() {
        spEditors = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
        spEditors.setTopComponent(buildTagEditorPanel());
        spEditors.setBottomComponent(buildMemberEditorPanel());
        spEditors.setOneTouchExpandable(false);
        spEditors.setDividerSize(5);
        spEditors.addHierarchyListener(new SplitPaneDividerInitializer());
        return spEditors;
    } 
 
    /** 
     * Builds the user interface 
     */ 
    protected void build() { 
        setLayout(new BorderLayout());
        add(buildSplitPane(), BorderLayout.CENTER);
6
CodeRank
This code example shows how to use the following methods:setBottomComponent, setOneTouchExpandable, setResizeWeight, setTopComponent
		 
		return tp;
	} 
	 
	private static JSplitPane buildQueryPane() {
		JSplitPane sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true);
		sp.setResizeWeight(0.5);
		sp.setOneTouchExpandable(true);
		 
		sp.setTopComponent(buildQueryStatementPane());
		 
		sp.setBottomComponent(buildSQLResultSetPane());
		 
		return sp;
	} 
	 
	private static JTabbedPane buildDocumentPane() {
		JTabbedPane tp = new ClosableTabbedPane(JTabbedPane.TOP);
		 
		UIRegistry.registerDocumentTab(tp);
6
CodeRank
This code example shows how to use the following methods:setBottomComponent, setTopComponent
    final JScrollPane scroll = new JScrollPane(editorPane,
        JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
 
    final JButton previewButton = new JButton(getPreviewAction());
 
    final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    splitPane.setTopComponent(scroll);
    splitPane.setBottomComponent(demoHandler.getPresentationComponent());
    content.add(splitPane, BorderLayout.CENTER);
    content.add(previewButton, BorderLayout.SOUTH);
    return content;
  } 
 
  /** 
   * Handler method called by the preview action. This method should perform all operations to preview the report. 
   */ 
  protected void attemptPreview() 
  { 
    final InternalDemoHandler demoHandler = getDemoHandler();
    final PreviewHandler previewHandler = demoHandler.getPreviewHandler();
6
CodeRank
This code example shows how to use the following methods:getDividerLocation, setBottomComponent, setDividerLocation, setDividerSize, setLastDividerLocation
This code example shows how to use the following methods:setBorder, getOrientation, setBottomComponent, setResizeWeight, setRightComponent
	 * @param secondaryComponent the right or bottom component, when split 
	 */ 
	public SplittablePane(int orientation, Component mainComponent, Component secondaryComponent) {
		setLayout(new BorderLayout());
		 
		splitPane = new JSplitPane(orientation);
		splitPane.setBorder(null);
		splitPane.setResizeWeight(0.5); // Divide extra or removed space evenly when resizing.
		 
		this.mainComponent = mainComponent;
		this.isSplit = false;
		if (this.mainComponent != null) {
		    add(this.mainComponent, BorderLayout.CENTER);
		} 
		 
		setSecondaryComponent(secondaryComponent);
	} 
	 
	/** 
	 * Sets the main component. This is either the left or top component, 

5
CodeRank
This code example shows how to use the following methods:setBackground, setBorder, setBottomComponent, setDividerLocation, setDividerSize
		this.setLayout(layout);
		this.width=w;
		this.height=he;
		this.setMaximumSize(new Dimension(width,height));
		//codeTabs = new JTabbedPane(); 
		codeHolder = new JSplitPane();
		//codeHolder.setLayout(new BorderLayout()); 
		 
		outputContainer = new JPanel();
		outputContainer.setLayout(new BorderLayout());
		 
		codeContainer = new JPanel();
		codeContainer.setBorder(null);
		codeContainer.setLayout(new BorderLayout());
		 
		//hiddeHolder = new JPanel(); 
		//codeHolder.setLayout(new BorderLayout()); 
 
		this.setPreferredSize(new Dimension(width,height));
		codeField= c;

5
CodeRank
This code example shows how to use the following methods:getOrientation, setBottomComponent, setTopComponent
	} 
 
	public void setSubViews(Viewer viewer1,Viewer viewer2){
		this.viewer2=viewer2;
		this.viewer1=viewer1;
		if(splitPane.getOrientation()==JSplitPane.VERTICAL_SPLIT){
			splitPane.setTopComponent(viewer1);
			splitPane.setBottomComponent(viewer2);
			viewer1.setSuperView(this,"top");
			viewer2.setSuperView(this,"bottom");
		}else{ 
			splitPane.setLeftComponent(viewer1);
			splitPane.setRightComponent(viewer2);
			viewer1.setSuperView(this,"left");
			viewer2.setSuperView(this,"right");
		} 
	} 
 
	@Override 
	public void clearContent(){ 
4
CodeRank
This code example shows how to use the following methods:setBottomComponent
	 
	/** Builds and lays out the UI. */ 
	private void buildGUI() 
	{ 
		Container c = getContentPane();
		pane.setBottomComponent(buildNodesPane());
		c.add(pane, BorderLayout.CENTER);
		 
		JPanel p = new JPanel();
		p.setLayout(new BorderLayout());
		JPanel bar = buildToolBar();
		p.add(bar, BorderLayout.LINE_START);
		p.add(buildBottomBar(), BorderLayout.CENTER);
		Dimension d = bar.getPreferredSize();
		p.add(Box.createHorizontalStrut(d.width), BorderLayout.LINE_END);
		c.add(p, BorderLayout.SOUTH);
	} 
	 
	/** 
	 * Creates a new instance. 
4
CodeRank
This code example shows how to use the following methods:setBottomComponent
        if (getComponentCount() == ZERO_CONTENT_COUNT + 1) {
            if (locationInParent.equals(JSplitPane.LEFT) || locationInParent.equals(JSplitPane.TOP)) {
                parentComponent.setLeftComponent(this);
            } 
            else { 
                parentComponent.setBottomComponent(this);
            } 
        } 
    } 
 
 
    private void processComponentRemoved() { 
        if (getComponentCount() == ZERO_CONTENT_COUNT) {
            if (locationInParent.equals(JSplitPane.LEFT) || locationInParent.equals(JSplitPane.TOP)) {
                parentComponent.setTopComponent(null);
            } 
            else { 
                parentComponent.setBottomComponent(null);
            } 
        } 
3
CodeRank
setBottomComponent Method Overview
Sets the component below, or to the right of the divider.
See Code Examples for other Java 8 JSplitPane Methods: