1

I made a currency converter that gets the latest currency rates from yahoo. As long as I run it from the applet viewer it works fine, I can convert any currencies. When I open the html file the applet works but I can't convert any currencies and I can't retrieve any rates.

        Url = "http://finance.yahoo.com/q?s=EURUSD%3DX&ql=1";

        URLPage = new URL(Cur);
        Input = new BufferedReader(new InputStreamReader(URLPage.openStream()));
        while ((inputLine = Input.readLine()) != null) {
          results = results + inputLine;
        }

        Input.close();
        Pattern patternSeeked = Pattern.compile("x\">([0-9.]+)</span>");
        Matcher findMatch = patternSeeked.matcher(results);
        findMatch.find();

The exception I get is java.security.AccessCOntrolException: access denied("java.net.SocketPermission" "finance.yahoo.com:80" "connect,resolve");

0 Answers0