Hi,
I have an application using synth thar works right. But now, if I call the main method by reflection I obtain this exception and synth isn't loaded:
java.text.ParseException: Error parsing: org.xml.sax.SAXException: ID tabbedPanePainter has not been defined null
at javax.swing.plaf.synth.SynthParser.parse(SynthParser.java:186)
at javax.swing.plaf.synth.SynthLookAndFeel.load(SynthLookAndFeel.java:548)
at com.ya.services.photoprinting2.gui.component.JFrameApp.<init>(JFrameApp.java:123)
at com.ya.services.photoprinting2.gui.component.JFrameApp.main(JFrameApp.java:302)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.ya.services.photoprinting2.updater.application.Updater.startApp(Updater.java:252)
at com.ya.services.photoprinting2.updater.application.Updater.doOptions(Updater.java:287)
at com.ya.services.photoprinting2.updater.application.Updater.main(Updater.java:73)
The application is in jar JPhotoPrinting.jar, and to call main method I do:
StringBuffer sbPhotoPrintingJarPath = new StringBuffer(64).append("file:///").append(sLibDirectory).append("/JPhotoPrinting.jar");
StringBuffer sbSwingWorkerJarPath = new StringBuffer(64).append("file:///").append(sLibDirectory).append("/swing-worker.jar");
URL[] jarUrls = {new URL(sbPhotoPrintingJarPath.toString()),
new URL(sbSwingWorkerJarPath.toString())};
URLClassLoader myclassLoader = new URLClassLoader(jarUrls);
Class theClass = myclassLoader.loadClass("com.ya.services.photoprinting2.gui.component.JFrameApp");
Method mainMethod = theClass.getMethod("main", new Class[]{String[].class});
mainMethod.invoke(null, new Object[] {new String[] {Integer.toString(iEnv)}});
At the main method of JFrameApp I do:
SynthLookAndFeel synth = new SynthLookAndFeel();
synth.load(JFrameApp.class.getResourceAsStream("/resources/data/synth.xml"), JFrameApp.class);
UIManager.setLookAndFeel(synth);
�Which is the problem?
Thanks