Results 1 to 2 of 2
  1. #1
    trishtren is offline Member
    Join Date
    Feb 2011
    Rep Power

    Default Synth look and feel examples?

    Im not entirely new to java but i am trying to use the synth look and feel feature of swing.
    I have my application using an external xml file for the look and feel however i am struggling to find examples of how to use or declare the styles of different components.
    I tried googling around to see if there was some sort of list or structure to follow and so far all i have found is this which works:
    Java Code:
      <style id="default">
        <opaque value="true"/>
          <color value="#404040" type="BACKGROUND"/>
        <font name="Lucida" size="12"/>
      <bind style="default" type="region" key=".*"/>
      <style id="textfield">
          <color value="white" type="BACKGROUND"/>
        <imagePainter method="textFieldBorder" path="Styles/images/textfieldborder.png" sourceInsets="5 6 6 7" paintCenter="false"/>
        <insets top="5" bottom="6" right="7" left="6"/>
      <bind style="textfield" type="region" key="TextField"/>
       <style id="button">
      	<!-- Shift the text one pixel when pressed -->
        <property key="Button.textShiftOffset" type="integer" value="1"/>
        <!-- set size of buttons -->
        <insets top="15" left="20" bottom="15" right="20"/>
          <imagePainter method="buttonBackground" path="Styles/images/button.png"
                               sourceInsets="10 10 10 10" />
          <font name="Dialog" size="16"/>
          <color type="TEXT_FOREGROUND" value="#FFFFFF"/>
        <state value="PRESSED"> 
          <imagePainter method="buttonBackground"
                       sourceInsets="10 10 10 10" />
        <state value="MOUSE_OVER">    
          <imagePainter method="images/buttonBackground"
                     sourceInsets="10 10 10 10" />
      <bind style="button" type="region" key="Button"/>
    While this works, i am having a huge struggle to find examples of other keys like "Button", "Textfield" etc. I would like to style a custom menu bar and all other components but again like i said there seems to be very limited examples of which Key's refer to which components in the swing gui. Menubar as a key seems to crash my application as does a variety of other keys. Can anyone maybe send me a link or give me a hint as how to find the keys of all the components in swing?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: Synth look and feel examples?

    Moved from New to Java

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Synth.allocate null pointer exception
    By stevonator in forum Java Applets
    Replies: 0
    Last Post: 04-25-2011, 12:21 PM
  2. Synth Look And Feel - Window Decorations
    By neptune692 in forum AWT / Swing
    Replies: 0
    Last Post: 01-15-2011, 01:51 AM
  3. Cant find src for SWT examples
    By F-Man in forum SWT / JFace
    Replies: 0
    Last Post: 10-16-2009, 03:35 AM
  4. Dialog Examples in SWT
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-02-2008, 08:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts