equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 /* |
24 /* |
25 @test |
25 @test |
26 @bug 6565779 |
26 @bug 6565779 8168292 |
27 @library ../../../regtesthelpers |
27 @library ../../regtesthelpers |
28 @compile DragEventSource.java |
28 @compile DragEventSource.java |
29 @summary Exception if source of some event is TrayIcon |
29 @summary Exception if source of some event is TrayIcon |
30 @author Andrei Dmitriev: area=awt.tray |
30 @author Andrei Dmitriev: area=awt.tray |
31 @run main/manual/othervm -Dsun.awt.exception.handler=DragEventSource DragEventSource |
31 @run main/manual/othervm -Dsun.awt.exception.handler=DragEventSource DragEventSource |
32 */ |
32 */ |
36 * |
36 * |
37 * summary: an exception happen if the DRAG event has a TrayIcon |
37 * summary: an exception happen if the DRAG event has a TrayIcon |
38 * instance as source. |
38 * instance as source. |
39 */ |
39 */ |
40 |
40 |
41 import java.awt.*; |
41 import java.awt.Button; |
42 import java.awt.event.*; |
42 import java.awt.Dialog; |
43 import java.awt.image.*; |
43 import java.awt.FileDialog; |
|
44 import java.awt.FlowLayout; |
|
45 import java.awt.Frame; |
|
46 import java.awt.Image; |
|
47 import java.awt.Panel; |
|
48 import java.awt.SystemTray; |
|
49 import java.awt.TextArea; |
|
50 import java.awt.TrayIcon; |
|
51 import java.awt.event.ActionEvent; |
|
52 import java.awt.event.ActionListener; |
|
53 import java.awt.image.BufferedImage; |
44 |
54 |
45 public class DragEventSource |
55 public class DragEventSource |
46 { |
56 { |
47 static Frame frame = new Frame("Test frame"); |
57 static Frame frame = new Frame("Test frame"); |
48 static Button b1 = new Button("Open file dialog"); |
58 static Button b1 = new Button("Open file dialog"); |
79 return; |
89 return; |
80 } |
90 } |
81 |
91 |
82 String[] instructions = |
92 String[] instructions = |
83 { |
93 { |
84 "Use see a Frame with a button in it.", |
94 "Click 'Open file dialog' button. FileDialog should appear.", |
85 "Press the button. FileDialog should appear.", |
95 "Using left mouse button,", |
86 "Drag the mouse from the Tray icon to FileDialog ", |
96 "Drag the mouse from the Tray icon to FileDialog.", |
87 "using left mouse button.", |
97 "If exception is thrown, the test fails.", |
88 "If exception happens, the test fails.", |
|
89 "Otherwise, pass." |
98 "Otherwise, pass." |
90 }; |
99 }; |
91 |
100 |
92 Sysout.createDialog( ); |
101 Sysout.createDialog( ); |
93 Sysout.printInstructions( instructions ); |
102 Sysout.printInstructions( instructions ); |