954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Conversion from java code to javaFX script

Hello,
I have a script written in Java that gets me an answer from a script containing a number of files. The problem is I don't know how to code this in javaFX script as I am very new to it.

URL url = new URL(page);
        URLConnection conn = url.openConnection();
        conn.setDoOutput(true);
    
        // Get the response
        BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String line="";
        int i=0;
        while ((line = rd.readLine()) != null) {
            if(i>=2)
               songPaths[i-2]=line;


            i++;

        }

        rd.close();


I tried something like this... but I don't know how to use the constructors... the syntax so I need some help please.

var url:URL;
var conn:URLConnection;
var rd:BufferedReader;

conn.setDoOutput(true);

conn = url.openConnection();
conn.setDoOutput(true);
//the rest of code it's just buggy, doesn't compile as I don't know how to translate it from java to javaFX


Please help... thanks.

Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 11
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: