-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.2.0
-
x86
-
windows_nt
Name: bk70084 Date: 06/02/98
We have a large application which encodes and draws a character stream in one of the components. This component is packed
into an JInternalFrame, which is packed in a JDesktopPane, which is packed in a JPanel, and at last level a Frame.
The problem is, if user moves the JInternalFrame the paint()
method receives an old graphics object and draws on the old position. Same by repaint() call.
If the user resizes the JInternalFrame it repaints correctly.
We've tried to make our component awt.Component, JComponent, JPanel,
to enable/disable doublebuffering, to overwrite all possible functions and classes but nothing helps.
Run the following application, and drag the JInternalFrame around. It has a bad case of the "jitters",
but also doesn't repaint correctly some of the time, even after you let go of it.
//--------------------Test.java-------------------------
import java.awt.*;
import java.awt.swing.*;
class Test
{
Frame frame;
JDesktopPane desktop;
JInternalFrame intFrame;
public static void main(String args[])
{
Test t = new Test();
}
public Test()
{
frame = new Frame("Top Frame");
frame.setSize(400,400);
desktop = new JDesktopPane();
intFrame = new JInternalFrame("Internal Frame", true, true, true,true);
intFrame.setSize(100,100);
intFrame.getContentPane().add(new MyComponent());
desktop.add(intFrame);
//frame.getContentPane().add(desktop);
frame.add(desktop);
frame.setVisible(true);
}
}
class MyComponent extends Canvas
{
public void paint(Graphics g)
{
g.drawString("Hello World!", 20, 40);
}
}
(Review ID: 32677)
======================================================================
- relates to
-
JDK-4135473 JInternalFrame displaces its content
-
- Resolved
-