author | pkbalakr |
Tue, 24 May 2016 14:19:53 +0530 | |
changeset 38992 | 5e8d53377c10 |
child 40128 | e635645d2a8a |
permissions | -rw-r--r-- |
38992
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
1 |
/* |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
2 |
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
4 |
* |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
8 |
* |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
13 |
* accompanied this code). |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
14 |
* |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
18 |
* |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
21 |
* questions. |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
22 |
*/ |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
23 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
24 |
/* |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
25 |
@test |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
26 |
@bug 8057574 |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
27 |
@summary Verify that child Dialog does not inherit parent's Properties |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
28 |
@run main ChildDialogProperties |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
29 |
*/ |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
30 |
import java.awt.Color; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
31 |
import java.awt.Dialog; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
32 |
import java.awt.Font; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
33 |
import java.awt.Frame; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
34 |
import java.awt.Label; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
35 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
36 |
public class ChildDialogProperties { |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
37 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
38 |
private Dialog parentDialog; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
39 |
private Dialog dialogChild; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
40 |
private Frame parentFrame; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
41 |
private Dialog frameChildDialog; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
42 |
private Label parentLabel; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
43 |
private Font parentFont; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
44 |
private Label childLabel; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
45 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
46 |
private static final int WIDTH = 200; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
47 |
private static final int HEIGHT = 200; |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
48 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
49 |
public void testChildPropertiesWithDialogAsParent() { |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
50 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
51 |
parentDialog = new Dialog((Dialog) null, "parent Dialog"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
52 |
parentDialog.setSize(WIDTH, HEIGHT); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
53 |
parentDialog.setLocation(100, 100); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
54 |
parentDialog.setBackground(Color.RED); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
55 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
56 |
parentLabel = new Label("ParentForegroundAndFont"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
57 |
parentFont = new Font("Courier New", Font.ITALIC, 15); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
58 |
parentDialog.setForeground(Color.BLUE); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
59 |
parentDialog.setFont(parentFont); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
60 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
61 |
parentDialog.add(parentLabel); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
62 |
parentDialog.setVisible(true); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
63 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
64 |
dialogChild = new Dialog(parentDialog, "Dialog's child"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
65 |
dialogChild.setSize(WIDTH, HEIGHT); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
66 |
dialogChild.setLocation(WIDTH + 200, 100); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
67 |
childLabel = new Label("ChildForegroundAndFont"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
68 |
dialogChild.add(childLabel); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
69 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
70 |
dialogChild.setVisible(true); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
71 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
72 |
if (parentDialog.getBackground() == dialogChild.getBackground()) { |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
73 |
dispose(); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
74 |
throw new RuntimeException("Child Dialog Should NOT Inherit " |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
75 |
+ "Parent Dialog's Background Color"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
76 |
} |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
77 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
78 |
if (parentDialog.getForeground() == dialogChild.getForeground()) { |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
79 |
dispose(); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
80 |
throw new RuntimeException("Child Dialog Should NOT Inherit " |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
81 |
+ "Parent Dialog's Foreground Color"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
82 |
} |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
83 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
84 |
if (parentDialog.getFont() == dialogChild.getFont()) { |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
85 |
dispose(); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
86 |
throw new RuntimeException("Child Dialog Should NOT Inherit " |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
87 |
+ "Parent Dialog's Font Style/Color"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
88 |
} |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
89 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
90 |
} |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
91 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
92 |
public void testChildPropertiesWithFrameAsParent() { |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
93 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
94 |
parentFrame = new Frame("parent Frame"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
95 |
parentFrame.setSize(WIDTH, HEIGHT); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
96 |
parentFrame.setLocation(100, 400); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
97 |
parentFrame.setBackground(Color.BLUE); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
98 |
parentLabel = new Label("ParentForegroundAndFont"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
99 |
parentFont = new Font("Courier New", Font.ITALIC, 15); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
100 |
parentFrame.setForeground(Color.RED); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
101 |
parentFrame.setFont(parentFont); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
102 |
parentFrame.add(parentLabel); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
103 |
parentFrame.setVisible(true); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
104 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
105 |
frameChildDialog = new Dialog(parentFrame, "Frame's child"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
106 |
frameChildDialog.setSize(WIDTH, HEIGHT); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
107 |
frameChildDialog.setLocation(WIDTH + 200, 400); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
108 |
childLabel = new Label("ChildForegroundAndFont"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
109 |
frameChildDialog.add(childLabel); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
110 |
frameChildDialog.setVisible(true); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
111 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
112 |
if (parentFrame.getBackground() == frameChildDialog.getBackground()) { |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
113 |
dispose(); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
114 |
throw new RuntimeException("Child Dialog Should NOT Inherit " |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
115 |
+ "Parent Frame's Background Color"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
116 |
} |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
117 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
118 |
if (parentFrame.getForeground() == frameChildDialog.getForeground()) { |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
119 |
dispose(); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
120 |
throw new RuntimeException("Child Dialog Should NOT Inherit " |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
121 |
+ "Parent Frame's Foreground Color"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
122 |
} |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
123 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
124 |
if (parentFrame.getFont() == frameChildDialog.getFont()) { |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
125 |
dispose(); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
126 |
throw new RuntimeException("Child Dialog Should NOT Inherit " |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
127 |
+ "Parent Frame's Font Style/Color"); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
128 |
} |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
129 |
} |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
130 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
131 |
private void dispose() { |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
132 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
133 |
if (parentDialog != null) { |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
134 |
parentDialog.dispose(); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
135 |
} |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
136 |
if (parentFrame != null) { |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
137 |
parentFrame.dispose(); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
138 |
} |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
139 |
} |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
140 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
141 |
public static void main(String[] args) throws Exception { |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
142 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
143 |
ChildDialogProperties obj = new ChildDialogProperties(); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
144 |
// TestCase1: When Parent is Dialog, Child is Dialog |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
145 |
obj.testChildPropertiesWithDialogAsParent(); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
146 |
// TestCase2: When Parent is Frame, chis is Dialog |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
147 |
obj.testChildPropertiesWithFrameAsParent(); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
148 |
obj.dispose(); |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
149 |
} |
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
150 |
|
5e8d53377c10
8057574: inconsistent behavior for setBackground (Windows/Linux)
pkbalakr
parents:
diff
changeset
|
151 |
} |