2007/10/31

JavaFX another Applet? (Add proxy support to WeatherFX)


Sun provides a new Scripting Language though Sun call it JavaFX Framework. It targets the Rich Content market.

The demos are interesting, but other than Silverlight, I don't think it has something new compares Flash to Ajax. Maybe Adobe Java based Flash Player is better. I hope it don't become another Applet.

I tried and read the WeatherFX demo application. It's lack of component and original functions. So the code of application is very long. Without a good GUI IDE I cannot believe it is productive.

Btw, I found WeatherFX cannot support proxy. Because the key logic is based on Java Beans. I add the proxy support to it.


private static final InputStream getInputStreamFromURL(URL url) throws IOException {
Properties properties = System.getProperties();
properties.put("http.proxyHost", httpProxyHost);
properties.put("http.proxyPort", httpProxyPort);
//String encodedLogin = new BASE64Encoder().encodeBuffer(login.getBytes());
URLConnection con = url.openConnection();
//con.setRequestProperty("Proxy-Authorization", "Basic " + encodedLogin);
con.connect();
return con.getInputStream();
}

No comments: