javax.swing.JCheckBox.paint()方法的使用及代码示例

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

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

JCheckBox.paint介绍

暂无

代码示例

代码示例来源:origin: com.github.insubstantial/substance

@Override
public final void paint(Graphics g) {
  super.paint(g);
}

代码示例来源:origin: org.java.net.substance/substance

@Override
public final void paint(Graphics g) {
  super.paint(g);
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void paint(Graphics _g) {
 BuLib.setAntialiasing(this, _g);
 super.paint(_g);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

@Override
public void paintComponent(Graphics g) {
  Dimension dCheck = check.getSize();
  Dimension dLabel = stringDisplayer.getPreferredSize();
  int yLabel = 0;
  if (dCheck.height >= dLabel.height) {
    yLabel = (dCheck.height - dLabel.height) / 2;
  }
  check.setBounds(0, 0, dCheck.width, dCheck.height);
  check.paint(g);
  int y = yLabel - 2;
  stringDisplayer.setBounds(dCheck.width, y, dLabel.width, getHeight() - 1);
  g.translate(dCheck.width, yLabel);
  stringDisplayer.paint(g);
  g.translate(-dCheck.width, -yLabel);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-localhistory

@Override
public void paintComponent (Graphics g) {
  Dimension d_check = check == null ? new Dimension(0, 0) : check.getSize();
  Dimension d_label = stringDisplayer == null ? new Dimension(0,0) : 
    stringDisplayer.getPreferredSize();
  int y_check = 0;
  int y_label = 0;
  if (d_check.height >= d_label.height) {
    y_label = (d_check.height - d_label.height) / 2;
  }
  if (check != null) {
    check.setBounds (0, 0, d_check.width, d_check.height);
    check.paint(g);
  }
  if (stringDisplayer != null) {
    int y = y_label-2;
    stringDisplayer.setBounds (d_check.width, y, 
      d_label.width, getHeight()-1);
    g.translate (d_check.width, y_label);
    stringDisplayer.paint(g);
    g.translate (-d_check.width, -y_label);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

@Override
public void paintValue(Graphics g, Rectangle box) {
  checkBox.setForeground(g.getColor());
  checkBox.setFont(g.getFont());
  g.translate(box.x, box.y);
  StateCA state = (StateCA) getValue();
  checkBox.setText(state.toString());
  checkBox.setEnabled(false);
  switch (state) {
    case ParsedSource:
    case ExtraParsedSource:
    case IncludedHeader:
    case ParsedOrphanHeader:
      checkBox.setSelected(true);
      break;
    case ExcludedHeader:
    case ExcludedSource:
    case NotYetParsed:
      checkBox.setSelected(false);
      break;
    default:
      assert false : "unexpected " + state;
  }
  checkBox.setSize(box.width, box.height);
  checkBox.paint(g);
  g.translate(-box.x, -box.y);
}

相关文章

JCheckBox类方法