-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathChangeCursor.java
More file actions
52 lines (38 loc) · 1.11 KB
/
ChangeCursor.java
File metadata and controls
52 lines (38 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package gui;
/**
* RUN:
* javac gui/ChangeCursor.java && java gui.ChangeCursor
* OUTPUT:
*
*/
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.text.*;
import net.mindview.util.*;
public class ChangeCursor extends JFrame {
private JButton b0 = new JButton("Button 0");
private JButton b1 = new JButton("Button 1");
private JButton b2 = new JButton("Button 2");
private JButton b3 = new JButton("Button 3");
public ChangeCursor() {
super();
b0.setCursor(new Cursor(Cursor.HAND_CURSOR));
b1.setCursor(new Cursor(Cursor.WAIT_CURSOR));
b2.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
b3.setCursor(new Cursor(Cursor.MOVE_CURSOR));
// Create panell
JPanel panel = new JPanel(new GridBagLayout());
panel.add(b0);
panel.add(b1);
panel.add(b2);
panel.add(b3);
add(panel);
}
public static void main(String[] args) {
SwingConsole.run(new ChangeCursor(), 475, 425);
}
}