Re: Synth XML file placement
- From: Andrew Thompson <SeeMySites@xxxxxxxxxxx>
- Date: Mon, 27 Jun 2005 16:40:45 GMT
On 27 Jun 2005 08:19:18 -0700, Wizumwalt@xxxxxxxxx wrote:
> Anyone know where the synth XML file is supposed to be located.
What's a 'synth'?
>.. My app
> never seems to pick it up no matter where I put it. I run a *.bat file
> to execute my app and the main file is in a jar in the bin dir
Where is the bat file?
>..and my xml file is not in the jar, but also in the bin dir.
Is it in the jar or not? 'not' implies no, but 'also' implies yes.
>..I put the xml file in the String path below.
Arg!! Strings for specifying paths (shudder).
> Here is what I have ...
>
> ---
> SynthLookAndFeel synth = new SynthLookAndFeel();
> String synthXML = new String("bin"
> + System.getProperty("file.separator")
> + "mylaf.xml");
You need to find out more, right this.
<sscce>
import java.io.*;
import java.net.*;
public class IO {
public static void main(String[] args) {
try {
File currentDir = new File(".");
System.out.println( "Current Directory: " +
currentDir.getCanonicalPath() );
URL thisClass = currentDir.
getClass().getResource(
"IO.class");
System.out.println( "URL this class (no prefix): " +
thisClass );
thisClass = currentDir.
getClass().getResource(
System.getProperty("file.separator")
+ "IO.class");
System.out.println( "URL this class 'file.separator': " +
thisClass );
thisClass = currentDir.
getClass().getResource(
"/"
+ "IO.class");
System.out.println( "URL this class (leading '/'): " +
thisClass );
System.out.println("System.getProperty('file.separator') " +
System.getProperty("file.separator"));
} catch(Exception e) {
e.printStackTrace();
}
}
}
</sscce>
> if (is == null) {
> // Always falls here ...
> System.err.println("Unable to find theme configuration");
> }
If that fails, it seems little point to continue to..
> synth.load(is, aClass);
// is is null!
> UIManager.setLookAndFeel(synth);
// setLookAndFeel(null) ..assuming it got this far.
> Any help much appreciated.
Compile and run the source and see if that clarifies it for you.
HTH
--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
.
- Follow-Ups:
- Re: Synth XML file placement
- From: Wizumwalt@xxxxxxxxx
- Re: Synth XML file placement
- References:
- Synth XML file placement
- From: Wizumwalt
- Synth XML file placement
- Prev by Date: Re: automatically maximize JTable?
- Next by Date: Re: automatically maximize JTable?
- Previous by thread: Synth XML file placement
- Next by thread: Re: Synth XML file placement
- Index(es):
Relevant Pages
|
|