-
Bug
-
Resolution: Fixed
-
P2
-
1.1.4
-
1.1.6
-
x86
-
windows_nt
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2016593 | 1.2.0 | Creighton Chong | P2 | Resolved | Fixed | 1.2beta3 |
Name: sg39081 Date: 08/20/97
In JDK 1.1.4G, calling repaint() on a lightweight component
causes 2 calls to paint(). This bug has been introduced since JDK
1.1.3.
Ramifications: All products using lightweight components are significantly
slower than they need to be. I believe this deserves showstopper status.
Test case: Run the following Java application. Note that pressing
the Button causes only one "Repaint" message, but two "Paint" messages.
-----------------------------------------------
import java.awt.*;
import java.awt.event.*;
public class DoubleRepaint extends Frame implements ActionListener
{
public static void main(String[] args)
{
(new DoubleRepaint()).setVisible(true);
}
public DoubleRepaint()
{
Button b = new Button("Press me");
b.addActionListener(this);
add(b, BorderLayout.SOUTH);
_counter = new CounterComp();
add(_counter);
pack();
}
public void actionPerformed(ActionEvent e)
{
_counter.repaint();
}
private CounterComp _counter;
}
class CounterComp extends Component
{
public Dimension getPreferredSize()
{
return new Dimension(50, 50);
}
public void repaint(long tm, int x, int y, int width, int height)
{
System.out.println("Repaint #" + (++_repaintCount));
super.repaint(tm, x, y, width, height);
}
public void paint(Graphics g)
{
System.out.println("Paint #" + (++_paintCount));
}
private int _paintCount, _repaintCount;
}
company - Oracle , email - ###@###.###
======================================================================
- backported by
-
JDK-2016593 1.1.4G regression - repaint on a lightweight component
- Resolved