1

I am trying to use synth look and feel xml to set the background image of a JToggleButton which seems to work but the text in the button isn't displaying. Is there something that I'm missing? Here's the code:

laf.xml:

<style id="dayBtnStyle">
    <insets top="4" left="18" right="18" bottom="3"/>
    <state>
      <font name="HelveticaNeue" size="40"/>
      <color value="#586A7B" type="TEXT_FOREGROUND"/>
      <imagePainter path="images/keyDay-Off.png"
                    sourceInsets="10 10 10 10"/>
    </state>
    <state value="SELECTED">
      <font name="HelveticaNeue" size="40"/>
      <color value="WHITE" type="TEXT_FOREGROUND"/>
      <imagePainter method="buttonBackground" path="images/keyDay-On.png"
                    sourceInsets="10 10 10 10"/>
    </state>
  </style>
  <bind style="dayBtnStyle" type="name" key="dayBtn"/>

test.java:

  JToggleButton b = new JToggleButton ("test");
            b.setName("dayBtn");
evanb
  • 2,882
  • 16
  • 30
  • Possible duplicate of [How can I implement a custom java synth button style if I have a button style that already exists?](http://stackoverflow.com/questions/5612587/how-can-i-implement-a-custom-java-synth-button-style-if-i-have-a-button-style-th) – mevada.yogesh Nov 08 '16 at 11:59

0 Answers0