本文整理汇总了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);
}
}
示例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 );
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}