javax.swing.JButton.paintBorder()方法的使用及代码示例

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

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

JButton.paintBorder介绍

暂无

代码示例

代码示例来源:origin: Exslims/MercuryTrade

@Override
  protected void paintBorder(Graphics g) {
    if (!this.getModel().isPressed()) {
      super.paintBorder(g);
    }
  }
};

代码示例来源:origin: Exslims/MercuryTrade

@Override
  protected void paintBorder(Graphics g) {
    if (!this.getModel().isPressed()) {
      super.paintBorder(g);
    }
  }
};

代码示例来源:origin: com.synaptix/SynaptixSwing

protected void paintBorder(Graphics g) {
  super.paintBorder(g);
  if (red) {
    Graphics2D g2 = (Graphics2D) g;
    g2.setColor(COLOR_TODAY);
    g2.setStroke(new BasicStroke(2));
    g2.drawRoundRect(HALF_WIDTH, HALF_WIDTH, this.getWidth()
        - HALF_WIDTH - 1, this.getHeight() - HALF_WIDTH - 1,
        this.getWidth(), this.getHeight());
  }
}

代码示例来源:origin: gwlucastrig/Tinfour

@Override
  public void paintComponent(Graphics g) {
    super.paintComponent(g);
    int w = getWidth();
    int h = getHeight();
    Insets i = getInsets();
    int fx = i.left;
    int fy = i.top;
    int fw = w - fx - i.right;
    int fh = h - fy - i.bottom;
    g.setColor(colorChoice);
    g.fillRect(fx, fy, fw, fh);
    super.paintBorder(g);
  }
}

代码示例来源:origin: com.synaptix/SynaptixSwing

protected void paintBorder(Graphics g) {
  super.paintBorder(g);
  ButtonModel model = this.getModel();
  if (model.isSelected()) {
    Graphics2D g2 = (Graphics2D) g;
    g2.setColor(COLOR_TODAY);
    g2.setStroke(new BasicStroke(2));
    g2.drawRoundRect(HALF_WIDTH, HALF_WIDTH, this.getWidth()
        - HALF_WIDTH - 1, this.getHeight() - HALF_WIDTH - 1,
        this.getWidth(), this.getHeight());
  }
}

代码示例来源:origin: com.synaptix/SynaptixSwing

protected void paintBorder(Graphics g) {
  super.paintBorder(g);
  ButtonModel model = this.getModel();
  if (model.isSelected()) {
    Graphics2D g2 = (Graphics2D) g;
    g2.setColor(COLOR_TODAY);
    g2.setStroke(new BasicStroke(2));
    g2.drawRoundRect(HALF_WIDTH, HALF_WIDTH, this.getWidth()
        - HALF_WIDTH - 1, this.getHeight() - HALF_WIDTH - 1,
        this.getWidth(), this.getHeight());
  }
}

相关文章

微信公众号

最新文章

更多

JButton类方法