test.QuaquaMenuColorProblem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Quaqua Show documentation
Show all versions of Quaqua Show documentation
A Mavenisation of the Quaqua Mac OSX Swing Look and Feel (Java library)
Quaqua Look and Feel (C) 2003-2010, Werner Randelshofer.
Mavenisation by Matt Gumbley, DevZendo.org - for problems with
Mavenisation, see Matt; for issues with Quaqua, see the Quaqua home page.
For full license details, see http://randelshofer.ch/quaqua/license.html
The newest version!
/*
* @(#)QuaquaMenuColorProblem.java 1.0 2010-07-02
*
* Copyright (c) 2010 Werner Randelshofer, Immensee, Switzerland.
* All rights reserved.
*
* You may not use, copy or modify this file, except in compliance with the
* license agreement you entered into with Werner Randelshofer.
* For details see accompanying license terms.
*/
package test;
/**
* QuaquaMenuColorProblem.
*
* @author Werner Randelshofer
* @version 1.0 2010-07-02 Created.
*/
import java.awt.Color;
import javax.swing.JDialog;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.UIManager;
public class QuaquaMenuColorProblem
{
public static void main (final String [ ] args) throws Exception
{
UIManager.setLookAndFeel (UIManager.getSystemLookAndFeelClassName ( ));
showExample ( );
UIManager.setLookAndFeel ("ch.randelshofer.quaqua.QuaquaLookAndFeel");
UIManager.setLookAndFeel ("ch.randelshofer.quaqua.leopard.Quaqua16LeopardLookAndFeel");
showExample ( );
System.exit (0);
}
private static void showExample ( )
{
final JMenu jMenu = new JMenu ("File");
jMenu.setBackground (Color.GREEN);
JMenuItem item = new JMenuItem ("Open");
item.setBackground (Color.RED);
jMenu.add(item);
jMenu.add(new JMenuItem ("Close"));
final JMenuBar jMenuBar = new JMenuBar ( );
jMenuBar.setBackground (Color.GREEN);
jMenuBar.add (jMenu);
final JDialog jDialog = new JDialog ( );
jDialog.setJMenuBar (jMenuBar);
jDialog.setSize (600, 400);
jDialog.setLocationRelativeTo (null);
jDialog.setModal (true);
jDialog.setVisible (true);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy