-
Bug
-
Resolution: Fixed
-
P3
-
1.4.1, 1.4.2, 5.0
-
b28
-
x86
-
linux, linux_redhat_9.0
Run the following test case and notice that when the app is brought up
the panel is painted twice.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.plaf.basic.*;
public class Test {
public static void main(String[] args) throws Throwable {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
show();
}
});
}
private static void show() {
JFrame frame = new JFrame("TEST");
JComponent button = new JPanel() {
public void paint(Graphics g) {
super.paint(g);
System.out.println("----------PAINTING---------------------");
System.out.println("widget bounds: " + getBounds());
System.out.println("clip: " + g.getClip());
}
};
frame.setLayout(new FlowLayout());
frame.add(button);
frame.pack();
frame.show();
}
}
the panel is painted twice.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.plaf.basic.*;
public class Test {
public static void main(String[] args) throws Throwable {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
show();
}
});
}
private static void show() {
JFrame frame = new JFrame("TEST");
JComponent button = new JPanel() {
public void paint(Graphics g) {
super.paint(g);
System.out.println("----------PAINTING---------------------");
System.out.println("widget bounds: " + getBounds());
System.out.println("clip: " + g.getClip());
}
};
frame.setLayout(new FlowLayout());
frame.add(button);
frame.pack();
frame.show();
}
}
- duplicates
-
JDK-4924235 1.4 REGRESSION: Box doesn't paint background as content pane
- Closed
- relates to
-
JDK-6877797 paintComponent used one or many times with jre1.6.0_07 and jre1.6.016
- Open
-
JDK-6215263 REGRESSION: paint() method not called on JFrame on JDK 1.5
- Closed
-
JDK-6434412 Error in the paint method of JDialog
- Closed