Results 1 to 2 of 2
Thread: Synth look and feel examples?
- 05-25-2012, 07:49 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 53
- Rep Power
- 0
Synth look and feel examples?
Hey,
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:
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?Java Code:<synth> <style id="default"> <opaque value="true"/> <state> <color value="#404040" type="BACKGROUND"/> </state> <font name="Lucida" size="12"/> </style> <bind style="default" type="region" key=".*"/> <style id="textfield"> <state> <color value="white" type="BACKGROUND"/> </state> <imagePainter method="textFieldBorder" path="Styles/images/textfieldborder.png" sourceInsets="5 6 6 7" paintCenter="false"/> <insets top="5" bottom="6" right="7" left="6"/> </style> <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"/> <state> <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> <state value="PRESSED"> <imagePainter method="buttonBackground" path="Styles/images/button_press.png" sourceInsets="10 10 10 10" /> </state> <state value="MOUSE_OVER"> <imagePainter method="images/buttonBackground" path="Styles/button_over.png" sourceInsets="10 10 10 10" /> </state> </style> <bind style="button" type="region" key="Button"/> </synth>
- 05-25-2012, 10:04 PM #2
Similar Threads
-
Synth.allocate null pointer exception
By stevonator in forum Java AppletsReplies: 0Last Post: 04-25-2011, 11:21 AM -
Synth Look And Feel - Window Decorations
By neptune692 in forum AWT / SwingReplies: 0Last Post: 01-15-2011, 12:51 AM -
Cant find src for SWT examples
By F-Man in forum SWT / JFaceReplies: 0Last Post: 10-16-2009, 02:35 AM -
Dialog Examples in SWT
By Java Tip in forum SWTReplies: 0Last Post: 07-02-2008, 07:54 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks