Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

variable access

 
amrit sharma
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hiii..

i am having some problem..

here it goes....i want to access a variable which is actually a result present in one frame class...i want to display this result into a another testarea present in second frame on clickin the display button present in the second frame..

for this reason i created an object of the class containing the result and then calling the result using the object...and then finally passing the variable in the textarea..


some part of the code is:this is a segment of class frame5

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
fourth ob=new fourth(); //here fourth is the class which contains the result value.
String result;
jTextArea1.setText(String.valueOf(ob.result));
// TODO add your handling code here:
}


how can i do it....

plse help..



amrit
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> fourth ob=new fourth(); //here fourth is the class which contains the result value.

more likely you'll need a reference to an existing fourth() object (not just creating a new one)
google
passing references in java

I'd give you an example, but all your posts are about the same thing,
2 radioButtons and 2 frames, and people have given you suggestions,
or asked for more info, but all you do is post another topic.
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I second Michael's reply. You may wish to reply to those who've taken the time to help you, because if you ignore them, why should they bother helping you again?
 
amrit sharma
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your help...will definitely try that out....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic