本文整理了Java中javax.swing.JMenuItem.paintComponent()
方法的一些代码示例,展示了JMenuItem.paintComponent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenuItem.paintComponent()
方法的具体详情如下:
包路径:javax.swing.JMenuItem
类名称:JMenuItem
方法名:paintComponent
暂无
代码示例来源:origin: net.sf.ingenias/editor
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Icon icon = isEnabled() ? arrowIcon : disabledArrowIcon;
int x = (getWidth() - icon.getIconWidth()) / 2;
int y = (getHeight() - icon.getIconHeight()) / 2;
icon.paintIcon(this, g, x, y);
}
代码示例来源:origin: ontopia/ontopia
/** Draw a coloured square at the end of the display. */
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
Shape clip = g2.getClip();
Rectangle bounds = clip.getBounds();
double width = bounds.getWidth();
double height = bounds.getHeight();
g2.setColor(squareColor);
g2.fill3DRect(((int) width - 25), 0, 25, (int) height, true);
visibleIndicator.paintComponent(g);
}
代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Icon icon = isEnabled() ? arrowIcon : null;
if (icon != null) {
int x = (getWidth() - icon.getIconWidth()) / 2;
int y = (getHeight() - icon.getIconHeight()) / 2;
icon.paintIcon(this, g, x, y);
}
}
}
代码示例来源:origin: com.fifesoft.rtext/fife.common
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Icon icon = isEnabled() ? arrowIcon : disabledArrowIcon;
int x = (getWidth() - icon.getIconWidth()) / 2;
int y = (getHeight() - icon.getIconHeight()) / 2;
icon.paintIcon(this, g, x, y);
}
内容来源于网络,如有侵权,请联系作者删除!