javax.swing.JMenuItem.paintComponent()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(151)

本文整理了Java中javax.swing.JMenuItem.paintComponent()方法的一些代码示例,展示了JMenuItem.paintComponent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenuItem.paintComponent()方法的具体详情如下:
包路径:javax.swing.JMenuItem
类名称:JMenuItem
方法名:paintComponent

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);
}

相关文章

JMenuItem类方法