Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in changing title of frame of outer class by inner class button

 
Ashwin Soni
Greenhorn
Posts: 18
Android Flex Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



In this program outer class create a frame in which a button b call the inner class, Inner class also create a frame in which on pressing button b1 change the tittle of outer class frame.

Well this code is working fine but i want to know is there some better approach instead of creating method? at line 32.

thanks.
 
Alec Porter
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this.


 
Ashwin Soni
Greenhorn
Posts: 18
Android Flex Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Alec Porter.




I want to know why "t.setTitle("text changed");" will not work for outer class from inner class but working for inner class from outer class?
 
Alec Porter
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what exactly your problem is but, if you are calling



in the inner class it will not work because the inner class has no reference to object t inside it.
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ashwin, please UseOneThreadPerQuestion. The other thread you started 8 minutes after this one has been closed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic