Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm trying to install Sea Glass Look and Feel. I want to install/configure the LaF using a property file, but the tutorial that outlines this process is quite confusing.

That being said, can anyone provide a simple step-by-step guide on installing/configuring a custom LaF using a property file?

like image 345
mre Avatar asked Feb 03 '12 02:02

mre


2 Answers

From their website:

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

To enable the Sea Glass Look and Feel, include the following in your application before creating any controls:

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

We also support setting the user interface on the command line using the VM option

-Dswing.defaultlaf=com.seaglasslookandfeel.SeaGlassLookAndFeel
like image 73
rtheunissen Avatar answered Nov 15 '22 04:11

rtheunissen


Here are the steps to install the Sea Glass L&F using the jar file (Note that i use eclipse so the instructions will be in eclipse)

  1. Download the LaF jar file in their Maven repository.
  2. Put the .jar file in a designated folder in your project
  3. Right click your project folder in eclipse the go to 'Build Path' then select 'Configure Build Path'
  4. Under Libraries tab, click 'Add External Jar' and go to the folder that contains the jar file
  5. Click Ok then in your code go to your public static void main(String[] args) and copy paste this snippet:

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

There you go, the L&F is now applied. If you have questions just ask it

like image 24
itsariadust Avatar answered Nov 15 '22 05:11

itsariadust