Skip to Main Content

JLabel constructor call problem

893718Oct 14 2011 — edited Oct 14 2011
Hello,

I've problem with calling JLabel's constructor with passing String value to constructor.
jobject jobjLabel;
jclass JLabelClass;
jmethodID mid;
JLabelClass = (*env)->FindClass(env,"javax/swing/JLabel");
  if(JLabelClass == NULL) {
	printf("Can't find class JLabel\n");
	goto destroy;
  }

  mid = (*env)->GetMethodID(env,JLabelClass,"<init>","(Ljava/lang/String;)V");
  jobjLabel = (*env)->NewObject(env,JLabelClass,mid,"Hello World");
At line:
 jobjLabel = (*env)->NewObject(env,JLabelClass,mid,"Hello World");
Main Thread exits with error code 1. I am sure that this line is true but I didn't find problem.

Are there any methods to find errors before program exit?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Nov 11 2011
Added on Oct 14 2011
2 comments
1,475 views