Java Code Examples for javax.swing.JMenuBar#setBackground()

The following examples show how to use javax.swing.JMenuBar#setBackground() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MaterialMenuBarUI.java    From material-ui-swing with MIT License 5 votes vote down vote up
@Override
public void installUI (JComponent c) {
	super.installUI (c);

	JMenuBar menuBar = (JMenuBar) c;
	menuBar.setFont (UIManager.getFont ("MenuBar.font"));
	menuBar.setBackground (UIManager.getColor ("MenuBar.background"));
	menuBar.setForeground (UIManager.getColor ("MenuBar.foreground"));
	menuBar.setBorder (UIManager.getBorder ("MenuBar.border"));
}
 
Example 2
Source File: MaterialMenuBarUI.java    From material-ui-swing with MIT License 5 votes vote down vote up
@Override
public void uninstallUI(JComponent c) {
	JMenuBar menuBar = (JMenuBar) c;
	menuBar.setFont (null);
	menuBar.setBackground (null);
	menuBar.setBorder (null);
	menuBar.setForeground (null);

	super.uninstallUI(c);
}
 
Example 3
Source File: BitcoinWalletDialog.java    From RipplePower with Apache License 2.0 5 votes vote down vote up
public BitcoinWalletDialog(String text, Window parent) {
	super(LSystem.applicationMain, text, Dialog.ModalityType.DOCUMENT_MODAL);
	addWindowListener(HelperWindow.get());
	setIconImage(UIRes.getIcon());
	setResizable(false);
	int frameWidth = 900;
	int frameHeight = 580;
	if (LSystem.applicationMain != null) {
		frameWidth = LSystem.applicationMain.getWidth() - 150;
		frameHeight = LSystem.applicationMain.getHeight() - 150;
	}
	setPreferredSize(new Dimension(frameWidth, frameHeight));
	JMenuBar menuBar = new JMenuBar();
	menuBar.setOpaque(true);
	menuBar.setBackground(new Color(230, 230, 230));
	menuBar.add(new Menus(this, "File", new String[] { "Exit", "exit" }));
	menuBar.add(new Menus(this, "View", new String[] { "Receive Addresses", "view receive" },
			new String[] { "Send Addresses", "view send" }));
	menuBar.add(new Menus(this, "Actions", new String[] { "Send Coins", "send coins" },
			new String[] { "Sign Message", "sign message" }, new String[] { "Verify Message", "verify message" }));
	menuBar.add(new Menus(this, "Tools", new String[] { "Export Keys", "export keys" },
			new String[] { "Import Keys", "import keys" }, new String[] { "Rescan Block Chain", "rescan" }));

	setJMenuBar(menuBar);
	transactionPanel = new TransactionPanel(this);
	setContentPane(transactionPanel);
	if (BTCLoader.networkChainHeight > BTCLoader.blockStore.getChainHeight()) {
		setTitle("Bitcoin Wallet - Synchronizing with network");
		synchronizingTitle = true;
	}
	addWindowListener(new ApplicationWindowListener());
	BTCLoader.networkHandler.addListener(this);
	BTCLoader.databaseHandler.addListener(this);
}
 
Example 4
Source File: UI.java    From arcgis-runtime-demo-java with Apache License 2.0 5 votes vote down vote up
public static JMenuBar createMenuBar(JMenu menuAdd, JButton btnEdit, JButton btnQuery) {
  JMenuBar menuBar = new JMenuBar();
    menuBar.setFont(UI.FONT);
    menuBar.setBackground(UI.BACKGROUND);
    menuBar.setLayout(new FlowLayout());
    menuBar.setAlignmentX(Component.CENTER_ALIGNMENT);
    menuBar.add(menuAdd);
    menuBar.add(new JSeparator());
    menuBar.add(btnEdit);
    menuBar.add(new JSeparator());
    menuBar.add(btnQuery);
    return menuBar;
}
 
Example 5
Source File: UI.java    From arcgis-runtime-demo-java with Apache License 2.0 5 votes vote down vote up
public static JMenuBar createMenuBar(JMenu menuAdd, JButton btnEdit, JButton btnQuery) {
  JMenuBar menuBar = new JMenuBar();
    menuBar.setFont(UI.FONT);
    menuBar.setBackground(UI.BACKGROUND);
    menuBar.setLayout(new FlowLayout());
    menuBar.setAlignmentX(Component.CENTER_ALIGNMENT);
    menuBar.add(menuAdd);
    menuBar.add(new JSeparator());
    menuBar.add(btnEdit);
    menuBar.add(new JSeparator());
    menuBar.add(btnQuery);
    return menuBar;
}