Repository navigation
Expand file tree
/
Copy pathDesktop.html
More file actions
1229 lines (1213 loc) · 66.6 KB
/
Copy pathDesktop.html
File metadata and controls
1229 lines (1213 loc) · 66.6 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Desktop (Java SE 12 & JDK 12 )</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="java.awt.Desktop class">
<meta name="keywords" content="getDesktop()">
<meta name="keywords" content="isDesktopSupported()">
<meta name="keywords" content="isSupported()">
<meta name="keywords" content="open()">
<meta name="keywords" content="edit()">
<meta name="keywords" content="print()">
<meta name="keywords" content="browse()">
<meta name="keywords" content="mail()">
<meta name="keywords" content="addAppEventListener()">
<meta name="keywords" content="removeAppEventListener()">
<meta name="keywords" content="setAboutHandler()">
<meta name="keywords" content="setPreferencesHandler()">
<meta name="keywords" content="setOpenFileHandler()">
<meta name="keywords" content="setPrintFileHandler()">
<meta name="keywords" content="setOpenURIHandler()">
<meta name="keywords" content="setQuitHandler()">
<meta name="keywords" content="setQuitStrategy()">
<meta name="keywords" content="enableSuddenTermination()">
<meta name="keywords" content="disableSuddenTermination()">
<meta name="keywords" content="requestForeground()">
<meta name="keywords" content="openHelpViewer()">
<meta name="keywords" content="setDefaultMenuBar()">
<meta name="keywords" content="browseFileDirectory()">
<meta name="keywords" content="moveToTrash()">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
<script type="text/javascript" src="../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Desktop (Java SE 12 & JDK 12 )";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":9,"i7":9,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../index.html">Overview</a></li>
<li><a href="../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Desktop.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 & JDK 12</strong> </div></div>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested.class.summary">Nested</a> | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="moduleLabelInType">Module</span> <a href="../../module-summary.html">java.desktop</a></div>
<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">java.awt</a></div>
<h2 title="Class Desktop" class="title">Class Desktop</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="../../../java.base/java/lang/Object.html" title="class in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>java.awt.Desktop</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public class <span class="typeNameLabel">Desktop</span>
extends <a href="../../../java.base/java/lang/Object.html" title="class in java.lang">Object</a></pre>
<div class="block">The <code>Desktop</code> class allows interact with various desktop capabilities.
<p> Supported operations include:
<ul>
<li>launching the user-default browser to show a specified
URI;</li>
<li>launching the user-default mail client with an optional
<code>mailto</code> URI;</li>
<li>launching a registered application to open, edit or print a
specified file.</li>
</ul>
<p> This class provides methods corresponding to these
operations. The methods look for the associated application
registered on the current platform, and launch it to handle a URI
or file. If there is no associated application or the associated
application fails to be launched, an exception is thrown.
Please see <a href="Desktop.Action.html" title="enum in java.awt"><code>Desktop.Action</code></a> for the full list of supported operations
and capabilities.
<p> An application is registered to a URI or file type.
The mechanism of registering, accessing, and
launching the associated application is platform-dependent.
<p> Each operation is an action type represented by the <a href="Desktop.Action.html" title="enum in java.awt"><code>Desktop.Action</code></a> class.
<p> Note: when some action is invoked and the associated
application is executed, it will be executed on the same system as
the one on which the Java application was launched.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.6</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="Desktop.Action.html" title="enum in java.awt"><code>Desktop.Action</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<div class="memberSummary">
<table>
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>static class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="Desktop.Action.html" title="enum in java.awt">Desktop.Action</a></span></code></th>
<td class="colLast">
<div class="block">Represents an action type.</div>
</td>
</tr>
</tbody>
</table>
</div>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<div class="memberSummary">
<div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t1" class="tableTab" onclick="show(1);">Static Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t4" class="tableTab" onclick="show(8);">Concrete Methods</button></div>
<div id="memberSummary_tabpanel" role="tabpanel">
<table aria-labelledby="t0">
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor" id="i0">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addAppEventListener(java.awt.desktop.SystemEventListener)">addAppEventListener</a></span>​(<a href="desktop/SystemEventListener.html" title="interface in java.awt.desktop">SystemEventListener</a> listener)</code></th>
<td class="colLast">
<div class="block">Adds sub-types of <a href="desktop/SystemEventListener.html" title="interface in java.awt.desktop"><code>SystemEventListener</code></a> to listen for notifications
from the native system.</div>
</td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#browse(java.net.URI)">browse</a></span>​(<a href="../../../java.base/java/net/URI.html" title="class in java.net">URI</a> uri)</code></th>
<td class="colLast">
<div class="block">Launches the default browser to display a <code>URI</code>.</div>
</td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#browseFileDirectory(java.io.File)">browseFileDirectory</a></span>​(<a href="../../../java.base/java/io/File.html" title="class in java.io">File</a> file)</code></th>
<td class="colLast">
<div class="block">Opens a folder containing the <code>file</code> and selects it
in a default system file manager.</div>
</td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#disableSuddenTermination()">disableSuddenTermination</a></span>()</code></th>
<td class="colLast">
<div class="block">Prevents this application from being suddenly terminated.</div>
</td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#edit(java.io.File)">edit</a></span>​(<a href="../../../java.base/java/io/File.html" title="class in java.io">File</a> file)</code></th>
<td class="colLast">
<div class="block">Launches the associated editor application and opens a file for
editing.</div>
</td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#enableSuddenTermination()">enableSuddenTermination</a></span>()</code></th>
<td class="colLast">
<div class="block">Enables this application to be suddenly terminated.</div>
</td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code>static <a href="Desktop.html" title="class in java.awt">Desktop</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDesktop()">getDesktop</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the <code>Desktop</code> instance of the current
desktop context.</div>
</td>
</tr>
<tr class="rowColor" id="i7">
<td class="colFirst"><code>static boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isDesktopSupported()">isDesktopSupported</a></span>()</code></th>
<td class="colLast">
<div class="block">Tests whether this class is supported on the current platform.</div>
</td>
</tr>
<tr class="altColor" id="i8">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isSupported(java.awt.Desktop.Action)">isSupported</a></span>​(<a href="Desktop.Action.html" title="enum in java.awt">Desktop.Action</a> action)</code></th>
<td class="colLast">
<div class="block">Tests whether an action is supported on the current platform.</div>
</td>
</tr>
<tr class="rowColor" id="i9">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#mail()">mail</a></span>()</code></th>
<td class="colLast">
<div class="block">Launches the mail composing window of the user default mail
client.</div>
</td>
</tr>
<tr class="altColor" id="i10">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#mail(java.net.URI)">mail</a></span>​(<a href="../../../java.base/java/net/URI.html" title="class in java.net">URI</a> mailtoURI)</code></th>
<td class="colLast">
<div class="block">Launches the mail composing window of the user default mail
client, filling the message fields specified by a <code>
mailto:</code> URI.</div>
</td>
</tr>
<tr class="rowColor" id="i11">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#moveToTrash(java.io.File)">moveToTrash</a></span>​(<a href="../../../java.base/java/io/File.html" title="class in java.io">File</a> file)</code></th>
<td class="colLast">
<div class="block">Moves the specified file to the trash.</div>
</td>
</tr>
<tr class="altColor" id="i12">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#open(java.io.File)">open</a></span>​(<a href="../../../java.base/java/io/File.html" title="class in java.io">File</a> file)</code></th>
<td class="colLast">
<div class="block">Launches the associated application to open the file.</div>
</td>
</tr>
<tr class="rowColor" id="i13">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#openHelpViewer()">openHelpViewer</a></span>()</code></th>
<td class="colLast">
<div class="block">Opens the native help viewer application.</div>
</td>
</tr>
<tr class="altColor" id="i14">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#print(java.io.File)">print</a></span>​(<a href="../../../java.base/java/io/File.html" title="class in java.io">File</a> file)</code></th>
<td class="colLast">
<div class="block">Prints a file with the native desktop printing facility, using
the associated application's print command.</div>
</td>
</tr>
<tr class="rowColor" id="i15">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeAppEventListener(java.awt.desktop.SystemEventListener)">removeAppEventListener</a></span>​(<a href="desktop/SystemEventListener.html" title="interface in java.awt.desktop">SystemEventListener</a> listener)</code></th>
<td class="colLast">
<div class="block">Removes sub-types of <a href="desktop/SystemEventListener.html" title="interface in java.awt.desktop"><code>SystemEventListener</code></a> to listen for notifications
from the native system.</div>
</td>
</tr>
<tr class="altColor" id="i16">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#requestForeground(boolean)">requestForeground</a></span>​(boolean allWindows)</code></th>
<td class="colLast">
<div class="block">Requests this application to move to the foreground.</div>
</td>
</tr>
<tr class="rowColor" id="i17">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAboutHandler(java.awt.desktop.AboutHandler)">setAboutHandler</a></span>​(<a href="desktop/AboutHandler.html" title="interface in java.awt.desktop">AboutHandler</a> aboutHandler)</code></th>
<td class="colLast">
<div class="block">Installs a handler to show a custom About window for your application.</div>
</td>
</tr>
<tr class="altColor" id="i18">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setDefaultMenuBar(javax.swing.JMenuBar)">setDefaultMenuBar</a></span>​(<a href="../../javax/swing/JMenuBar.html" title="class in javax.swing">JMenuBar</a> menuBar)</code></th>
<td class="colLast">
<div class="block">Sets the default menu bar to use when there are no active frames.</div>
</td>
</tr>
<tr class="rowColor" id="i19">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setOpenFileHandler(java.awt.desktop.OpenFilesHandler)">setOpenFileHandler</a></span>​(<a href="desktop/OpenFilesHandler.html" title="interface in java.awt.desktop">OpenFilesHandler</a> openFileHandler)</code></th>
<td class="colLast">
<div class="block">Installs the handler which is notified when the application is asked to
open a list of files.</div>
</td>
</tr>
<tr class="altColor" id="i20">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setOpenURIHandler(java.awt.desktop.OpenURIHandler)">setOpenURIHandler</a></span>​(<a href="desktop/OpenURIHandler.html" title="interface in java.awt.desktop">OpenURIHandler</a> openURIHandler)</code></th>
<td class="colLast">
<div class="block">Installs the handler which is notified when the application is asked to
open a URL.</div>
</td>
</tr>
<tr class="rowColor" id="i21">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setPreferencesHandler(java.awt.desktop.PreferencesHandler)">setPreferencesHandler</a></span>​(<a href="desktop/PreferencesHandler.html" title="interface in java.awt.desktop">PreferencesHandler</a> preferencesHandler)</code></th>
<td class="colLast">
<div class="block">Installs a handler to show a custom Preferences window for your
application.</div>
</td>
</tr>
<tr class="altColor" id="i22">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setPrintFileHandler(java.awt.desktop.PrintFilesHandler)">setPrintFileHandler</a></span>​(<a href="desktop/PrintFilesHandler.html" title="interface in java.awt.desktop">PrintFilesHandler</a> printFileHandler)</code></th>
<td class="colLast">
<div class="block">Installs the handler which is notified when the application is asked to
print a list of files.</div>
</td>
</tr>
<tr class="rowColor" id="i23">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setQuitHandler(java.awt.desktop.QuitHandler)">setQuitHandler</a></span>​(<a href="desktop/QuitHandler.html" title="interface in java.awt.desktop">QuitHandler</a> quitHandler)</code></th>
<td class="colLast">
<div class="block">Installs the handler which determines if the application should quit.</div>
</td>
</tr>
<tr class="altColor" id="i24">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setQuitStrategy(java.awt.desktop.QuitStrategy)">setQuitStrategy</a></span>​(<a href="desktop/QuitStrategy.html" title="enum in java.awt.desktop">QuitStrategy</a> strategy)</code></th>
<td class="colLast">
<div class="block">Sets the default strategy used to quit this application.</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods declared in class java.lang.<a href="../../../java.base/java/lang/Object.html" title="class in java.lang">Object</a></h3>
<code><a href="../../../java.base/java/lang/Object.html#clone()">clone</a>, <a href="../../../java.base/java/lang/Object.html#equals(java.lang.Object)">equals</a>, <a href="../../../java.base/java/lang/Object.html#finalize()">finalize</a>, <a href="../../../java.base/java/lang/Object.html#getClass()">getClass</a>, <a href="../../../java.base/java/lang/Object.html#hashCode()">hashCode</a>, <a href="../../../java.base/java/lang/Object.html#notify()">notify</a>, <a href="../../../java.base/java/lang/Object.html#notifyAll()">notifyAll</a>, <a href="../../../java.base/java/lang/Object.html#toString()">toString</a>, <a href="../../../java.base/java/lang/Object.html#wait()">wait</a>, <a href="../../../java.base/java/lang/Object.html#wait(long)">wait</a>, <a href="../../../java.base/java/lang/Object.html#wait(long,int)">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="getDesktop()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDesktop</h4>
<pre class="methodSignature">public static <a href="Desktop.html" title="class in java.awt">Desktop</a> getDesktop()</pre>
<div class="block">Returns the <code>Desktop</code> instance of the current
desktop context. On some platforms the Desktop API may not be
supported; use the <a href="#isDesktopSupported()"><code>isDesktopSupported()</code></a> method to
determine if the current desktop is supported.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the Desktop instance</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="HeadlessException.html" title="class in java.awt">HeadlessException</a></code> - if <a href="GraphicsEnvironment.html#isHeadless()"><code>GraphicsEnvironment.isHeadless()</code></a> returns <code>true</code></dd>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if this class is not
supported on the current platform</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#isDesktopSupported()"><code>isDesktopSupported()</code></a>,
<a href="GraphicsEnvironment.html#isHeadless()"><code>GraphicsEnvironment.isHeadless()</code></a></dd>
</dl>
</li>
</ul>
<a id="isDesktopSupported()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isDesktopSupported</h4>
<pre class="methodSignature">public static boolean isDesktopSupported()</pre>
<div class="block">Tests whether this class is supported on the current platform.
If it's supported, use <a href="#getDesktop()"><code>getDesktop()</code></a> to retrieve an
instance.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if this class is supported on the
current platform; <code>false</code> otherwise</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#getDesktop()"><code>getDesktop()</code></a></dd>
</dl>
</li>
</ul>
<a id="isSupported(java.awt.Desktop.Action)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSupported</h4>
<pre class="methodSignature">public boolean isSupported​(<a href="Desktop.Action.html" title="enum in java.awt">Desktop.Action</a> action)</pre>
<div class="block">Tests whether an action is supported on the current platform.
<p>Even when the platform supports an action, a file or URI may
not have a registered application for the action. For example,
most of the platforms support the <a href="Desktop.Action.html#OPEN"><code>Desktop.Action.OPEN</code></a>
action. But for a specific file, there may not be an
application registered to open it. In this case, <a href="#isSupported(java.awt.Desktop.Action)"><code>isSupported(Action)</code></a> may return <code>true</code>, but the corresponding
action method will throw an <a href="../../../java.base/java/io/IOException.html" title="class in java.io"><code>IOException</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>action</code> - the specified <a href="Desktop.Action.html" title="enum in java.awt"><code>Desktop.Action</code></a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if the specified action is supported on
the current platform; <code>false</code> otherwise</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="Desktop.Action.html" title="enum in java.awt"><code>Desktop.Action</code></a></dd>
</dl>
</li>
</ul>
<a id="open(java.io.File)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>open</h4>
<pre class="methodSignature">public void open​(<a href="../../../java.base/java/io/File.html" title="class in java.io">File</a> file)
throws <a href="../../../java.base/java/io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">Launches the associated application to open the file.
<p> If the specified file is a directory, the file manager of
the current platform is launched to open it.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - the file to be opened with the associated application</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if <code>file</code> is <code>null</code></dd>
<dd><code><a href="../../../java.base/java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if the specified file doesn't
exist</dd>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if the current platform
does not support the <a href="Desktop.Action.html#OPEN"><code>Desktop.Action.OPEN</code></a> action</dd>
<dd><code><a href="../../../java.base/java/io/IOException.html" title="class in java.io">IOException</a></code> - if the specified file has no associated
application or the associated application fails to be launched</dd>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and its
<a href="../../../java.base/java/lang/SecurityManager.html#checkRead(java.lang.String)"><code>SecurityManager.checkRead(java.lang.String)</code></a>
method denies read access to the file, or it denies the
<code>AWTPermission("showWindowWithoutWarningBanner")</code>
permission, or the calling thread is not allowed to create a
subprocess</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="AWTPermission.html" title="class in java.awt"><code>AWTPermission</code></a></dd>
</dl>
</li>
</ul>
<a id="edit(java.io.File)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>edit</h4>
<pre class="methodSignature">public void edit​(<a href="../../../java.base/java/io/File.html" title="class in java.io">File</a> file)
throws <a href="../../../java.base/java/io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">Launches the associated editor application and opens a file for
editing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - the file to be opened for editing</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified file is <code>null</code></dd>
<dd><code><a href="../../../java.base/java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if the specified file doesn't
exist</dd>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if the current platform
does not support the <a href="Desktop.Action.html#EDIT"><code>Desktop.Action.EDIT</code></a> action</dd>
<dd><code><a href="../../../java.base/java/io/IOException.html" title="class in java.io">IOException</a></code> - if the specified file has no associated
editor, or the associated application fails to be launched</dd>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and its
<a href="../../../java.base/java/lang/SecurityManager.html#checkRead(java.lang.String)"><code>SecurityManager.checkRead(java.lang.String)</code></a>
method denies read access to the file, or <a href="../../../java.base/java/lang/SecurityManager.html#checkWrite(java.lang.String)"><code>SecurityManager.checkWrite(java.lang.String)</code></a> method
denies write access to the file, or it denies the
<code>AWTPermission("showWindowWithoutWarningBanner")</code>
permission, or the calling thread is not allowed to create a
subprocess</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="AWTPermission.html" title="class in java.awt"><code>AWTPermission</code></a></dd>
</dl>
</li>
</ul>
<a id="print(java.io.File)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>print</h4>
<pre class="methodSignature">public void print​(<a href="../../../java.base/java/io/File.html" title="class in java.io">File</a> file)
throws <a href="../../../java.base/java/io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">Prints a file with the native desktop printing facility, using
the associated application's print command.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - the file to be printed</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified file is <code>
null</code></dd>
<dd><code><a href="../../../java.base/java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if the specified file doesn't
exist</dd>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if the current platform
does not support the <a href="Desktop.Action.html#PRINT"><code>Desktop.Action.PRINT</code></a> action</dd>
<dd><code><a href="../../../java.base/java/io/IOException.html" title="class in java.io">IOException</a></code> - if the specified file has no associated
application that can be used to print it</dd>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and its
<a href="../../../java.base/java/lang/SecurityManager.html#checkRead(java.lang.String)"><code>SecurityManager.checkRead(java.lang.String)</code></a>
method denies read access to the file, or its <a href="../../../java.base/java/lang/SecurityManager.html#checkPrintJobAccess()"><code>SecurityManager.checkPrintJobAccess()</code></a> method denies
the permission to print the file, or the calling thread is not
allowed to create a subprocess</dd>
</dl>
</li>
</ul>
<a id="browse(java.net.URI)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>browse</h4>
<pre class="methodSignature">public void browse​(<a href="../../../java.base/java/net/URI.html" title="class in java.net">URI</a> uri)
throws <a href="../../../java.base/java/io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">Launches the default browser to display a <code>URI</code>.
If the default browser is not able to handle the specified
<code>URI</code>, the application registered for handling
<code>URIs</code> of the specified type is invoked. The application
is determined from the protocol and path of the <code>URI</code>, as
defined by the <code>URI</code> class.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>uri</code> - the URI to be displayed in the user default browser</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if <code>uri</code> is <code>null</code></dd>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if the current platform
does not support the <a href="Desktop.Action.html#BROWSE"><code>Desktop.Action.BROWSE</code></a> action</dd>
<dd><code><a href="../../../java.base/java/io/IOException.html" title="class in java.io">IOException</a></code> - if the user default browser is not found,
or it fails to be launched, or the default handler application
failed to be launched</dd>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and it
denies the
<code>AWTPermission("showWindowWithoutWarningBanner")</code>
permission, or the calling thread is not allowed to create a
subprocess</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../java.base/java/net/URI.html" title="class in java.net"><code>URI</code></a>,
<a href="AWTPermission.html" title="class in java.awt"><code>AWTPermission</code></a></dd>
</dl>
</li>
</ul>
<a id="mail()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>mail</h4>
<pre class="methodSignature">public void mail()
throws <a href="../../../java.base/java/io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">Launches the mail composing window of the user default mail
client.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if the current platform
does not support the <a href="Desktop.Action.html#MAIL"><code>Desktop.Action.MAIL</code></a> action</dd>
<dd><code><a href="../../../java.base/java/io/IOException.html" title="class in java.io">IOException</a></code> - if the user default mail client is not
found, or it fails to be launched</dd>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and it
denies the
<code>AWTPermission("showWindowWithoutWarningBanner")</code>
permission, or the calling thread is not allowed to create a
subprocess</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="AWTPermission.html" title="class in java.awt"><code>AWTPermission</code></a></dd>
</dl>
</li>
</ul>
<a id="mail(java.net.URI)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>mail</h4>
<pre class="methodSignature">public void mail​(<a href="../../../java.base/java/net/URI.html" title="class in java.net">URI</a> mailtoURI)
throws <a href="../../../java.base/java/io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">Launches the mail composing window of the user default mail
client, filling the message fields specified by a <code>
mailto:</code> URI.
<p> A <code>mailto:</code> URI can specify message fields
including <i>"to"</i>, <i>"cc"</i>, <i>"subject"</i>,
<i>"body"</i>, etc. See <a href="http://www.ietf.org/rfc/rfc2368.txt">The mailto URL
scheme (RFC 2368)</a> for the <code>mailto:</code> URI specification
details.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>mailtoURI</code> - the specified <code>mailto:</code> URI</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified URI is <code>
null</code></dd>
<dd><code><a href="../../../java.base/java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if the URI scheme is not
<code>"mailto"</code></dd>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if the current platform
does not support the <a href="Desktop.Action.html#MAIL"><code>Desktop.Action.MAIL</code></a> action</dd>
<dd><code><a href="../../../java.base/java/io/IOException.html" title="class in java.io">IOException</a></code> - if the user default mail client is not
found or fails to be launched</dd>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and it
denies the
<code>AWTPermission("showWindowWithoutWarningBanner")</code>
permission, or the calling thread is not allowed to create a
subprocess</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../java.base/java/net/URI.html" title="class in java.net"><code>URI</code></a>,
<a href="AWTPermission.html" title="class in java.awt"><code>AWTPermission</code></a></dd>
</dl>
</li>
</ul>
<a id="addAppEventListener(java.awt.desktop.SystemEventListener)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addAppEventListener</h4>
<pre class="methodSignature">public void addAppEventListener​(<a href="desktop/SystemEventListener.html" title="interface in java.awt.desktop">SystemEventListener</a> listener)</pre>
<div class="block">Adds sub-types of <a href="desktop/SystemEventListener.html" title="interface in java.awt.desktop"><code>SystemEventListener</code></a> to listen for notifications
from the native system.
Has no effect if SystemEventListener's sub-type is unsupported on the current
platform.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>listener</code> - listener</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and it
denies the
<code>RuntimePermission("canProcessApplicationEvents")</code>
permission</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>9</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="desktop/AppForegroundListener.html" title="interface in java.awt.desktop"><code>AppForegroundListener</code></a>,
<a href="desktop/AppHiddenListener.html" title="interface in java.awt.desktop"><code>AppHiddenListener</code></a>,
<a href="desktop/AppReopenedListener.html" title="interface in java.awt.desktop"><code>AppReopenedListener</code></a>,
<a href="desktop/ScreenSleepListener.html" title="interface in java.awt.desktop"><code>ScreenSleepListener</code></a>,
<a href="desktop/SystemSleepListener.html" title="interface in java.awt.desktop"><code>SystemSleepListener</code></a>,
<a href="desktop/UserSessionListener.html" title="interface in java.awt.desktop"><code>UserSessionListener</code></a></dd>
</dl>
</li>
</ul>
<a id="removeAppEventListener(java.awt.desktop.SystemEventListener)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeAppEventListener</h4>
<pre class="methodSignature">public void removeAppEventListener​(<a href="desktop/SystemEventListener.html" title="interface in java.awt.desktop">SystemEventListener</a> listener)</pre>
<div class="block">Removes sub-types of <a href="desktop/SystemEventListener.html" title="interface in java.awt.desktop"><code>SystemEventListener</code></a> to listen for notifications
from the native system.
Has no effect if SystemEventListener's sub-type is unsupported on the current
platform.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>listener</code> - listener</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and it
denies the
<code>RuntimePermission("canProcessApplicationEvents")</code>
permission</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>9</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="desktop/AppForegroundListener.html" title="interface in java.awt.desktop"><code>AppForegroundListener</code></a>,
<a href="desktop/AppHiddenListener.html" title="interface in java.awt.desktop"><code>AppHiddenListener</code></a>,
<a href="desktop/AppReopenedListener.html" title="interface in java.awt.desktop"><code>AppReopenedListener</code></a>,
<a href="desktop/ScreenSleepListener.html" title="interface in java.awt.desktop"><code>ScreenSleepListener</code></a>,
<a href="desktop/SystemSleepListener.html" title="interface in java.awt.desktop"><code>SystemSleepListener</code></a>,
<a href="desktop/UserSessionListener.html" title="interface in java.awt.desktop"><code>UserSessionListener</code></a></dd>
</dl>
</li>
</ul>
<a id="setAboutHandler(java.awt.desktop.AboutHandler)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAboutHandler</h4>
<pre class="methodSignature">public void setAboutHandler​(<a href="desktop/AboutHandler.html" title="interface in java.awt.desktop">AboutHandler</a> aboutHandler)</pre>
<div class="block">Installs a handler to show a custom About window for your application.
<p>
Setting the <a href="desktop/AboutHandler.html" title="interface in java.awt.desktop"><code>AboutHandler</code></a> to <code>null</code> reverts it to the
default behavior.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>aboutHandler</code> - the handler to respond to the
<a href="desktop/AboutHandler.html#handleAbout(java.awt.desktop.AboutEvent)"><code>AboutHandler.handleAbout(AboutEvent)</code></a> message</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and it
denies the
<code>RuntimePermission("canProcessApplicationEvents")</code>
permission</dd>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if the current platform
does not support the <a href="Desktop.Action.html#APP_ABOUT"><code>Desktop.Action.APP_ABOUT</code></a> action</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>9</dd>
</dl>
</li>
</ul>
<a id="setPreferencesHandler(java.awt.desktop.PreferencesHandler)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPreferencesHandler</h4>
<pre class="methodSignature">public void setPreferencesHandler​(<a href="desktop/PreferencesHandler.html" title="interface in java.awt.desktop">PreferencesHandler</a> preferencesHandler)</pre>
<div class="block">Installs a handler to show a custom Preferences window for your
application.
<p>
Setting the <a href="desktop/PreferencesHandler.html" title="interface in java.awt.desktop"><code>PreferencesHandler</code></a> to <code>null</code> reverts it to
the default behavior</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>preferencesHandler</code> - the handler to respond to the
<a href="desktop/PreferencesHandler.html#handlePreferences(java.awt.desktop.PreferencesEvent)"><code>PreferencesHandler.handlePreferences(PreferencesEvent)</code></a></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and it
denies the
<code>RuntimePermission("canProcessApplicationEvents")</code> permission</dd>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if the current platform
does not support the <a href="Desktop.Action.html#APP_PREFERENCES"><code>Desktop.Action.APP_PREFERENCES</code></a> action</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>9</dd>
</dl>
</li>
</ul>
<a id="setOpenFileHandler(java.awt.desktop.OpenFilesHandler)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setOpenFileHandler</h4>
<pre class="methodSignature">public void setOpenFileHandler​(<a href="desktop/OpenFilesHandler.html" title="interface in java.awt.desktop">OpenFilesHandler</a> openFileHandler)</pre>
<div class="block">Installs the handler which is notified when the application is asked to
open a list of files.</div>
<dl>
<dt><span class="simpleTagLabel">Implementation Note:</span></dt>
<dd>Please note that for macOS, notifications
are only sent if the Java app is a bundled application,
with a <code>CFBundleDocumentTypes</code> array present in its
<code>Info.plist</code>. Check the
<a href="https://developer.apple.com/documentation">
Apple Developer Documentation</a> for more information about
<code>Info.plist</code>.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>openFileHandler</code> - handler</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and its
<a href="../../../java.base/java/lang/SecurityManager.html#checkRead(java.lang.String)"><code>SecurityManager.checkRead(java.lang.String)</code></a>
method denies read access to the files, or it denies the
<code>RuntimePermission("canProcessApplicationEvents")</code>
permission, or the calling thread is not allowed to create a
subprocess</dd>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if the current platform
does not support the <a href="Desktop.Action.html#APP_OPEN_FILE"><code>Desktop.Action.APP_OPEN_FILE</code></a> action</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>9</dd>
</dl>
</li>
</ul>
<a id="setPrintFileHandler(java.awt.desktop.PrintFilesHandler)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPrintFileHandler</h4>
<pre class="methodSignature">public void setPrintFileHandler​(<a href="desktop/PrintFilesHandler.html" title="interface in java.awt.desktop">PrintFilesHandler</a> printFileHandler)</pre>
<div class="block">Installs the handler which is notified when the application is asked to
print a list of files.</div>
<dl>
<dt><span class="simpleTagLabel">Implementation Note:</span></dt>
<dd>Please note that for macOS, notifications
are only sent if the Java app is a bundled application,
with a <code>CFBundleDocumentTypes</code> array present in its
<code>Info.plist</code>. Check the
<a href="https://developer.apple.com/documentation">
Apple Developer Documentation</a> for more information about
<code>Info.plist</code>.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>printFileHandler</code> - handler</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and its
<a href="../../../java.base/java/lang/SecurityManager.html#checkPrintJobAccess()"><code>SecurityManager.checkPrintJobAccess()</code></a> method denies
the permission to print or it denies the
<code>RuntimePermission("canProcessApplicationEvents")</code> permission</dd>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if the current platform
does not support the <a href="Desktop.Action.html#APP_PRINT_FILE"><code>Desktop.Action.APP_PRINT_FILE</code></a> action</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>9</dd>
</dl>
</li>
</ul>
<a id="setOpenURIHandler(java.awt.desktop.OpenURIHandler)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setOpenURIHandler</h4>
<pre class="methodSignature">public void setOpenURIHandler​(<a href="desktop/OpenURIHandler.html" title="interface in java.awt.desktop">OpenURIHandler</a> openURIHandler)</pre>
<div class="block">Installs the handler which is notified when the application is asked to
open a URL.
Setting the handler to <code>null</code> causes all
<a href="desktop/OpenURIHandler.html#openURI(java.awt.desktop.OpenURIEvent)"><code>OpenURIHandler.openURI(OpenURIEvent)</code></a> requests to be
enqueued until another handler is set.</div>
<dl>
<dt><span class="simpleTagLabel">Implementation Note:</span></dt>
<dd>Please note that for macOS, notifications
are only sent if the Java app is a bundled application,
with a <code>CFBundleDocumentTypes</code> array present in its
<code>Info.plist</code>. Check the
<a href="https://developer.apple.com/documentation">
Apple Developer Documentation</a> for more information about
<code>Info.plist</code>.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>openURIHandler</code> - handler
<code>RuntimePermission("canProcessApplicationEvents")</code>
permission, or the calling thread is not allowed to create a
subprocess</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if the current platform
does not support the <a href="Desktop.Action.html#APP_OPEN_URI"><code>Desktop.Action.APP_OPEN_URI</code></a> action</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>9</dd>
</dl>
</li>
</ul>
<a id="setQuitHandler(java.awt.desktop.QuitHandler)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setQuitHandler</h4>
<pre class="methodSignature">public void setQuitHandler​(<a href="desktop/QuitHandler.html" title="interface in java.awt.desktop">QuitHandler</a> quitHandler)</pre>
<div class="block">Installs the handler which determines if the application should quit. The
handler is passed a one-shot <a href="desktop/QuitResponse.html" title="interface in java.awt.desktop"><code>QuitResponse</code></a> which can cancel or
proceed with the quit. Setting the handler to <code>null</code> causes
all quit requests to directly perform the default <a href="desktop/QuitStrategy.html" title="enum in java.awt.desktop"><code>QuitStrategy</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>quitHandler</code> - the handler that is called when the application is
asked to quit</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and it
will not allow the caller to invoke <code>System.exit</code> or it denies the
<code>RuntimePermission("canProcessApplicationEvents")</code> permission</dd>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if the current platform
does not support the <a href="Desktop.Action.html#APP_QUIT_HANDLER"><code>Desktop.Action.APP_QUIT_HANDLER</code></a> action</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>9</dd>
</dl>
</li>
</ul>
<a id="setQuitStrategy(java.awt.desktop.QuitStrategy)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setQuitStrategy</h4>
<pre class="methodSignature">public void setQuitStrategy​(<a href="desktop/QuitStrategy.html" title="enum in java.awt.desktop">QuitStrategy</a> strategy)</pre>
<div class="block">Sets the default strategy used to quit this application. The default is
calling SYSTEM_EXIT_0.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>strategy</code> - the way this application should be shutdown</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../java.base/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager exists and it
will not allow the caller to invoke <code>System.exit</code> or it denies the
<code>RuntimePermission("canProcessApplicationEvents")</code> permission</dd>
<dd><code><a href="../../../java.base/java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - if the current platform
does not support the <a href="Desktop.Action.html#APP_QUIT_STRATEGY"><code>Desktop.Action.APP_QUIT_STRATEGY</code></a> action</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>9</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="desktop/QuitStrategy.html" title="enum in java.awt.desktop"><code>QuitStrategy</code></a></dd>
</dl>
</li>
</ul>
<a id="enableSuddenTermination()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>enableSuddenTermination</h4>
<pre class="methodSignature">public void enableSuddenTermination()</pre>
<div class="block">Enables this application to be suddenly terminated.
Call this method to indicate your application's state is saved, and
requires no notification to be terminated. Letting your application
remain terminatable improves the user experience by avoiding re-paging in