简体   繁体   English

Synth和Nimbus外观之间的区别

[英]Difference between Synth and Nimbus look and feel

I have been checking on the look and feel for java desktop applications then found the Synth and Nimbus Look and Feel 我一直在检查Java桌面应用程序的外观,然后发现SynthNimbus外观

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 链接到示例将很高兴

You don't have to implement a look and feel. 您不必实现外观。 You just apply it to your Swing UI. 您只需将其应用到您的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() . 只需按照您想要的方式实现UI,然后使用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. 它使UI看起来像系统默认值。 Eg on Windows it looks like a Windows program and on Gnome like a GTK application. 例如,在Windows上,它看起来像Windows程序,在Gnome上,它看起来像GTK应用程序。

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

You can read further about it at http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 您可以在http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html上进一步了解它

Using synth look and feel you can give your own custom look and feel by xml file. 使用合成器外观,您可以通过xml文件提供自己的自定义外观。 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>

--> ->

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM