-
Bug
-
Resolution: Fixed
-
P3
-
None
-
None
The following code does not render with -Dsun.java2d.metal=true
public class Render extends JPanel {
static BufferedImage bi;
public static void main(String[] args) throws IOException {
bi = ImageIO.read(Render.class.getClassLoader().getResource("lion.jpeg"));
SwingUtilities.invokeLater(() -> {
JFrame f = new JFrame();
f.add(new Render());
f.setPreferredSize(new Dimension(250, 250));
f.pack();
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.setVisible(true);
});
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D)g;
g2d.drawImage(bi, 0, 0, 100, 100, null);
}
}
public class Render extends JPanel {
static BufferedImage bi;
public static void main(String[] args) throws IOException {
bi = ImageIO.read(Render.class.getClassLoader().getResource("lion.jpeg"));
SwingUtilities.invokeLater(() -> {
JFrame f = new JFrame();
f.add(new Render());
f.setPreferredSize(new Dimension(250, 250));
f.pack();
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.setVisible(true);
});
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D)g;
g2d.drawImage(bi, 0, 0, 100, 100, null);
}
}