Re: Synth XML file placement



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
.



Relevant Pages

  • problem with running synth example file
    ... i have a stupid problem with running examples from Synth ... I take Example1.java file and copy it, and then create new xml file ... I Use NetBeans 5.5. ...
    (comp.lang.java.help)
  • Re: For Ilya Tumanov
    ... i mount the App in the iPAQ and works ok... ... "David Fúnez" wrote in message ... >> VS would redeploy and overwrite modified XML file. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: WinForms and local DB
    ... XML file as physical storage and read all data in XML file into DataSet and ... have the DataSet stay in momery when the Windows app is running. ... > spoiled by SQL Server and SQL Server CE. ... > would be if I could make something like SQL Server CE local database work ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: How to pass Application.Item value back to class?
    ... I just noticed that your message did mention that your prlbme was with ... Other classes must refer to the static "Current" member of ... > Suggestions please for strategy to share values across app. ... The xml file has different nodes for different ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Support of a large table
    ... > display different parts within different controls of a vb app. ... > One part of the XML file identifies information about processor cylces. ... > demanding on memory. ...
    (comp.lang.basic.visual.misc)