I am using Synth L&F in a XML File, I set up everything so far, but no I have a nested JMenu, and I don't want the nested ones to take the style of the top JMenu's.
JMenu accountMenu = new JMenu("Manage Account");
JMenuItem editUsername = new JMenuItem("Change Username");
JMenuItem editPassword = new JMenuItem("Change Password");
accountMenu.add(editUsername);
accountMenu.add(editPassword);
fileMenu.add(accountMenu);
This was only taken from my code and edited to fit in, doesn't represent the actual code.
Then this is the Synth XML I snippet I am using.
<!-- ================================= -->
<!-- MENU -->
<!-- ================================= -->
<style id="MenuStyle">
<insets top="2" bottom="2" right="10" left="7" />
<state>
<font name="Calibre" size="14" style="BOLD" />
<color value="#cccccc" type="TEXT_FOREGROUND" />
</state>
<state value="DISABLED">
<color value="WHITE" type="TEXT_FOREGROUND" />
</state>
<state value="SELECTED">
<imagePainter method="MenuBackground" path="Bin/Images/headerbarActive.jpg"
sourceInsets="0 0 0 0" />
<color value="WHITE" type="TEXT_FOREGROUND" />
</state>
</style>
<bind style="MenuStyle" type="region" key="Menu" />
<!-- ================================= -->
<!-- MENU ITEM-->
<!-- ================================= -->
<style id="MenuItemStyle">
<insets top="3" bottom="3" right="20" left="5" />
<state>
<imagePainter method="MenuItemBackground" path="Bin/Images/menuItem.jpg"
sourceInsets="0 0 0 0" />
<font name="Calibre" size="14" style="PLAIN" />
<color value="#cccccc" type="TEXT_FOREGROUND" />
</state>
<state value="MOUSE_OVER">
<imagePainter method="MenuItemBackground" path="Bin/Images/menuItemActive.jpg"
sourceInsets="0 0 0 0" />
<color value="#000000" type="TEXT_FOREGROUND" />
</state>
<state value="DISABLED">
<color value="WHITE" type="TEXT_FOREGROUND" />
</state>
</style>
<bind style="MenuItemStyle" type="region" key="MenuItem" />
So now I am looking to target lets say only the AccountMenu JMenu and give it the same style as JMenuItems and not JMenus
To be more clear, please see picture:
Menu Layout http://avengerpaintball.co.za/screen01.jpg
File is a JMenu as well as Manage Account. So now the Account Menu takes the Style of File Menu, and that can't work, because they have different background Images.
Thanks