2
I am facing a problem with the look and Feel that I found a little strange, when running the project by the IDE all components are rendered according to the skin I selected, but when I use the JAR, some components are not rendered with the theme I chose.
Both the JAR and the IDE are initiated through the code below:
public class App
{
public static void main(final String[] args) throws ParseException, UnsupportedLookAndFeelException
{
UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel());
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Principal.main(args);
}
});
}
}
Someone has already gone through something similar, the program works perfectly without any error.
Here is the library documentation link Substance that I’m using.
Version of Java CMD:
>java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_05
In the IDE it’s the same:
You may have two versions of Java installed on your pc. For example, running through an IDE it uses one, and giving two clicks in the jar it rotates another, and this can cause some subtle differences. Which IDE are you using? Can you tell which JRE it uses? Try running the jar by cmd using the command
java -jar arquivo.jar
. On cmd you can check the JRE version by doingjava -version
. Make sure it’s the same one the IDE uses. If you cannot solve your problem, try generating an example (MCVE)[pt.stackoverflow.com/help/mcve] and post images if possible.– Math
I’m using only one version of java, I’m using Eclipse.
– claudsan
I did the test on other machines and with Java 7 and it also looks the same. To thinking that could be differences between JDK and JRE.
– claudsan
I don’t understand why you’re calling another Static main function by giving it the args argument. When you create Jframe with all components and when you try to update L&F, you should approach the creation of the object with a Try/catch construct. If you do not show the code in the other main function, it is difficult to say and help much more.
– user13519
@claudsan choose your answer as the one that answers your question. Here we do not use [Solved]
– gmsantos
@gmsantos I can not mark as reply, I will edit the title, thanks.
– claudsan