author | alexsch |
Thu, 27 Nov 2014 14:27:46 +0300 | |
changeset 28073 | b8f12f02bd93 |
permissions | -rw-r--r-- |
28073
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
1 |
/* |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
2 |
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
4 |
* |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
8 |
* |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
13 |
* accompanied this code). |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
14 |
* |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
18 |
* |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
21 |
* questions. |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
22 |
*/ |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
23 |
import javax.swing.BorderFactory; |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
24 |
import javax.swing.JColorChooser; |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
25 |
import javax.swing.JFrame; |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
26 |
import javax.swing.JPanel; |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
27 |
import javax.swing.SwingUtilities; |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
28 |
|
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
29 |
/* |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
30 |
* @bug 8065098 |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
31 |
* @summary JColorChooser no longer supports drag and drop |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
32 |
* between two JVM instances |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
33 |
*/ |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
34 |
public class JColorChooserDnDTest { |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
35 |
|
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
36 |
public static void main(String[] args) { |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
37 |
SwingUtilities.invokeLater(new Runnable() { |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
38 |
|
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
39 |
@Override |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
40 |
public void run() { |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
41 |
JFrame frame = new JFrame(); |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
42 |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
43 |
JPanel panel = new JPanel(); |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
44 |
JColorChooser colorChooser = new JColorChooser(); |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
45 |
colorChooser.setDragEnabled(true); |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
46 |
panel.setBorder(BorderFactory.createTitledBorder("JColorChoosers")); |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
47 |
panel.add(colorChooser); |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
48 |
frame.setContentPane(panel); |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
49 |
frame.pack(); |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
50 |
frame.setVisible(true); |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
51 |
} |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
52 |
}); |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
53 |
} |
b8f12f02bd93
8065098: JColorChooser no longer supports drag and drop between two JVM instances
alexsch
parents:
diff
changeset
|
54 |
} |