Apply Syntheticablackeyelookandfeel to the application

Asked

Viewed 250 times

2

I would like to know how I can apply new look and Feels that are not part of JDK. In trying to apply, is giving an error in which I did not find an answer that could solve the problem.

For example: The Synthetica Classy Look and Feel:

Test Class:

import de.javasoft.plaf.synthetica.SyntheticaBlackEyeLookAndFeel;
import java.text.ParseException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public class JavaApplication12 {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    try {
        UIManager.setLookAndFeel(new SyntheticaBlackEyeLookAndFeel());
    } catch (UnsupportedLookAndFeelException | ParseException ex) {
        Logger.getLogger(JavaApplication12.class.getName()).log(Level.SEVERE, null, ex);
    }        
    JOptionPane.showMessageDialog(null, "Teste");
}

}

Error description:

Reference to setLookAndFeel is ambiguous Both method setLookAndFeel(Lookandfeel) in Uimanager and method setLookAndFeel(String) in Uimanager match

1 answer

2


According to the official website and how it can be seen in this answer, the correct way to apply is as follows:

try {

  UIManager.setLookAndFeel("de.javasoft.plaf.synthetica.SyntheticaBlackEyeLookAndFeel");

} catch (Exception e) {

  e.printStackTrace();

}

Remembering that one should also add the synthetica. in the classpath, in addition to the downloaded theme jar (in your case, the syntheticaBlackEye.jar) before making this call, as can be seen below in the example print:

inserir a descrição da imagem aqui

  • It runs according to the look and Feel metal, I added the jar downloaded in the library...

  • Could be the version of Netbeans, it does not find the class. java.lang.Noclassdeffounderror: de/javasoft/plaf/synthetica/Syntheticalookandfeel

  • @Ulissesgimenes I edited with additional information, please try to follow new answer guidelines.

  • 1

    It worked, I appreciate the help, I hadn’t imported the synthetics..

Browser other questions tagged

You are not signed in. Login or sign up in order to post.