Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Constructor,Jbutton,Thread problem

Dinud123Mar 21 2013 — edited Mar 21 2013
hello,

I have a problem fetching constructor values into a jbutton running inside a thread.. The Jbutton parameter "message" takes the constructor value "checked"


Defined class level PARAMETERS
String checked,trans;
//constructor
Clientthread(Object abc)
{
this.abcr=abc;
checked=(String)abcr;
System.out.println("checked : "+checked); //some object value say "hello 123"
}

public void run()
{
ack.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent ae)
{
String message=checked;
System.out.println("message.."+ message); // op is null, y ? I want here "hello 123"
}


}
}

Edited by: 986154 on Mar 20, 2013 9:58 PM

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 18 2013
Added on Mar 21 2013
0 comments
867 views