0

I have been checking on the look and feel for java desktop applications then found the Synth and Nimbus Look and Feel

But I am a little confuse here

can some one tell me:

  • the difference between the two.

  • Which is easier to understand and implement.

  • And which one renders the best interface

Will be happy to have links to example

mKorbel
  • 109,525
  • 20
  • 134
  • 319
CodeAngel
  • 569
  • 1
  • 11
  • 31

2 Answers2

0

You don't have to implement a look and feel. You just apply it to your Swing UI. The code is the same for both.

It is also a matter of taste which one renders the best interface. They both should work fine they just (as the name says) look and feel differently. The differences in the look you can see yourself. Don't know about the differences in the feel (behaviour) and I doubt it's possible to give a satisfying list.

Just implement your UI the way you want it and try out different look and feels afterwards using UIManager.setLookAndFeel().

Personally I think it's a good idea to use the system look and feel. It makes the UI look like the system default. E.g. on Windows it looks like a Windows program and on Gnome like a GTK application.

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

You can read further about it at http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

André Stannek
  • 7,773
  • 31
  • 52
0

Using synth look and feel you can give your own custom look and feel by xml file. ex:

    <imagePainter method="panelBackground" path="images/main-bg.png" sourceInsets="0 0 0 0" stretch="true"/>
</style>
<bind style="panelStyle" type="region" key="Panel"/>


 <style id="ProgressBarStyle">       
    <object id="progressbarPainter" class="com.poseidon.desktopframework.images.BackgroundPainter"></object>

    <state>           
        <font name="Verdana" size="14"/>  
        <color value="BLACK" type="TEXT_FOREGROUND"/>
        <painter method="progressBarBackground" idref="progressbarPainter"/>
        <painter method="progressBarForeground" idref="progressbarPainter"/>

        <!--            <imagePainter method="ArrowButtonBackground" path="images/dropdown-icon-big.png" center="true"/>
        <imagePainter method="ArrowButtonBackground" path="images/dropdown-icon-big.png" center="true"/>-->
    </state>
    <!--                <imagePainter method="textAreaBorder" path="images/textbox-small.png" sourceInsets="4 6 4 6" paintCenter="false"/>    -->
</style>
<bind style="ProgressBarStyle" type="region" key="ProgressBar"/>


<style id="fileChooserStyle">
    <imageIcon id="homeIcon" path="images/home.png"/>        
    <object id="fileChooserBackGround" class="com.poseidon.desktopframework.images.BackgroundPainter"></object>

-->

Vishal Chaudhari
  • 403
  • 1
  • 6
  • 13