Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7634843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:17:09+00:00 2026-05-31T07:17:09+00:00

I need to hide the Slit Pane in my code as shown in below

  • 0

I need to hide the Slit Pane in my code as shown in below images. I don’t know how to make split-pane hide/unhide in Java Swing base GUI. In my code I divide split pane into two horizontal parts, and then after that I divide right component of splitpane into two vertical parts. I want to hide/unhide left part of split pane.

enter image description here

enter image description here

import java.awt.*;
import java.awt.Event.*;
import javax.swing.*;

class DemoSwingDesign extends JFrame {

    boolean b = false;
    public static JSplitPane splitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
    public static JSplitPane splitpane1 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true);

    public DemoSwingDesign() {
        JFrame frame = new JFrame("Split Pain");
        frame.setSize(300, 300);
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setDefaultLookAndFeelDecorated(true);
        frame.setLayout(new GridLayout());
        //Defining Split Pane


        //splitpane size
        splitpane.setDividerLocation(150);
        splitpane1.setDividerLocation(90);
        splitpane.setContinuousLayout(true);
        splitpane.setOneTouchExpandable(true);

        JTabbedPane jtp = new JTabbedPane();
        jtp.setName("XRay");

        JTabbedPane jtp1 = new JTabbedPane();
        JTabbedPane jtp2 = new JTabbedPane();
        jtp1.setName("Set");
        jtp2.setName("OK");

        JPanel jp = new JPanel(new BorderLayout());

        JComponent Lefttabbedpane = new JTabbedPane();
        jp.add(jtp, -1);
        Lefttabbedpane = jtp;
        splitpane.add(splitpane1, "right");

        splitpane.setLeftComponent(new JScrollPane(jtp2));
        splitpane1.setTopComponent(new JScrollPane(jtp1));
        splitpane1.setBottomComponent(new JScrollPane(Lefttabbedpane));
        frame.add(splitpane);
        frame.setVisible(true);
    }
}

class Temp {

    public static void main(String args[]) {
        DemoSwingDesign d = new DemoSwingDesign();
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T07:17:11+00:00Added an answer on May 31, 2026 at 7:17 am

    May be you are looking for this: JSplitPane.setOneTouchExpandable(boolean)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to hide an excel column entirely. I used the below code but
I need to hide/show parts of a table that is dynamically built, as shown
I have one web page where i need to hide some images , some
I need to hide a specific exported symbol. Which is ___udivdi3 But i don't
i need to hide/show javascript-generated content, see below: $(window).load(function () { $(body).html('<a href=# id=ipsum>Show
I need to hide the right button in the Navigation Bar, then unhide it
I need to hide /unhide the labels and textbox depending on db results ,
I need to hide the arrow buttons of java.awt.Scrollbar(VERTICAL) in an AWT application. Does
I need to hide a Windows form from the taskbar but I can't use
i need to hide a windows program (not visible in taskbar, system tray. visible

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.