« Return to Thread: Using substancelaf.configFile properly

Using substancelaf.configFile properly

by Legéndi Richárd :: Rate this Message:

Reply to Author | View in Thread

Hi guys!

Sorry for being so lame, but I cannot figure out what am I doing wrong.
I've modified the sample application to make it use the settings from a
prop file instead of setting the -Dxxx flags.

Well, I guess I totally miss out the point, because it's not working as
I expected :-)

I just want to set the button sharper to the Standard one, but it still
uses the Classic one.
Although, I'm sure the config file is parsed correctly, because if I set
the substancelaf.enableInvertedThemes flag, I can access them from the
menu...

So, any hints about what I'm doing wrong? I'm playing with this for
hours now, but haven't found any solution :-)

Sincerely,
Richard

The config file I'm using:   (walkthrough.conf)
------------------------
substancelaf.buttonShaper=org.jvnet.substance.button.StandardButtonShaper
#substancelaf.enableInvertedThemes


The modified source:
---------------------
import java.awt.Dimension;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import org.jvnet.substance.button.StandardButtonShaper;
import org.jvnet.substance.skin.SubstanceRavenLookAndFeel;

public class Walkthrough extends JFrame {
    public Walkthrough() {
        super("Sample app");
        this.setLayout(new FlowLayout());
        this.add(new JButton("button"));
        this.add(new JCheckBox("check"));
        this.add(new JLabel("label"));

        this.setSize(new Dimension(250, 80));
        this.setLocationRelativeTo(null);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        JFrame.setDefaultLookAndFeelDecorated(true);
        System.setProperty("substancelaf.configFile", "walkthrough.conf");
       
        try {
         
UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceRavenGraphiteLookAndFeel");
          // It's working this way:
          //SubstanceRavenLookAndFeel.setCurrentButtonShaper( new
StandardButtonShaper() );
        } catch (Exception e) {
          System.out.println("Substance Raven Graphite failed to
initialize");
        }
       
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            Walkthrough w = new Walkthrough();
            w.setVisible(true);
          }
        });
    }
}


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

 « Return to Thread: Using substancelaf.configFile properly

LightInTheBox - Buy quality products at wholesale price!