Click here to Skip to main content
15,303,522 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
somebody help me to know how to run another java class when java
jbutton clicked.
and how to equal variables in two java classes.

pleace post the sample code... thank you.

Start here[^], for all Java classes. I'm not sure about sharing variables between classes (assuming you mean independently running) but I'm sure you can pass parameters when you exec a new class.
As to posting code, that, I'm afraid, is your responsibility.
Sergey Alexandrovich Kryukov 26-Jun-11 21:29pm
Agree, my 5. See some more to it in my answer.
There is no such concept as "run Java class" — you always run a method. There is no such thing as "equal variables". There is a concept of assignment of one variable to another or comparison of tho variables: if they are equal, not equal or referentially equal or not.

It looks like you have no understanding of what a class is and what is its instance and what is the instance or static member of the class. So you need to start reading over on basic Java topics, something like this:[^].

Richard MacCutchan 27-Jun-11 3:25am
Sergey Alexandrovich Kryukov 27-Jun-11 16:51pm
Thank you, Richard.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900