Java JSplitPane setNewHeightRatio (JSplitPane splitPane, JComponent comp, float oldFraction, int v1, int v2)

Here you can find the source of setNewHeightRatio (JSplitPane splitPane, JComponent comp, float oldFraction, int v1, int v2)

Description

set New Height Ratio

License

Open Source License

Declaration

static public void setNewHeightRatio (JSplitPane splitPane, JComponent comp,  float oldFraction, int v1, int v2) 

Method Source Code

//package com.java2s;

import javax.swing.*;

public class Main {
    static public void setNewHeightRatio(JSplitPane splitPane, JComponent comp, float oldFraction, int v1, int v2) {
        int h = comp.getHeight();
        splitPane.setDividerLocation(//w  ww .  j a va  2  s.  co m
                (int) ((oldFraction <= 0.01) ? v1 * h / v2 : splitPane.getHeight() * oldFraction));
    }
}

Related

  1. getSplitPaneSize(JSplitPane splitPane)
  2. hsplit(Component left, Component right, double resizeWeight)
  3. rememberOldHeightRatio (JSplitPane splitPane)
  4. sanitizeSplitPaneDivider(JSplitPane splitPane)
  5. setDividerLocation(final JSplitPane splitter, final int position)
  6. setSplitDivider(final JSplitPane split, float proportion)
  7. setSplitPaneDividerColor(final JSplitPane pane, final Color color)
  8. standardJSplitPane(final JSplitPane splitPane)