changing the color of JMenuItem when mouse is over it for our oxygen plugin
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 168
- Joined: Fri Feb 28, 2020 4:02 pm
changing the color of JMenuItem when mouse is over it for our oxygen plugin
Post by vishwavaranasi »
Hello Team , for changing the color of JMenuItem when mouse is over it for our oxygen plugin
inside the method we did like this
pluginWorkspaceAccess.addMenuBarCustomizer()
{
UIManager.put("MenuItem.selectionBackground",Color.GREEN);
UIManager.put("MenuItem.selectionForeground", Color.GREEN);
UIManager.put("MenuItem.opaque", Color.GREEN);
}
but this is not working.
any suggestions?
inside the method we did like this
pluginWorkspaceAccess.addMenuBarCustomizer()
{
UIManager.put("MenuItem.selectionBackground",Color.GREEN);
UIManager.put("MenuItem.selectionForeground", Color.GREEN);
UIManager.put("MenuItem.opaque", Color.GREEN);
}
but this is not working.
any suggestions?
Thanks,
vishwa
vishwa
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: changing the color of JMenuItem when mouse is over it for our oxygen plugin
Hi,
Maybe you can try to create a small Java swing application, google online how to change the JMenuItem color on hover, once you have a working solution you can go back to the plugin.
I would advice in general for accessibility reasons against changing the default background/foreground colors for menu items, labels, buttons. For example Oxygen has multiple color themes (Preferences->Appearance), once you start changing colors you may break the color themes for example for the dark color theme (Graphite).
Also once your plugin gets called, Oxygen has already used the "UIManager" colors for most of its components so setting values there might not help.
JMenuItems can have also HTML content for their text, something like: "menuItem.setText("<html><span color='red'>hello</span></html>")" but this might not work for the main menus on Mac OS where the main menu bar is a native menu bar and does not support HTML.
Regards,
Radu
Maybe you can try to create a small Java swing application, google online how to change the JMenuItem color on hover, once you have a working solution you can go back to the plugin.
I would advice in general for accessibility reasons against changing the default background/foreground colors for menu items, labels, buttons. For example Oxygen has multiple color themes (Preferences->Appearance), once you start changing colors you may break the color themes for example for the dark color theme (Graphite).
Also once your plugin gets called, Oxygen has already used the "UIManager" colors for most of its components so setting values there might not help.
JMenuItems can have also HTML content for their text, something like: "menuItem.setText("<html><span color='red'>hello</span></html>")" but this might not work for the main menus on Mac OS where the main menu bar is a native menu bar and does not support HTML.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 168
- Joined: Fri Feb 28, 2020 4:02 pm
Re: changing the color of JMenuItem when mouse is over it for our oxygen plugin
Post by vishwavaranasi »
Thanks Radu , we will consider that not to change colors.
Thanks,
vishwa
Thanks,
vishwa
Thanks,
vishwa
vishwa
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service