Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: jsplitpane not size properly

  1. #1
    Junior Member
    Join Date
    Dec 2022
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default jsplitpane not size properly

    Hi all, I am making a simple UI in Netbeans IDE in which I need to split my app into two parts, so i added a jsplitpane to a jframe, but on running the application the left side of splitpane is smaller and the rightside of splitpane is bigger by default.

    I want to set the size (width) of left and right split panes and when I launch the app the left and right split panes should appear in the sizes what was set before.

    Please tell me how to do that.

  2. #2
    Junior Member jlbana's Avatar
    Join Date
    Dec 2022
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: jsplitpane not size properly

    I believe what you're trying to alter is the divider's location, with JSplitPane.setDividerLocation() method.
    // For the divider to be
    // precisely at the middle.
    JSplitPane pane = new JSplitPane();
    pane.setDividerLocation(0.5);
    https://docs.oracle.com/javase/7/docs/api/javax/swing/JSplitPane.html#setDividerLocation(double)

Similar Threads

  1. Stop JSplitPane from going up
    By ciliegia in forum Java Theory & Questions
    Replies: 3
    Last Post: December 10th, 2021, 07:37 AM
  2. Replies: 3
    Last Post: March 30th, 2014, 05:32 AM
  3. Jpanel preffered size exceed the nactual screen size
    By manish.ctae@gmail.com in forum AWT / Java Swing
    Replies: 2
    Last Post: October 31st, 2012, 01:29 AM
  4. [B]Insert a JFrame and a JTable in a JSplitPane[/B]
    By sincerelibran in forum AWT / Java Swing
    Replies: 1
    Last Post: January 23rd, 2011, 01:59 PM
  5. Limit File Size or Request Size
    By tarek.mostafa in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: June 11th, 2010, 07:21 AM