javax.swing.JPanel.setDoubleBuffered()方法的使用及代码示例

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

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

JPanel.setDoubleBuffered介绍

暂无

代码示例

代码示例来源:origin: RaiMan/SikuliX2

private void init(Element region) {
 try {
  robot = new Robot();
 } catch (AWTException e1) {
  e1.printStackTrace();
 }
 content = getJPanel();
 _region = region;
 Rectangle rect = _region.getRectangle();
 content.setPreferredSize(rect.getSize());
 add(content);
 setBounds(rect);
 getRootPane().putClientProperty("Window.shadow", Boolean.FALSE);
 ((JPanel) getContentPane()).setDoubleBuffered(true);
 setVisible(false);
 setFocusableWindowState(false);
}

代码示例来源:origin: com.github.davidmoten/state-diagram-viewer

public static void saveImage(JPanel panel, OutputStream os) {
  BufferedImage bi = new BufferedImage(panel.getPreferredSize().width,
      panel.getPreferredSize().height, BufferedImage.TYPE_INT_RGB);
  Graphics2D g2 = bi.createGraphics();
  panel.setDoubleBuffered(false);
  panel.paint(g2);
  panel.setDoubleBuffered(true);
  g2.dispose();
  try {
    ImageIO.write(bi, "png", os);
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: google/sagetv

((javax.swing.JPanel)comp).setDoubleBuffered(true);
javax.swing.JLabel nameLabel = new javax.swing.JLabel(Widget.TYPES[widgs[0].type()] + ':');
nameField = new javax.swing.JTextField(40);

代码示例来源:origin: com.github.davidmoten/state-diagram-viewer

@Override
  public int print(Graphics pg, PageFormat pf, int pageNum) {
    if (pageNum > 0)
      return Printable.NO_SUCH_PAGE;
    Graphics2D g2 = (Graphics2D) pg;
    double w;
    double h;
    if (pf.getOrientation() == PageFormat.LANDSCAPE) {
      w = pf.getPaper().getImageableHeight();
      h = pf.getPaper().getImageableWidth();
    } else {
      w = pf.getPaper().getImageableWidth();
      h = pf.getPaper().getImageableHeight();
    }
    double scalex = w / panel.getPreferredSize().getWidth();
    double scaley = h / panel.getPreferredSize().getHeight();
    double scale = Math.min(scalex, scaley);
    g2.translate(pf.getImageableX(), pf.getImageableY());
    g2.scale(scale, scale);
    panel.setDoubleBuffered(false);
    panel.paint(g2);
    panel.setDoubleBuffered(true);
    return Printable.PAGE_EXISTS;
  }
});

代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui

this.panel.setOpaque(true); // To make the background color visible.
this.panel.setBackground(new Color(255, 255, 255));
this.panel.setDoubleBuffered(true);

代码示例来源:origin: cytoscape.coreplugins/advanced-network-merge

getContentPane().add(jSeparator4, gridBagConstraints);
okPanel.setDoubleBuffered(false);
okPanel.setLayout(new javax.swing.BoxLayout(okPanel, javax.swing.BoxLayout.LINE_AXIS));

代码示例来源:origin: org.cytoscape/network-merge-impl

getContentPane().add(jSeparator4, gridBagConstraints);
okPanel.setDoubleBuffered(false);
okPanel.setLayout(new BoxLayout(okPanel, BoxLayout.LINE_AXIS));

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

painelConsole.setDoubleBuffered(false);
painelConsole.setName("painelConsole"); // NOI18N
painelConsole.setOpaque(false);

代码示例来源:origin: stackoverflow.com

cPanels.setDoubleBuffered(true);
    cPanels2.setDoubleBuffered(true);

代码示例来源:origin: com.sikulix/sikulixapi

private void init(Region region) {
 try {
  robot = new Robot();
 } catch (AWTException e1) {
  e1.printStackTrace();
 }
 content = getJPanel();
 _region = region;
 Rectangle rect = _region.getRect();
 content.setPreferredSize(rect.getSize());
 add(content);
 setBounds(rect);
 getRootPane().putClientProperty("Window.shadow", Boolean.FALSE);
 ((JPanel) getContentPane()).setDoubleBuffered(true);
 setVisible(false);
 setFocusableWindowState(false);
}

相关文章

JPanel类方法