How to install / configure custom Java Look-And-Feel?

I am trying to install Sea Glass Look and Feel. I want to install / configure LaF using a properties file, but the tutorial describing this process is rather confusing.

How can I say, can someone provide a simple step-by-step guide on installing / configuring custom LaF using a properties file?

+5
source share
3 answers

On its website:

To use Sea Glass Look and Feel, you must either include our Maven repository in your pom.xml file, or load the jar file and include it in your class path. See the download page for more details.

Sea Glass Look and Feel, :

try {
    UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel");
} catch (Exception e) {
    e.printStackTrace();
}

VM

-Dswing.defaultlaf=com.seaglasslookandfeel.SeaGlassLookAndFeel
+6

Sea Glass L & F jar ( , eclipse, eclipse)

  • LaF jar Maven.
  • .jar
  • eclipse, " ", " "
  • "" " " , jar.
  • "", public static void main(String[] args) :

    try {
        UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel");
    } catch (Exception e) {
        e.printStackTrace();
    }
    

, L & F . ,

+3

I have no problems with NB IDE

enter image description here

from code

import java.awt.*;
import javax.swing.*;
//import javax.swing.plaf.InsetsUIResource;

public class NimbusJPanelBackGround {

    public NimbusJPanelBackGround() {
        JFrame f = new JFrame();
        JButton btn = new JButton("  Whatever  ");
        JButton btn1 = new JButton("  Whatever  ");
        JPanel p = new JPanel();
        p.add(btn);
        //UIManager.getLookAndFeelDefaults().put("Button.contentMargins", new InsetsUIResource(0, 0, 0, 0));
        //SwingUtilities.updateComponentTreeUI(f);
        p.add(btn1);
        f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        f.add(p, BorderLayout.CENTER);
        f.setSize(200, 100);
        f.setLocation(150, 150);
        f.setVisible(true);
    }

    public static void main(String[] args) {

        /*try {
        for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(laf.getName())) {
        UIManager.setLookAndFeel(laf.getClassName());
        UIManager.getLookAndFeelDefaults().put("Panel.background", Color.white);
        }
        }
        } catch (Exception e) {
        e.printStackTrace();
        }*/

        try {
            UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel");
        } catch (Exception e) {
            e.printStackTrace();
        }


        EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                NimbusJPanelBackGround nimbusJPanelBackGround = new NimbusJPanelBackGround();
            }
        });
    }
}

EDIT:

and Notification of the L & F subject to view my response requires a user reputation> 10k, the response is deleted by the community as not an answer :-)

+2
source

All Articles