How can I extract images form other web pages with an applet?

Hello
I have a problem
Here is my code
import java.net.*;
import javax.swing.*;
import java.awt.image.*;
public class Cursbnr extends JApplet{
public JLabel EuroValue =new JLabel();
     public JLabel DolarValue =new JLabel();
     public JLabel GoldValue =new JLabel();
     JPanel EuroBar = new JPanel();
     JPanel DolarBar = new JPanel();
     JPanel GoldBar = new JPanel();
     Image EuroImg=null;
     Image DolarImg=null;
     Image GoldImg=null;
     try{          
          EuroImg = this.getImage(new URL("http://www.bnro.ro/Images/Flags/eur.gif"));
          DolarImg = this.getImage(new URL("http://www.bnro.ro/Images/Flags/usd.gif"));
          GoldImg = this.getImage(new URL("http://www.bnro.ro/Images/Flags/xau.gif"));
catch (MalformedURLException e) {
     System.err.println(e);
When I run this applet whith eclipse it's working, but when I put the class file into a html and I ran the html it's not working
What can I do?

Duplicate of this post, reply there: http://forum.java.sun.com/thread.jspa?threadID=670274&messageID=3918814#3918814

Similar Messages

  • How can I extract information from a web page

    I wanna read some information from a webpage, and then put those information together into a table. Since I only know the url, not the file path, when I use BufferedReader(new FileReader(FilePath)), there is a FileNotFoundException. How can I do that? Thanks a lot.

    You can do it in following way....
    First you need to create the object of URL by specifying the URL name.
    URL myurl = new URL("http://www.xyz.com/index.html"); //specify your URL path here
    URLConnection conn = null;
    DataInputStream data = null;
    String line;
    StringBuffer buf = new StringBuffer();
    try {
    conn = myurl.openConnection();
    conn.connect();
    data = new DataInputStream(new BufferedInputStream(
    conn.getInputStream()));
    while ((line = data.readLine()) != null) {
    buf.append(line + "\n");
    data.close();
    catch (IOException e) {
    System.out.println("IO Error:" + e.getMessage());
    So, at the end, you have the data in your string buffer...you can use it wherever u want.
    Hope this helps

  • How can I introduce text in a web page with automator?

    I want to create a workflow with automator for httpS web pages in which I have to introduce the user and password. how can I do?

    Try this:
    set the clipboard to item 1 of (get name of (static text of group 104 of UI element 1 of scroll area 1 of group 4 of window "Account Summary" of application process "Safari"))
    (10906)

  • How can I extract image from complex (multycoloured0 background?

    How can I extract image from complex (multycoloured) shot?

    I would say either using the pen tool or the quick mask tool but without seeing how complex the image/background is I can't give you a complete answer...?
    Can you post the image?

  • How can i see visitor statistics for web page hosted on osx lion server

    Hello
    how can i see visitor statistics for web page hosted on osx lion server
    Thanks
    Adrian

    Just click inside the url address bar. Full url address highlighted, will appear.
    Best.

  • HT4356 How can I airprint part of a web page?

    How can I airprint part of a web page using iPad and Safari?

    Copy (or cut) the area you want to print, and paste it in to a new document.
    Or take a screen shot (by simultaneously holding Shift + Command + 4 keys) of the area you want to print, then print the resulting screen shot file (which appears on your desktop).

  • How can I extract images from a keynote presentation?

    Keynote itself sometimes provides images - for example, the cover of a book in the Leather Book theme. How can I extract this image in order to manipulate it? I saw an answer that seemed to help, which was to ensure that the keynote file was saved as a package - but there doesn't seem a way to make this happen with an existing presentation, since there is no 'Save As' any more and duplication doesn't seem to hack it. I'm using MacOS Lion 10.7.5.
    TIA

    I found a solution. In the Format area, select the "Image" tab. You should see the file name there. Click and hold the name and drag and drop it to your desktop (or anywhere else you want to save it). It worked perfectly for me. Hope it helps!

  • How can I extract images from Numbers?

    Sounds a bit stupid but how do you extract images from Apples 'Numbers 3' on a Mac?  I have a client that sends images in XLS files, that normally in Word I would Alt Click and 'save as...'
    I was trying to stop using Word but this simple little feature will make all the difference.
    Can anyone point me in the right direction.
    Thanks,
    Dave

    Hi Wayne,
    Thank you for your response.  Sadly if you do this it copies in to the MACs clipboard as a snap shot of the image at the dimensions in Numbers.
    Eg. 
    An image I've extracted from the document via Excel saved out at it's original dimensions 1024 x 300px, even though it was placed, then scaled down to 300px wide on the sheet.
    Same image copied then pasted in to an image editor (as I couldn't paste into finder) was only 300px wide.
    The feature I need is to be able to save out the original image placed in the Numbers sheet.
    Anyone with ideas on this?

  • How to save an image from an web page?

    Hello everybody!
    I have a problem and I hope someone can help me :).
    I am trying to save/download an image from an web page to my computer. So given an URL which contains the image, I want to save this/write this image to disk. Here is my code:
    import java.net.*;
    import java.io.*;
    public class Test{
        public static void main(String[] args) throws Exception{
            Test test = new Test();
            test.readFile();
        public void readFile() throws Exception{
            InputStream inputStream = new URL("http://www.google.se/images/hp1.gif").openStream();
            InputStreamReader reader = new InputStreamReader(inputStream);
            BufferedReader buffReader = new BufferedReader(reader);
            BufferedWriter bw = new BufferedWriter(new FileWriter("savedImage.gif"));
            int x=0;
            while((x = buffReader.read()) != -1) {
                bw.write(x);
            bw.flush();
    }The code saves the image to disk, but unfortunately the image is distorted. Can anyone help me to solve this problem.
    Thanx in advance
    Best regards
    /TheMan

    thanx guys for your quick answers. I got i to work with the following code
    InputStream inputStream = new URL("http://www.google.se/images/hp1.gif").openStream();
            FileOutputStream fos = new FileOutputStream(new File("savedImage.gif"));
            int x=0;
            while((x = inputStream.read()) != -1) {
                fos.write(x);
            fos.flush();Again, thanx guys!

  • How can I save a previously published web page off-line instead of deleting

    I have some web pages with photos I do not want to post anymore on my iWeb site. However, I do not want to "delete" the pages because I spent so much time putting them together. Is there a way to save them off-line somewhere for access later on? I am a Scoutmaster and post photo pages of our hikes and adventures. I prefer to save my "masterpiece" pages somewhere for future reference instead of deleting them, which is the only option, to make room for more pages.
    Thank you so much for assisting me.
    p.s. Is there a number limit to the amount of photos I can drag over from iPhoto to an iWeb photo page?
    iMac, Powerbook G4, MacBook Pro   Mac OS X (10.4.10)   Love Macs. I've owned a Mac since the 128 in 1984.

    See this article: "Separating Sites in a single Domain"...
    http://web.mac.com/mark8heaton/iWeb/DomainSeparation/SiteSeparation.html
    iWeb's Help viewer says: "The photo grid holds up to 99 photos." But you can have multiple Photos pages and create a living, growing photo gallery...
    http://www.mac.com/web/en/Tips/013C4180-4787-4847-BAAB-319222AFC652.html

  • How can I get a Japanese flash web page to display 100% correctly?

    I've tried everything I can think of but I can't get some of this web site's font to display correctly. Some of the flash shows in the correct, Japanese, characters, but some of it shows as code. If I log in as a different user, and set that user's International Language preferences to Japanese, the web page displays correctly. But, when I change users, and go back to the English user, the page displays in a mix of Japanese and messed-up code.
    Here is the page: http://weathernews.jp/livecam/
    If I click onto a different page of that website, http://weathernews.jp/map/
    the writing appears as Japanese in the box, at the bottom of the map.
    But, if you click on that map, and zoom in 3-times, to the city level, the font in the box under the hourly weather and weekly weather appears as code, and not Japanese.
    I'm guessing that it is a problem with the computer booting-up as being English or Japanese, and the browser, then not being able to detect which version of flash to run, the Japanese or English version, cannot display the font correctly.
    Why does it happen only on some pages and not all of the pages on that site?
    Can it be fixed?
    If so, how?
    Thanks!

    Yeah, I tried Opera and Firefox, but I get the same garbled text. The only thing that makes that page open and display correctly is switching to a different user, and making that user's main language Japanese, in the international settings.
    Of course none of this is all that important, I mean, it's about viewing a weather page, but I am just curious why some of the Flash is read or written so that an English language set user can see some of it displayed correctly, but not all of it, where as a user set to Japanese language settings can get all pages correctly.
    I know it has to do with how the Flash Macromedia sees the main language setting for the computer, but what I don't get, is how come a user using Japanese as the main language can read English and Japanese Flash pages (pages with English commanded Java come up correctly), but using English as the main language only allows me to view Flash pages written using English commands. Can I change my Flash program to read Japanese pages, without changing my computers main language to Japanese? Or am I stuck with a Flash program that must match the main language the user is using?

  • (how) can I access Java APIs from web-page-hosted JavaScript?

    Can I access Java APIs from a web-page via JavaScript if I have a JRE installed on the client machine? And if so, how?
    Thanks in advance for your time and consideration.

    John L. wrote:
    Can I access Java APIs from a web-page via JavaScript if I have a JRE installed on the client machine? And if so, how?As far as I can remember that was actually possible in the very first versions of Netscape because Netscape really wanted to pretend Javascript and Java were meant to be used together. But they soon removed that functionality. Can you guess why?
    Because people were using the File/IO classes to easily steal or remove files on the harddrive, among other such niceties. You do NOT want to have such control from a web application. People will abuse it.

  • Can I invoke Oracle Form from web page?

    Does anyone know how can I invoke an Oracle Forms form from an html page?

    Hi Hans
    That's what I thought re the url but I can't find out what it is, it briefly appears in the browser but then goes leaving me with the formsweb.cfg config url. I am running from the Builder on Windows 2000 and it's Forms 10g.
    Marc

  • How can I see 2 or more web pages on my screen at once?

    Although I can open multiple windows in Safari, I can't see them side by side.  How can I do that?  It must be possible.

    While you have 2 or more panels open, select one of them.
    Click on Window and select move Panel in a new window.

  • How can I Append the same (altered) web page to the same Acrobat 9 Pro PDF file more than once

    The Acrobat 9 Pro utility in IE 8 of the Windows 7 Pro OS has a selection to "Append to Existing PDF," however it only allows appending the same web page one time only.  if the majoriety of the page data content is changed by selecting list item at the top of the page, I need to (re-)add the page with new content to the same (selected) PDF file, however the utilitiy does not allow this due to its maintaining a special index of each page base on the page URL or name.  Can the this index or the page itself be changed whenever the page is altered to make Acrobat think it is a new page? 

    I don't use IE, but I would suspect you can clear the cache or such to reset this option. You could also just open the web site directly in Acrobat and play the game there.

Maybe you are looking for