Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #361
| From | "Larry Barowski" <larry.barowski@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: How to determine if a |
| Message-ID | <tu6dnc4AtdQJfufYnZ2dnUVZ_veinZ2d@comcast.com> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <1165640664.144009.182990@79g2000cws.googlegroups.com> |
| Date | 2011-04-27 15:27 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui "Orlando" <orlandoamador@yahoo.com> wrote in message news:1165640664.144009.182990@79g2000cws.googlegroups.com... >I like to write a method that will set the font of a JMenuBar and all > menu items in that Menu bar. I can find any components inside the > menubar using the getComponents() method. How can one determine if any > of these components is a container? I would like to recursively go > through every item in the menus and sub-menus and set the font of those > menuitems as per the user preferences. If you're doing this application-wide, it's easier to use UIManager to change the default fonts, then update all of the UI. Otherwise, you should probably subclass JMenuItem, JCheckBoxMenuItem, etc. so that they get their fonts from your own UI manager (you'll still need to update all UI after a change). I would only do this recursively as you are trying to do if the menu is created by library code for which the source is not available. --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Find similar
How to determine if a JCo "Orlando" <orlando@THRWHITE.remove-dii-this> - 2011-04-27 15:27 +0000 Re: How to determine if a "Orlando" <orlando@THRWHITE.remove-dii-this> - 2011-04-27 15:27 +0000 Re: How to determine if a "Larry Barowski" <larry.barowski@THRWHITE.remove-dii-this> - 2011-04-27 15:27 +0000
csiph-web