aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Setting Title from Jpanel to Jframe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Setting Title from Jpanel to Jframe" Watch "Setting Title from Jpanel to Jframe" New topic
Author

Setting Title from Jpanel to Jframe

Venkatesh Raman
Greenhorn

Joined: Aug 29, 2001
Posts: 8
Hi,
I have two Radio Buttons on a Jpanel. And this Jpanel is placed on a JFrame. Now based on the radio buttons the user clicks I need to change the title on the Jframe.
Can anybody help me on this.
Thanks
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Try this, not sure it works or not.
myJFrame.setTitle("Some Title");
myJFrame.repaint();

------------------
Happy Coding,
Gregg Bolinger


GenRocket - Experts at Building Test Data
Venkatesh Raman
Greenhorn

Joined: Aug 29, 2001
Posts: 8
Hi,
How do I get the Frame from the Jpanel ?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I assume your code looks similar to this??

frame is your JFrame.
In your Radio Button Listener, just access frame like, frame.setTitle("fjdsk");

------------------
Happy Coding,
Gregg Bolinger
[This message has been edited by Gregg Bolinger (edited October 25, 2001).]
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

You have two choices... you can either do things the "normal" way...


Or, if you have a specialized child of Panel... the "other" way...




-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Venkatesh Raman
Greenhorn

Joined: Aug 29, 2001
Posts: 8
Thanks a lot guys !!! It works perfectly !!! It is really great to post on this site..
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Even better to get the answers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting Title from Jpanel to Jframe