-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.3.0
-
x86
-
windows_nt
Name: sg39081 Date: 05/24/2000
1)
- run the following program (java paint_bug)
- press "Show Dialog" to bring a big dialog on the top of the frame
- press "Write 12345" to change the text in the frame
- press "Close Dialog"
Now, you can see that the content of the two text fields has NOT
been painted. you can see the new content if you select one
of the two fields. If you retry the procedure but you move the
dialog outside the frame, you will see that the content is updated
immediatly, without any problem.
Resolution and # of colors using: 1280x1024x24bits
Not using the 3D or soft cursors, or desktop "themes"?
This scenario (Big dialog over a small frame) is not very likely
in a real application, but I've seen A LOT of simmilar bug
in the complex application i'm developing, with JListBox,
Highlighter, ... all of which appearing when you modify a
component partially or totally hidden by another. this is very
annoying. I also suspect that it is related to the "most wanted"
bug 4189244. PLEASE go to the bottom of this bug ASAP, it will
probably make a lot of people happy. there is definitivly
big painting problem with JAVA2/NT.
I don't know if this one is really a Bug, but during my current development,
(a complex GUI app), I've seen many painting problem that appears from
time to time (with highlighter, list box, sub dialogs, and the famous 4189244)
What is common with all the painting problem i've seen is that they always
occur when you try to draw to a window that is (partially) covered by
another window.
I will file another bug for the stack trace that you have
probably noticed during this experiment ;-)
2)
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
public class paint_bug {
public static void main(String[] args){
JFrame frame = new JFrame("Bug");
JButton showDlg = new JButton("Show Dialog");
final JTextField tf1 = new JTextField();
final JTextField tf2 = new JTextField();
frame.getContentPane().add(tf1, BorderLayout.NORTH);
frame.getContentPane().add(tf2, BorderLayout.CENTER);
frame.getContentPane().add(showDlg, BorderLayout.SOUTH);
frame.pack();
centerWindowOnScreen(frame);
final JDialog dialog = new JDialog(frame, "Update Frame");
JButton btn1 = new JButton("Write AAAAAAA");
JButton btn2 = new JButton("Write 12345");
JButton closeDlg = new JButton("Close Dialog");
dialog.getContentPane().add(btn1, BorderLayout.NORTH);
dialog.getContentPane().add(btn2, BorderLayout.CENTER);
dialog.getContentPane().add(closeDlg, BorderLayout.SOUTH);
dialog.setSize(new Dimension(300, 300));
centerWindowOnScreen(dialog);
showDlg.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dialog.show();
}});
btn1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
tf1.setText("AAAAAAA"); tf2.setText("AAAAAAA");
}});
btn2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
tf1.setText("12345"); tf2.setText("12345");
}});
closeDlg.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dialog.dispose();
}});
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}});
frame.show();
}
static void centerWindowOnScreen(Window win) {
Toolkit tk = win.getToolkit();
Dimension screenSize = tk.getScreenSize();
Dimension winSize = win.getSize();
int x = (screenSize.width - winSize.width)/2;
int y = (screenSize.height - winSize.height)/2;
if(x < 0) x = 0;
if(y < 0) y = 0;
win.setLocation(x, y);
}
}
3)java version "1.3beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O)
Java(TM) HotSpot Client VM (build 1.3beta-O, mixed mode)
I have tested this against the FCS release and the problem is
also there.
this bug (without the stack trace) also appears in 1.2.2.
(Review ID: 96811)
======================================================================
- duplicates
-
JDK-4343423 Repaint fails for hidden components
-
- Closed
-