当前位置: 首页>>代码示例>>Java>>正文


Java Border.paintBorder方法代码示例

本文整理汇总了Java中javax.swing.border.Border.paintBorder方法的典型用法代码示例。如果您正苦于以下问题:Java Border.paintBorder方法的具体用法?Java Border.paintBorder怎么用?Java Border.paintBorder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.border.Border的用法示例。


在下文中一共展示了Border.paintBorder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: paint

import javax.swing.border.Border; //导入方法依赖的package包/类
@Override
public void paint(Graphics g, JComponent c) {
    Border vpBorder = scrollpane.getViewportBorder();
    if (vpBorder != null) {
        Rectangle r = scrollpane.getViewportBorderBounds();
        vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:XTextAreaPeer.java

示例2: paintComponent

import javax.swing.border.Border; //导入方法依赖的package包/类
@Override
protected void paintComponent(Graphics g) {
    Graphics2D g2 = Utils.prepareGraphics( g );
    if( showBorder && !Utils.isDefaultButtons() ) {
        Border b = underline ? mouseoverBorder : regularBorder;
        b.paintBorder(this, g, 0, 0, getWidth(), getHeight());
    }
    super.paintComponent(g2);

    if( showBorder && Utils.isDefaultButtons() )
        return;

    Dimension size = getSize();
    if( hasFocus() && isEnabled() ) {
        g2.setStroke( LINK_IN_FOCUS_STROKE );
        g2.setColor( Utils.getFocusedLinkColor() );
        g2.drawRect( 0, 0, size.width - 1, size.height - 1 );
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:LinkButton.java

示例3: delegatedPaint

import javax.swing.border.Border; //导入方法依赖的package包/类
private void delegatedPaint(Graphics g) {
    Color c = g.getColor();

    try {
        g.setColor(getBackground());
        g.fillRect(0, 0, getWidth(), getHeight());
        g.setColor(getForeground());

        if (!tableUI) {
            //in the panel, give self-painting editors a lowered
            //border so they look like something
            Border b = BorderFactory.createBevelBorder(BevelBorder.LOWERED);
            b.paintBorder(this, g, 0, 0, getWidth(), getHeight());
        }

        Rectangle r = getBounds();

        //XXX May be the source of Rochelle's multiple rows of error 
        //marking misalignment problem...(I do not jest)
        r.x = (getWidth() > 16) ? ((editor instanceof Boolean3WayEditor) ? 0 : 3) : 0; //align text with other renderers
        r.width -= ((getWidth() > 16) ? ((editor instanceof Boolean3WayEditor) ? 0 : 3) : 0); //align text with other renderers
        r.y = 0;
        editor.paintValue(g, r);
    } finally {
        g.setColor(c);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:RendererFactory.java

示例4: paint

import javax.swing.border.Border; //导入方法依赖的package包/类
/**
 * Paints the divider.
 */
public void paint(Graphics g) {
  super.paint(g);

  // Paint the border.
  Border   border = getBorder();

  if (border != null) {
      Dimension     size = getSize();

      border.paintBorder(this, g, 0, 0, size.width, size.height);
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:BasicSplitPaneDivider.java

示例5: main

import javax.swing.border.Border; //导入方法依赖的package包/类
public static void main(String[] args) {
    Component c = new Component() {};
    c.setBackground(Color.WHITE);
    c.setForeground(Color.BLACK);
    Graphics g = new BufferedImage(1024, 768, BufferedImage.TYPE_INT_RGB).getGraphics();
    g.setClip(0, 0, 1024, 768);
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        border.getBorderInsets(c);
        border.paintBorder(c, g, 0, 0, 1024, 768);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:Test6978482.java


注:本文中的javax.swing.border.Border.paintBorder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。