use of javax.swing.plaf.metal.OceanTheme in project jdk8u_jdk by JetBrains.
the class MetalworksFrame method buildMenus.
protected void buildMenus() {
menuBar = new JMenuBar();
menuBar.setOpaque(true);
JMenu file = buildFileMenu();
JMenu edit = buildEditMenu();
JMenu views = buildViewsMenu();
JMenu speed = buildSpeedMenu();
JMenu help = buildHelpMenu();
// load a theme from a text file
MetalTheme myTheme = null;
try {
InputStream istream = getClass().getResourceAsStream("/resources/MyTheme.theme");
myTheme = new PropertiesMetalTheme(istream);
} catch (NullPointerException e) {
System.out.println(e);
}
// build an array of themes
MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme };
// put the themes in a menu
JMenu themeMenu = new MetalThemeMenu("Theme", themes);
menuBar.add(file);
menuBar.add(edit);
menuBar.add(views);
menuBar.add(themeMenu);
menuBar.add(speed);
menuBar.add(help);
setJMenuBar(menuBar);
}
Aggregations