equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1996, 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. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
98 */ |
98 */ |
99 AwtDialog* AwtDialog::Create(jobject peer, jobject parent) |
99 AwtDialog* AwtDialog::Create(jobject peer, jobject parent) |
100 { |
100 { |
101 JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); |
101 JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); |
102 |
102 |
103 jobject background = NULL; |
|
104 jobject target = NULL; |
103 jobject target = NULL; |
105 AwtDialog* dialog = NULL; |
104 AwtDialog* dialog = NULL; |
106 |
105 |
107 try { |
106 try { |
108 if (env->EnsureLocalCapacity(2) < 0) { |
107 if (env->EnsureLocalCapacity(2) < 0) { |
179 dialog->m_hIconSm = awtParent->GetHIconSm(); |
178 dialog->m_hIconSm = awtParent->GetHIconSm(); |
180 dialog->m_iconInherited = TRUE; |
179 dialog->m_iconInherited = TRUE; |
181 } |
180 } |
182 dialog->DoUpdateIcon(); |
181 dialog->DoUpdateIcon(); |
183 |
182 |
184 |
|
185 background = env->GetObjectField(target, |
|
186 AwtComponent::backgroundID); |
|
187 if (background == NULL) { |
|
188 JNU_CallMethodByName(env, NULL, |
|
189 peer, "setDefaultColor", "()V"); |
|
190 } |
|
191 } |
183 } |
192 } catch (...) { |
184 } catch (...) { |
193 env->DeleteLocalRef(background); |
|
194 env->DeleteLocalRef(target); |
185 env->DeleteLocalRef(target); |
195 throw; |
186 throw; |
196 } |
187 } |
197 |
188 |
198 done: |
189 done: |
199 env->DeleteLocalRef(background); |
|
200 env->DeleteLocalRef(target); |
190 env->DeleteLocalRef(target); |
201 |
191 |
202 return dialog; |
192 return dialog; |
203 } |
193 } |
204 |
194 |