steelme Example |
Simple Example
Here's a snippet showing steelme in action. This creates a menu showing
- all the themes installed in the resources/themes directory, and
- the ThemeEditor, with which the user can create and save new themes
and adds the new menu to the application. To choose a theme, the user simply selects the menu item.
... JFrame frame = new JFrame("Demo"); // create a JFrame JMenuBar menubar = new JMenuBar(); // create a JMenuBar File g = new File("resources/themes"); // directory with installed themes JMenu men = new ThemeMenu(frame.getRootPane(),g); // create theme menu menubar.add(men); // add theme menu to menu bar frame.setJMenuBar(menubar); // add menu bar to application ...
Note
You can see the full source for the steelme demo at http://cvs.sourceforge.net/viewcvs.py/steelme/steelme/demo/NewDemo.java?rev=1.1&view=markup.
And here's what the theme menu looks like in action:
A shot of the theme editor is available in the screenshots section of this web site.