jmenubar

JMenu submenu little arrow icon indicator

假如想象 提交于 2019-12-02 16:09:37
问题 Does anyone know how to control the display of the tiny little arrow that appears on submenus of JMenu? Can I change it? Can I disable it? Can I move it? Also, I notice that this arrow doesn't appear on top level JMenus only when they are submenus of other JMenu. This inconsistency annoys me since I have a mix of JMenuItem and JMenu attached to the root of my JMenuBar and so I wish it would always indicate it. Anyway to do this as well? thanks! 回答1: Take a look at the Menu.arrowIcon UI

Change menu bar and menu items font

不打扰是莪最后的温柔 提交于 2019-12-02 15:59:23
问题 I'm trying to make the menu bar items and the items of the items bigger and smaller, I've seached here a bit before (so don't mark this as repeated please) and none of the posts I've found are working. I've tried the following codes without success: Font f = new Font("sans-serif", Font.PLAIN, 12); UIManager.put("menuBar.font", f); And menuBar.setFont(new Font(menuBar.getFont().getFontName(), menuBar.getFont().getStyle(), 12)); And this is my code where I'm trying to edit the font: private

Change menu bar and menu items font

柔情痞子 提交于 2019-12-02 10:37:42
I'm trying to make the menu bar items and the items of the items bigger and smaller, I've seached here a bit before (so don't mark this as repeated please) and none of the posts I've found are working. I've tried the following codes without success: Font f = new Font("sans-serif", Font.PLAIN, 12); UIManager.put("menuBar.font", f); And menuBar.setFont(new Font(menuBar.getFont().getFontName(), menuBar.getFont().getStyle(), 12)); And this is my code where I'm trying to edit the font: private class foo{ private JMenu mnArchivo; private JMenuBar menuBar; menuBar = new JMenuBar();

JMenu submenu little arrow icon indicator

早过忘川 提交于 2019-12-02 09:56:17
Does anyone know how to control the display of the tiny little arrow that appears on submenus of JMenu? Can I change it? Can I disable it? Can I move it? Also, I notice that this arrow doesn't appear on top level JMenus only when they are submenus of other JMenu. This inconsistency annoys me since I have a mix of JMenuItem and JMenu attached to the root of my JMenuBar and so I wish it would always indicate it. Anyway to do this as well? thanks! Take a look at the Menu.arrowIcon UI property (Thanks to AndrewThompson for the test code). Doining this will effect ALL the menus created AFTER you

JMenuBar SelectionModel ChangeListener only fires once

时光毁灭记忆、已成空白 提交于 2019-12-02 07:22:05
问题 I am trying to get my JMenuBar to model the behavior of the menu bars of Firefox and iTunes. The behavior: the menu bar is initially hidden. But, when you press Alt , the menu bar appears (with the first item selected) and when you don't have a menu item selected, the menu bar disappears. My idea was to listen for selection changes to the JMenuBar via a ChangeListener on its SelectionModel . However, the behavior of the attached SSCCE is not as desired. When the frame loads, the JMenuBar is

JMenuBar SelectionModel ChangeListener only fires once

心不动则不痛 提交于 2019-12-01 23:28:25
I am trying to get my JMenuBar to model the behavior of the menu bars of Firefox and iTunes. The behavior: the menu bar is initially hidden. But, when you press Alt , the menu bar appears (with the first item selected) and when you don't have a menu item selected, the menu bar disappears. My idea was to listen for selection changes to the JMenuBar via a ChangeListener on its SelectionModel . However, the behavior of the attached SSCCE is not as desired. When the frame loads, the JMenuBar is not visible. When you press Alt , the menu bar appears with the first menu selected (thanks to the

Example Program JMenubar on JInternalFrame when i Maximize the JInternalFrame

删除回忆录丶 提交于 2019-12-01 20:42:00
Hi I need an Example program in which When i maximize the JInternalFrame the JMenuBar of JFrame should set on JInternalFrame and When i minimize the JInternalFrame again the JMenuBar should leave JinternalFrame and set to JFrame as shown below Please provide me an Example Program in Java Swing Seems to work fine, please post SSCCE to show specific problem: import java.awt.*; import java.awt.event.*; import javax.swing.JDesktopPane; import javax.swing.JFrame; import javax.swing.JInternalFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax

Making a JButton act like a JMenu

好久不见. 提交于 2019-12-01 14:52:08
I have the following code for a JMenuBar (This code has been taken from a free java program call JGuiD and edited for personal purposes) import javax.swing.*; import java.awt.event.*; import javax.swing.event.*; import java.awt.Dimension; import java.awt.Color; public class GuiDMenuBar extends JMenuBar { JMenu m_file,m_edit,m_help; JMenuItem mi_f_new,mi_f_open,mi_f_save,mi_f_saveas,mi_f_exit; JMenuItem mi_e_cut,mi_e_copy,mi_e_paste,mi_e_delete; JMenuItem mi_v_motif,mi_v_java,mi_v_windows,mi_v_nimbus; JMenuItem mi_h_help,mi_h_about; JButton m_code; public GuiDMenuBar() { setBorderPainted(true);

Making a JButton act like a JMenu

别说谁变了你拦得住时间么 提交于 2019-12-01 12:10:13
问题 I have the following code for a JMenuBar (This code has been taken from a free java program call JGuiD and edited for personal purposes) import javax.swing.*; import java.awt.event.*; import javax.swing.event.*; import java.awt.Dimension; import java.awt.Color; public class GuiDMenuBar extends JMenuBar { JMenu m_file,m_edit,m_help; JMenuItem mi_f_new,mi_f_open,mi_f_save,mi_f_saveas,mi_f_exit; JMenuItem mi_e_cut,mi_e_copy,mi_e_paste,mi_e_delete; JMenuItem mi_v_motif,mi_v_java,mi_v_windows,mi_v

Swing application menu name not displaying correctly in Java 1.8

扶醉桌前 提交于 2019-12-01 06:35:21
Okay, so I've done Swing applications before, and I know if you want to display a different name for the application menu (the one on Macs that usually have a "Preferences" and "Quit" option), you have to use: System.setProperty("com.apple.mrj.application.apple.menu.about.name", "App name"); and it must be executed before the JFrame is created. I've done this, but it continues to show my Main class' name as the menu name, as if I didn't write that line of code at all. I googled for this issue, but couldn't find anything useful, and then I just searched on here, but everyone who had a similar