This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JavaFX and the fly likes JavaFx XML file read Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "JavaFx XML file read" Watch "JavaFx XML file read" New topic
Author

JavaFx XML file read

nayela khan
Greenhorn

Joined: Sep 10, 2009
Posts: 5
Hi all,

I am new to JavaFx scripting and due to time constraints couldnt read much about it.
I have a requirement wherein i need to read the contents of an xml file. I found an example on the net but couldnt get it working..
This is my code




i am getting an exception at

i have a temp folder in my project directory with test.xml file...
i am not able to find out what the problem is.. can someone please help... any help is greatly appreciated
nayela khan
Greenhorn

Joined: Sep 10, 2009
Posts: 5
I am getting a
java.security.AccessControlException:access denied(java.io.FilePermission \temp\test.xml)

Can some one please help?
Philippe Lhoste
Greenhorn

Joined: Oct 23, 2009
Posts: 28
nayela khan wrote:AccessControlException:access denied

Are you testing it in applet mode? In this case, you must sign the applet.

Looking again, I see backslashes. You are on Windows? You should specify a drive (absolute path), I think, something like: "E:/temp/test.xml"
It is hard to say on which drive the current directory is (unless you have only one disk & partition).
nayela khan
Greenhorn

Joined: Sep 10, 2009
Posts: 5

Are you testing it in applet mode? In this case, you must sign the applet.


I am not testing in applet mode. I just run the project in netbeans 6 or alternatively, running the project creates a projectName.jnlp file which i can add to widgetFX dock

Looking again, I see backslashes. You are on Windows? You should specify a drive (absolute path), I think, something like: "E:/temp/test.xml"
It is hard to say on which drive the current directory is (unless you have only one disk & partition).


I even tried giving the complete drive path but still get the same exception..
Jiri Goddard
Greenhorn

Joined: Aug 21, 2007
Posts: 21
nayela khan wrote:
Are you testing it in applet mode? In this case, you must sign the applet.


I am not testing in applet mode. I just run the project in netbeans 6 or alternatively, running the project creates a projectName.jnlp file which i can add to widgetFX dock

Looking again, I see backslashes. You are on Windows? You should specify a drive (absolute path), I think, something like: "E:/temp/test.xml"
It is hard to say on which drive the current directory is (unless you have only one disk & partition).


I even tried giving the complete drive path but still get the same exception..


The you probably need to set the permissions. Just follow the link to FilePermission class from this forum.


http://dredwerkz.ic.cz
Philippe Lhoste
Greenhorn

Joined: Oct 23, 2009
Posts: 28
nayela khan wrote:creates a projectName.jnlp file which i can add to widgetFX dock

For the record (I already answered in the Sun forum...), WidgetFX requires its widgets to be signed like an applet when doing system access.
 
 
subject: JavaFx XML file read
 
Similar Threads
JSlider issue
How does JavaFX relate in the WorkPlace.
a question regarding constructors' sequence
Insider's Guide to Mixing Swing and JavaFX
Change the Tick Label Value of X Axis in Java FX