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

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

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

JTextArea.paintComponent介绍

暂无

代码示例

代码示例来源:origin: org.simplericity.jettyconsole/jetty-console-core

protected void paintComponent(Graphics graphics) {
    Graphics2D g2 = (Graphics2D) graphics;
    Composite comp = g2.getComposite();
    Color c = g2.getColor();
    g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3F));
    g2.setColor(Color.BLACK);
    g2.fillRect(0, 0, getWidth(), getHeight());
    g2.setComposite(comp);
    g2.setColor(c);
    super.paintComponent(graphics);
  }
};

代码示例来源:origin: org.icepdf.os/icepdf-viewer

@Override
protected void paintComponent(Graphics g) {
  if (!active) {
    return;
  }
  float zoom = this.zoomProvider.getZoom();
  Graphics2D g2 = (Graphics2D) g;
  g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
  g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
  AffineTransform old = g2.getTransform();
  g2.scale(zoom, zoom);
  // paint the component at the scale of the page.
  super.paintComponent(g2);
  g2.setTransform(old);
}

代码示例来源:origin: org.icepdf.os/icepdf-viewer

@Override
protected void paintComponent(Graphics g) {
  if (!active) {
    return;
  }
  float zoom = documentViewModel.getViewZoom();
  Graphics2D g2 = (Graphics2D) g;
  g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
  g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
  AffineTransform old = g2.getTransform();
  g2.scale(zoom, zoom);
  // paint the component at the scale of the page.
  super.paintComponent(g2);
  g2.setTransform(old);
}

代码示例来源:origin: eu.mihosoft.vrl/vrl

super.paintComponent(g);

相关文章

JTextArea类方法