-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
8
-
x86_64
-
windows_7
FULL PRODUCT VERSION :
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b129)
Java HotSpot(TM) Client VM (build 25.0-b69, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
I added a JTable inside a JScrollpane and put some Images into the Table. After Scrolling the Table up and down, the whole table is covered with mystic artifacts. It is not properly painted.
REGRESSION. Last worked in version 7u51
ADDITIONAL REGRESSION INFORMATION:
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
execute the code below and scroll the table some times up and down usind your mouse. (maybe you have to do it quite fast) Release the mouse button and see, what happend. Some times if you selsct one cell or column header, some more artifacts will be produced.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
the Swing components should be painted as they do in Java Version 7.
ACTUAL -
the table is covered with mystic artifacts. (rectangular white regions)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
no error message
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package java8;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import javax.swing.table.DefaultTableModel;
public class ImagePaintTest implements Runnable {
public static void main(String[] args) {
System.out.println(System.getProperty("java.version"));
SwingUtilities.invokeLater(new ImagePaintTest());
}
public void run() {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
DefaultTableModel model = new DefaultTableModel();
model.addColumn("Text");
model.addColumn("Image");
JTable table = new JTable(model);
table.getColumnModel().getColumn(1)
.setCellRenderer(table.getDefaultRenderer(ImageIcon.class));
for (int i = 0; i < 10; i++) {
model.addRow(new Object[] { "row " + (i + 1), new ImageIcon(createImage(96, 96)) });
}
table.setRowHeight(100);
JScrollPane sp = new JScrollPane(table);
frame.add(sp, BorderLayout.CENTER);
frame.add(new JLabel(new ImageIcon(createImage(96, 96))), BorderLayout.SOUTH);
frame.pack();
frame.setVisible(true);
}
public BufferedImage createImage(int width, int height) {
BufferedImage image = new BufferedImage(width, height,
BufferedImage.TYPE_INT_ARGB);
Graphics2D g = (Graphics2D) image.getGraphics();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.setPaint(Color.WHITE);
g.fillRect(0, 0, width, height);
g.setPaint(new Color(255, 0, 0, 127));
g.drawRect(0, 0, width - 1, height - 1);
g.drawOval(0, 0, width - 1, height - 1);
return image;
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
no known workaround
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b129)
Java HotSpot(TM) Client VM (build 25.0-b69, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
I added a JTable inside a JScrollpane and put some Images into the Table. After Scrolling the Table up and down, the whole table is covered with mystic artifacts. It is not properly painted.
REGRESSION. Last worked in version 7u51
ADDITIONAL REGRESSION INFORMATION:
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
execute the code below and scroll the table some times up and down usind your mouse. (maybe you have to do it quite fast) Release the mouse button and see, what happend. Some times if you selsct one cell or column header, some more artifacts will be produced.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
the Swing components should be painted as they do in Java Version 7.
ACTUAL -
the table is covered with mystic artifacts. (rectangular white regions)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
no error message
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package java8;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import javax.swing.table.DefaultTableModel;
public class ImagePaintTest implements Runnable {
public static void main(String[] args) {
System.out.println(System.getProperty("java.version"));
SwingUtilities.invokeLater(new ImagePaintTest());
}
public void run() {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
DefaultTableModel model = new DefaultTableModel();
model.addColumn("Text");
model.addColumn("Image");
JTable table = new JTable(model);
table.getColumnModel().getColumn(1)
.setCellRenderer(table.getDefaultRenderer(ImageIcon.class));
for (int i = 0; i < 10; i++) {
model.addRow(new Object[] { "row " + (i + 1), new ImageIcon(createImage(96, 96)) });
}
table.setRowHeight(100);
JScrollPane sp = new JScrollPane(table);
frame.add(sp, BorderLayout.CENTER);
frame.add(new JLabel(new ImageIcon(createImage(96, 96))), BorderLayout.SOUTH);
frame.pack();
frame.setVisible(true);
}
public BufferedImage createImage(int width, int height) {
BufferedImage image = new BufferedImage(width, height,
BufferedImage.TYPE_INT_ARGB);
Graphics2D g = (Graphics2D) image.getGraphics();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.setPaint(Color.WHITE);
g.fillRect(0, 0, width, height);
g.setPaint(new Color(255, 0, 0, 127));
g.drawRect(0, 0, width - 1, height - 1);
g.drawOval(0, 0, width - 1, height - 1);
return image;
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
no known workaround