tablescrollpanecorner.java

来自「Mobile 应用程序使用 Java Micro Edition (Java M」· Java 代码 · 共 51 行

JAVA
51
字号
/* * @(#)TableScrollPaneCorner.java	1.3 08/01/29 * * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package com.sun.java.swing.plaf.nimbus;import com.sun.java.swing.Painter;import javax.swing.JComponent;import javax.swing.UIManager;import javax.swing.plaf.UIResource;import java.awt.Graphics;import java.awt.Graphics2D;import java.awt.Color;import java.awt.image.BufferedImage;/** * TableScrollPaneCorner - A simple component that paints itself using the table * header background painter. It is used to fill the top right corner of * scrollpane. * * @author Created by Jasper Potts (Jan 28, 2008) */public class TableScrollPaneCorner extends JComponent implements UIResource{    /**     * Paint the component using the Nimbus Table Header Background Painter     */    @Override protected void paintComponent(Graphics g) {        Painter painter = (Painter) UIManager.get(            "TableHeader:\"TableHeader.renderer\"[Enabled].backgroundPainter");        if (painter != null){            if (g instanceof Graphics2D){                painter.paint((Graphics2D)g,this,getWidth()+1,getHeight());            } else {                // paint using image to not Graphics2D to support                // Java 1.1 printing API                BufferedImage img =  new BufferedImage(getWidth(),getHeight(),                        BufferedImage.TYPE_INT_ARGB);                Graphics2D g2 = (Graphics2D)img.getGraphics();                painter.paint(g2,this,getWidth()+1,getHeight());                g2.dispose();                g.drawImage(img,0,0,null);                img = null;            }        }    }}

⌨️ 快捷键说明

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