Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Refreshing JInternalFrame's titlebar UI  RSS feed

 
Paul Song
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I would like to change font properties of a title bar in JInternalFrame (that actually is on the screen) so I am calling:



IFrame is dynamically refreshed (font changed) and everything seems to be allright.. Unfortunately updateUI() method removes my mouse listeners from the title bar.

My questions are:
1) is any other way to refresh internal frame UI (without invoking updateUI())?
2) can I (in some safe way) save and restore my listeners from a title bar? I tried something like this (override updateUI):



but I thing it's not a pretty good solution :/
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Of course this is presuming you already know the value for "this.cellsTitleFont"
[ July 14, 2008: Message edited by: Maneesh Godbole ]
 
Paul Song
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, this works fine.. but the problem is that I want to refresh existing internal frames (shown on JDesktopPane - not new). When I am creating new frame all is allright - newly created frame has an updated font in a title bar, but other frames (these created before was invoked) have an old font.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well then you can try SwingUtilities.updateComponentTreeUI().
 
Paul Song
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SwingUtilities.updateComponentTreeUI() invokes updateUI on given component - so it's also removes listeners :/
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this'll change the font size on the fly - should be the same for changing font name etc

 
Paul Song
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works great - thanks
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!