Reputation: 1293
I'm creating Swing app and styling it with Synth L&F. When I enabled Synth L&F, combobox arrow button became not visible (I believe, default background is applied). If I click on a place where arrow button is intended to be, it behaves as intended - show list of choices. I'm trying to show it, but I can't find correct binding to be applied to this button:
<style id="arrowStyle">
<state value="DEFAULT">
<insets top="4" left="15" bottom="4" right="4"/>
<color value="RED" type="BACKGROUND"/>
<color value="RED" type="TEXT_BACKGROUND"/>
<color value="GREEN" type="TEXT_FOREGROUND"/>
</state>
<state value="ENABLED">
<insets top="4" left="15" bottom="4" right="4"/>
<color value="RED" type="BACKGROUND"/>
<color value="RED" type="TEXT_BACKGROUND"/>
<color value="GREEN" type="TEXT_FOREGROUND"/>
</state>
<state value="PRESSED">
<insets top="4" left="15" bottom="4" right="4"/>
<color value="RED" type="BACKGROUND"/>
<color value="RED" type="TEXT_BACKGROUND"/>
<color value="GREEN" type="TEXT_FOREGROUND"/>
</state>
<state value="SELECTED">
<insets top="4" left="15" bottom="4" right="4"/>
<color value="RED" type="BACKGROUND"/>
<color value="RED" type="TEXT_BACKGROUND"/>
<color value="GREEN" type="TEXT_FOREGROUND"/>
</state>
</style>
<bind style="arrowStyle" type="name" key="ComboBox.arrowButton"/>
If I apply this style, button don't appear. I don't know where is the problem - am I using correct state? color types? binding?
Thanks
Upvotes: 1
Views: 1234
Reputation: 1293
Correct binding:
<bind style="arrowButton" key="ComboBox.arrowButton" type="name"/>
So far I haven't found how to use colors and states to style combobox arrow button, but predefined image works and is sufficient for my needs:
<imagePainter method="arrowButtonBackground" path="/controls/combobox_arrow_button.jpg" sourceInsets="8 8 8 8"/>
Upvotes: 1