Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes Problem in changing title of frame of outer class by inner class button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem in changing title of frame of outer class by inner class button" Watch "Problem in changing title of frame of outer class by inner class button" New topic
Author

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

Ashwin Soni
Greenhorn

Joined: Jun 22, 2012
Posts: 18




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

Joined: Sep 05, 2010
Posts: 29
Try this.


Ashwin Soni
Greenhorn

Joined: Jun 22, 2012
Posts: 18

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

Joined: Sep 05, 2010
Posts: 29
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

Joined: May 03, 2008
Posts: 4523
    
    5

Ashwin, please UseOneThreadPerQuestion. The other thread you started 8 minutes after this one has been closed.


luck, db
There are no new questions, but there may be new answers.
 
 
subject: Problem in changing title of frame of outer class by inner class button
 
Similar Threads
how to handle an event in separate class as written
A Question
please help its urgent
AWT components display
Window Title Bar Text Resizing