Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/jdk/java/awt/Cursor/HeadlessCursor.java
41149 views
1
/*
2
* Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
import java.awt.*;
25
26
/*
27
* @test
28
* @summary Check that Cursor constructors and methods do not throw unexpected
29
* exceptions in headless mode
30
* @run main/othervm -Djava.awt.headless=true HeadlessCursor
31
*/
32
33
public class HeadlessCursor {
34
public static void main(String args[]) {
35
Cursor c;
36
c = new Cursor(Cursor.CROSSHAIR_CURSOR);
37
c.getType();
38
c.getName();
39
c = new Cursor(Cursor.DEFAULT_CURSOR);
40
c.getType();
41
c.getName();
42
c = new Cursor(Cursor.E_RESIZE_CURSOR);
43
c.getType();
44
c.getName();
45
c = new Cursor(Cursor.HAND_CURSOR);
46
c.getType();
47
c.getName();
48
c = new Cursor(Cursor.N_RESIZE_CURSOR);
49
c.getType();
50
c.getName();
51
c = new Cursor(Cursor.NE_RESIZE_CURSOR);
52
c.getType();
53
c.getName();
54
c = new Cursor(Cursor.NW_RESIZE_CURSOR);
55
c.getType();
56
c.getName();
57
c = new Cursor(Cursor.S_RESIZE_CURSOR);
58
c.getType();
59
c.getName();
60
c = new Cursor(Cursor.SE_RESIZE_CURSOR);
61
c.getType();
62
c.getName();
63
c = new Cursor(Cursor.SW_RESIZE_CURSOR);
64
c.getType();
65
c.getName();
66
c = new Cursor(Cursor.TEXT_CURSOR);
67
c.getType();
68
c.getName();
69
c = new Cursor(Cursor.W_RESIZE_CURSOR);
70
c.getType();
71
c.getName();
72
c = new Cursor(Cursor.WAIT_CURSOR);
73
c.getType();
74
c.getName();
75
76
c = Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR);
77
c = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
78
c = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR);
79
c = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
80
c = Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR);
81
c = Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR);
82
c = Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR);
83
c = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR);
84
c = Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR);
85
c = Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR);
86
c = Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR);
87
c = Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR);
88
c = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
89
c = Cursor.getDefaultCursor();
90
c.getType();
91
c.getName();
92
}
93
}
94
95