-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
generic, x86
-
generic, windows_nt
Name: krT82822 Date: 11/20/98
The cursor doesn't change when I run this program, whether the parent class is Component or JComponent. However if I extend from JButton, it does work.
import java.awt.*;
import javax.swing.*;
class SetCursor extends Component {
SetCursor() {
//
setCursor(Cursor.getPredefinedCursor(Cursor./*i*/HAND_CURSOR/**/));
//
}
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
g2d.drawOval(0, 0, getSize().width-1, getSize().height-1);
}
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.getContentPane().add(new SetCursor());
frame.setSize(300, 300);
frame.setVisible(true);
}
}
(Review ID: 42777)
======================================================================
- duplicates
-
JDK-4114073 Can't set cursor in JPanel or JComponent
-
- Closed
-