< prev index next >
src/windows/native/sun/windows/awt_Checkbox.cpp
Print this page
rev 12527 : 8165543: Better window framing
Reviewed-by: serb
*** 68,77 ****
--- 68,78 ----
return TEXT("BUTTON"); /* System provided checkbox class (a type of button) */
}
AwtCheckbox* AwtCheckbox::Create(jobject peer, jobject parent)
{
+ DASSERT(AwtToolkit::IsMainThread());
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
jstring label = NULL;
jobject target = NULL;
AwtCheckbox *checkbox = NULL;
*** 79,93 ****
try {
if (env->EnsureLocalCapacity(2) < 0) {
return NULL;
}
AwtComponent* awtParent;
! JNI_CHECK_NULL_GOTO(parent, "null parent", done);
!
! awtParent = (AwtComponent*)JNI_GET_PDATA(parent);
! JNI_CHECK_NULL_GOTO(awtParent, "null awtParent", done);
target = env->GetObjectField(peer, AwtObject::targetID);
JNI_CHECK_NULL_GOTO(target, "null target", done);
checkbox = new AwtCheckbox();
--- 80,93 ----
try {
if (env->EnsureLocalCapacity(2) < 0) {
return NULL;
}
+ PDATA pData;
AwtComponent* awtParent;
! JNI_CHECK_PEER_GOTO(parent, done);
! awtParent = (AwtCanvas*)pData;
target = env->GetObjectField(peer, AwtObject::targetID);
JNI_CHECK_NULL_GOTO(target, "null target", done);
checkbox = new AwtCheckbox();
*** 665,679 ****
Java_sun_awt_windows_WCheckboxPeer_create(JNIEnv *env, jobject self,
jobject parent)
{
TRY;
- PDATA pData;
- JNI_CHECK_PEER_RETURN(parent);
AwtToolkit::CreateComponent(self, parent,
(AwtToolkit::ComponentFactory)
AwtCheckbox::Create);
JNI_CHECK_PEER_CREATION_RETURN(self);
#ifdef DEBUG
((AwtComponent*)JNI_GET_PDATA(self))->VerifyState();
#endif
--- 665,678 ----
Java_sun_awt_windows_WCheckboxPeer_create(JNIEnv *env, jobject self,
jobject parent)
{
TRY;
AwtToolkit::CreateComponent(self, parent,
(AwtToolkit::ComponentFactory)
AwtCheckbox::Create);
+ PDATA pData;
JNI_CHECK_PEER_CREATION_RETURN(self);
#ifdef DEBUG
((AwtComponent*)JNI_GET_PDATA(self))->VerifyState();
#endif
< prev index next >