Results 1 to 4 of 4
  1. #1
    nik_meback is offline Member
    Join Date
    Dec 2010
    Posts
    19
    Rep Power
    0

    Default Swing - JSplitPane setDividerLocation(double) problem

    I need to set the divider location of my JSplitPane as a percentage of its size.

    To divide the splitpane into two equal halves, I tried using:
    mySplitPane.setDividerLocation((double)0.5);

    but it just doesn't have any effect on the existing divider location.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default

    Have you read the API for that method?
    If the split pane is not correctly realized and on screen, this method will have no effect

    To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

    db

  3. #3
    nik_meback is offline Member
    Join Date
    Dec 2010
    Posts
    19
    Rep Power
    0

    Default

    If I may ask, what does it mean to get a pane "realized"? Is it something related to its visibility? Thanks.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default

    realized: made real. As I understand it, a GUI component is realized when it is attached to native resources. For lightweight (Swing) components, this happens when the top-level window is either pack()ed or setVisible(true). The component will return to the unrealzed state if the containing window is dispose()d.

    db
    Last edited by DarrylBurke; 12-21-2010 at 04:25 AM.

Similar Threads

  1. Double drawing problem with 2D
    By leapinlizard in forum Java 2D
    Replies: 4
    Last Post: 02-12-2010, 01:02 AM
  2. variable double problem
    By DarkoDrljaca in forum New To Java
    Replies: 5
    Last Post: 03-02-2009, 08:00 AM
  3. Replies: 3
    Last Post: 11-24-2008, 07:01 PM
  4. Double Value problem
    By sakthivel123 in forum New To Java
    Replies: 2
    Last Post: 07-10-2008, 04:18 PM
  5. Double Buffering problem
    By aprenz in forum Java Applets
    Replies: 0
    Last Post: 05-28-2008, 04:26 AM

Posting Permissions

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