Results 1 to 7 of 7
  1. #1
    michalss is offline Member
    Join Date
    Mar 2011
    Posts
    17
    Rep Power
    0

    Default jSplitPane and divider Location after jFrame resize?

    Hello,

    How can i set pernament divider location on the base of the resolution. What i'm tryingto do is keep the still the same location of the divider after resize the jFrame form.

    Thank you

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default

    (Untested) Add a ComponentListener to the JSplitPane and set the divider location in componentResized(...).

    db

  3. #3
    michalss is offline Member
    Join Date
    Mar 2011
    Posts
    17
    Rep Power
    0

    Default

    Quote Originally Posted by Darryl.Burke View Post
    (Untested) Add a ComponentListener to the JSplitPane and set the divider location in componentResized(...).

    db
    can you write me example code pls ?

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default

    No. This is a forum, not a code mill. But I will guide you to a tutorial where you can learn about writing a ComponentListener.
    How to Write a Component Listener (The Java™ Tutorials > Creating a GUI With JFC/Swing > Writing Event Listeners)

    db

  5. #5
    michalss is offline Member
    Join Date
    Mar 2011
    Posts
    17
    Rep Power
    0

    Default

    Please anyone can give me simple exaple ? I'm using NetBeans.

    This is what i'm trying to do:


    Java Code:
     private void formWindowStateChanged(java.awt.event.WindowEvent evt) {                                        
                
    //        int w = Toolkit.getDefaultToolkit().getScreenSize().width;
    //       int h = Toolkit.getDefaultToolkit().getScreenSize().height;
            
                    if (evt.getNewState() == frmMain.MAXIMIZED_BOTH) // If maximize
                    {
                      jSplitPane5.setDividerLocation(250);
                        
                    }
            
            
        }
    But it does not do anything and Divider stay same :( Pls help



    Thank you
    Last edited by michalss; 04-21-2011 at 11:32 AM.

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default

    The visual designer you're apparently using isn't a beginners' tool, it's targeted at developers with considerable experience in coding Swing GUIs.

    Learn how to code a Swing GUI, starting here: Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)

    And please stop begging for code. I've already told you this isn't a code mill. We are happy to help less experienced people to learn to do things for themselves, but you have to put in that effort.

    db

  7. #7
    michalss is offline Member
    Join Date
    Mar 2011
    Posts
    17
    Rep Power
    0

    Default

    Quote Originally Posted by Darryl.Burke View Post
    The visual designer you're apparently using isn't a beginners' tool, it's targeted at developers with considerable experience in coding Swing GUIs.

    Learn how to code a Swing GUI, starting here: Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)

    And please stop begging for code. I've already told you this isn't a code mill. We are happy to help less experienced people to learn to do things for themselves, but you have to put in that effort.

    db
    If you dont like it then dont answer! And leave it somone who can asnwer properly. Is it that hard to tell me what i'm oding wrong or it is just your ego, can't do it? If you wold look around the forum there is planty of code snipets so what is your problem.
    Last edited by michalss; 04-21-2011 at 12:39 PM.

Similar Threads

  1. JFrame resize control
    By babis in forum AWT / Swing
    Replies: 3
    Last Post: 08-24-2010, 07:50 AM
  2. need to copy file from one location to another location
    By naveen.dpt2007 in forum New To Java
    Replies: 4
    Last Post: 02-28-2010, 03:53 PM
  3. location provider returns no location
    By sandeeprao.techno in forum CLDC and MIDP
    Replies: 0
    Last Post: 09-24-2009, 09:54 AM
  4. JFrame 's components size and location problem
    By petrosgraf in forum Threads and Synchronization
    Replies: 5
    Last Post: 04-18-2009, 02:24 AM
  5. how to place a divider of the splitpane?
    By christina in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 07:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •