columnbuttonscrollpanelayout.java

来自「tame,扩展了好多SWing组件:JTable」· Java 代码 · 共 43 行

JAVA
43
字号
package tame.layout;import java.awt.*;import javax.swing.*;/**@author Nobuo Tamemasa@version 1.0 05/29/99*/public class ColumnButtonScrollPaneLayout extends  ScrollPaneLayout {  public ColumnButtonScrollPaneLayout() {    super.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS);  }  public void setVerticalScrollBarPolicy(int x) {    // VERTICAL_SCROLLBAR_ALWAYS    super.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS);  }  public void layoutContainer(Container parent) {    super.layoutContainer(parent);    if ((colHead == null) || (! colHead.isVisible()) ||        (upperRight == null) || (vsb == null)) {      return;    }    Rectangle vsbR = new Rectangle(0, 0, 0, 0);    vsbR = vsb.getBounds(vsbR);    Rectangle colHeadR = new Rectangle(0, 0, 0, 0);    colHeadR = colHead.getBounds(colHeadR);    colHeadR.width -= vsbR.width;    colHead.getBounds(colHeadR);    Rectangle upperRightR = upperRight.getBounds();    upperRightR.x     -= vsbR.width;    upperRightR.width += vsbR.width + 1;    upperRight.setBounds(upperRightR);  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?