Opening image files in java applet

Hi,
I made an applet that opens up the image file and displays it.
When the photo is loaded, the program sets boolean photoLoaded = true;
and when the image is loaded, it has to do something else.
the problem is that I have to open the file twice meaning I would click
"open" button and select the photo, which doesn't do anything, so I have to go back
and click open button, select the photo, and open up again.
When I changed the code slightly so that it shows the first time, photoLoaded is still false the first time,
so I still have to open it up twice for photoLoaded to be true.
methods for opening an image file:
    private void loadPhoto() throws Exception{
        Frame parent = new Frame();
        FileDialog fd = new FileDialog(parent, "Please choose a image file:",
            FileDialog.LOAD);
        fd.show();
        String selectedImage = fd.getFile();
        if(selectedImage == null){
            // no image file selected
        }else{
            File ffile = new File(fd.getDirectory() + File.separator +
                                fd.getFile());
            boolean canOpen = accept(ffile);
            if(canOpen){
                imageLoaded = kit.getImage(selectedImage);
                width = imageLoaded.getWidth(ob);
                height = imageLoaded.getHeight(ob);
                /*get image*/
                imageLoaded = getImage(getCodeBase(), selectedImage);
                tracker.addImage(imageLoaded, 0);
                /* wait until image is loaded */
                try{
                    tracker.waitForAll();
                    photoLoaded = true;
                }catch(InterruptedException ex) {
                    //does nothing
                repaint();
    public boolean accept(File f){
        if(f.isDirectory()){
            return true;
        String extension = Utils.getExtension(f);
        if(extension !=null){
            if(extension.equals(Utils.gif) ||
               extension.equals(Utils.jpeg) ||
               extension.equals(Utils.jpg)){
                   return true;
            } else{
                return false;
        return false;
    public static class Utils{
        public final static String jpeg = "jpeg";
        public final static String jpg = "jpg";
        public final static String gif = "gif";
        /* get the extension of a file */
        public static String getExtension(File f){
            String ext = null;
            String s = f.getName();
            int i = s.lastIndexOf('.');
            if(i>0 && i<s.length()-1){
                ext = s.substring(i+1).toLowerCase();
            return ext;
    }and the paint method:
    public void paint(Graphics g)
        g.drawImage(background, 0, 0, this);
        if(photoLoaded == true){
            g.drawImage(imageLoaded, startingPtX, startingPtY, ob);
    }does anybody have idea on what's wrong with it?
thanks!

Is this what you mean by you have to load it twice? You load the image, then add it to the MediaTracker, then you do what ever you want with it--like get the width and height and set you flags.
   imageLoaded = kit.getImage(selectedImage);
   width = imageLoaded.getWidth(ob);
   height = imageLoaded.getHeight(ob);
   /*get image*/
   imageLoaded = getImage(getCodeBase(), selectedImage);
   tracker.addImage(imageLoaded, 0);

Similar Messages

  • How can I upload a (image) file through an applet ?

    How can I upload a (image) file through an applet ?

    have a look at http://www.haller-systemservice.net/jupload/
    i'm using Apache Jakarta HTTPClient to create a new HTTP connection to the webserver and sending a new POST request, which holds the image file. (So it's RFC1867 conform)
    there is also an open source implementation of such an applet on sourceforge. it's also called JUpload, but i think it's not maintained any more.

  • Key words for opening Image files( for editing !)

    Hi ;
    I need to open Image files ( types : .jpg , tif , gif , bmp ) in my application inorder to edit them in the application ( I have methods that do that ) but I don't know how to open the files .
    If anyone has key words or resource for some code it would be very helpfull .
    thanx ;
    Adaya .

    http://java.sun.com/docs/books/tutorial/2d/index.html
    Spieler

  • Opening image files in their own windows in PS4

    Before PS4, I could open image files in their own windows. In PS4, when I want to open more than one file, these open with tabs and any new file I open is added to the tab queue. It is annoying to right click on each tab so each file is in its own window. Is there a universal preference to change this annoying behavior?
    Using a Windows environment with Photoshop CS4 Extended.

    see the tabs setting in the preferences. you can turn that off.

  • How to open forms in separate Java Applet rather then Internet explorer

    Aslam o Alikum (Hi)
    I want to open my form in separate Java Applet rather then in Internet Explorer.
    Please help
    Best Regards,
    Nasir Zeeshan.

    Aslam o Alikum (Hi)
    Let me explain my question
    when i run my form from application server. it opens a web browser and display my form into it (form display in java applet embbeded in internet explorer). But what i want is that the web browser open the form in java applet as a separate window.
    Is it clear now ?
    Best Regards,
    Nasir Zeeshan.

  • How to open/read file using Java in Unix?

    Hi Friends,
    Can you please help me out how to open/read file using java in unix os? I have create one text file in "/home/test.txt" in unix environment. How to open the same file & read using java code?
    - Hiren Modi

    http://java.sun.com/docs/books/tutorial/essential/io/index.html

  • File Uploader Java Applet cannot be run

    I have a website that I need to upload PDFs to, but since ugrading to Lion, I cannot do it any more.  I have downloaded the separte Java app, but it still does not work.
    This is the error message I get:
    File Uploader Java Applet cannot be run. Make sure that Java is installed on your PC and Java applets are permitted in browser settings. Use this link to download and install appropriate version of Java:

    Thank you etresoft - that did not solve the problem.  However, I did fix it by changing something in Java Preferences (which is located in the Utilities Folder).
    I first deleted the cache files as you suggested in the Network tab.  Then I quit and restarted Firefox.  I still got the same error message when I tried to upload.
    Then, I went back into Java Preferences and checked the box, "Enable Appplet Plug-in and Webstart Applications" located in the General Tab.  I then quit and restarted Firefox.  Now I am able to upload documents as I could before Lion.
    Thank you!!

  • CS3 Extended having problems opening image files.

    I had a CS3 Master Collection from The Art Institute forced us to buy that I had never opened because Photoshop 7 worked fine & I didn't need all the other crap that came with CS3 in the Master Collection. So I had been using Photoshop 7 for years & years, but when I got a new computer, Photoshop 7 didn't work anymore. If you can't tell me what's wrong with CS3, maybe you can tell me how to get my old 7 working on 64 bit windows?
    Getting this stuff out of the way:
    *Brand new computer, Windows 7 Pro, 64 bit.
    *Adobe Creative Suite 3 Master Collection, installed about 3 months ago.
    *CS3 Extended was working just fine for 1 or 2 months with no problems.
    *Problem: CS3 stops responding or hangs exsessively when opening image files.
    *Already tried alt/ctrl/shift reset.
    *Already deleted all the printers.
    *Already tried the tilde in front of the TWAIN.
    *This Master Suite takes like 3 hours to install, so reinstalling is something I'd rather avoid.
    *Yes, it's updated.
    *Yes, the licence was renewed.
    PSE Error Log:
    2011:06:05 23:52:09 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:05 23:53:08 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:05 23:53:55 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:05 23:54:19 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:05 23:54:54 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:06:05 23:54:54 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:06:05 23:54:54 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:05 23:55:02 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:06:05 23:56:22 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:05 23:56:49 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:05 23:57:17 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:05 23:58:01 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:05 23:58:17 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:05 23:58:43 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:05 23:59:51 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:00:34 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:00:58 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:01:26 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:01:54 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:02:18 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:02:54 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:03:21 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:05:20 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:05:33 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:06:00 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:09:33 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:16:38 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:20:43 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:22:23 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:23:42 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:25:42 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:31:55 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:34:05 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:35:05 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:37:58 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:38:31 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:39:38 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:40:06 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:40:45 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:41:12 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:41:59 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:42:58 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:44:01 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:44:31 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:46:09 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:46:47 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:48:18 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:51:02 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:51:54 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:54:01 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:56:09 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:56:42 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:57:16 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 00:57:36 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:06 03:22:50 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:06:17 02:18:38 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:06:17 02:18:38 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:06:17 02:19:00 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:09:01 05:01:58 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:01:59 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:01:59 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:01:59 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:02:00 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:02:00 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:02:00 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:02:01 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:02:01 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:02:01 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:02:02 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:02:02 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:02:02 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:02:03 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:04:02 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:10:44 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:01 05:13:42 : ..\winsupp\Printing.cpp : 1297 : REQUIRE failed
    2011:09:03 22:18:39 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:09:03 22:18:39 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:09:03 22:26:03 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:09:03 22:26:03 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:09:03 22:26:49 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:09:03 22:28:02 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:09:03 22:28:02 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:09:03 22:28:29 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:09:04 21:18:10 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:09:04 21:18:10 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:09:05 15:49:01 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed
    2011:09:05 15:49:01 : ..\..\le\sources\ExifSupport.cpp : 2866 : REQUIRE failed

    Terabyte drive. 80% free space.
    Yeah, I reinstalled. Can't believe I had to go through 4 discs to reinstall one program for the suite.
    Reinstalling windows is overkill when" error check," & "SFC /scannow," & "boot repair" are sufficient.
    Found out that it WILL work if you don't have a browser window open, but I like to listen to stuff on the net when using photoshop. I dunno why the browser makes photoshop refuse to open or create new images, but it would be helpful to know.
    Also, despite not having a printer, the error log seems to indicate that it's part of the problem.
    Oh, I forgot to mention that I did defrag after reinstalling. I know someone will bring it up if I don't.

  • How I can open Image File

    I guess it is simple but I do not know how I can in this class open Image file. This code should go instead of the line:
    window.setSize(450,300);
    Please, help me.
    Pan.
    class ItemHandler implements ActionListener {
              public void actionPerformed( ActionEvent e )
                   for ( int i = 0; i < techItems.length;i++ );
                   if (techItems[ i ].isSelected() ){
                   window.setSize(450,300);
                   break;
                   repaint();
         }

    The easiest way is to use a JLabel where you have an image. Something like this:
    JLabel lbl = new JLabel(new ImageIcon("icon.gif"));
    JPanel p = new JPanel();
    p.add(lbl);
    Klint

  • Can i open a ppt file in java applet?

    is there any to show a power point presentation through java applet i

    None readily available as far as I know (Jakarta HSSF POI doesn't seem to be there yet IIRC), but I'm sure it's possible to write one oneself...

  • Having problem with importing images to a java applet in web broswer

    I'm creating a mini 2d game just for fun and I am running it as a applet with the JApplet class.
    This is my html file.
    <html>
    <body>
    <applet code=ambiDexApplet.class name=ambiDexApplett archive=ambiDexApplet.jar
         width=640 height=480>
         <param name="Player" value="Player.class">
         <param name="Actor" value="Actor.class">
         <param name="Tail_Bead" value="Tail_Bead.class">
         <param name="Block" value="Block.class">
         <param name="Morphable" value="Morphable.class">
         <param name="Item" value="Item.class">
         <param name="GameObject" value="GameObject.class">
         <param name="leftImg" value="Player_Left3.gif">
         <param name="rightImg" value="Player_Right3.gif">
         <param name="img1" value="bgImgFinal.jpg">
         <param name="img2" value="Block_Tower2.gif">
    </applet>
    </body>
    </html>However every time i try to run the program i get the following error when i open the java console.
    java.security.AccessControlException: access denied (java.io.FilePermission Images\Player_Left3.gif read)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    Obviously, the applet is not letting me read the image files. By the way, the .class files and the image files are all in same directory. So can anyone help me please?

    Unfortunately, yes--I've tried it that way over and over, and every other way I could think of.  The files are all in one folder, and I've converted the raw files to both tiffs and jpegs.  I even tried converting them to jpegs at the final pixel dimensions.  Each folder that I have used only contains one type of file, and they are all part of the same sequence and sequentially numbered.  I have even tried renumbering the files with numbers first, numbers last, numbers only, moving underscores.  I moved the files from my external hard-drive to the desktop ... I have a lot less hair than I had only a few days ago!
    I've looked at a few other tutorials that outline the same sequence of steps, and tried them over and over, and then changing one step at a time to make sure that it was not a single step that caused the problem.
    The thing that is really bugging me is that it works fine if I use the different approach of using the place command instead. 
    Anyway, thanks for all of your time.  It's going to be a lot simpler to just stick with 'place' command and I will likely do that, but I tend take things like this as a challenge.  I like to know WHY it won't work for me.  Sometimes it seems that there is just no logical explanation!
    Stuart

  • How to display a .exe file in java applets by avoiding the file downloadbox

    Hi sir,
    I know that in order to display a any file(or)program in java applets you need to use showDocument().Where you cannot use exec() in java applets.
    My problem is that when i use showDocument() to display .exe file.It is showing a file download dialog box.If we click & open only it is opening that .exe file.Here i want to open the .exe file without showing that file download dialog box in java applets.
    Since,i am undergoing a project which involves it,it is quite urgent.pls.do provide the exact code in java applet without showing that file download dialog box.If it can't be done pls. do provide any other possibilities in order to be displayed on the browser.Thank U.
    Regards,
    m.ananthu

    Hi!
    I think you it's better to write a server socket program
    in server and open a socket connection to server socket then
    send exe file content via connection.
    (I guess you know applets only have permission to open socket connection to their code base)
    Bye!

  • Adding an image in a java applet

    Hey everyone... I am using Jbuilder and trying to add an image or background image in my applet. The image is in the folder the java file runs out of. I would really appreciate it if anyone could help me..

    I use this to add an image that I have saved in the applet folder
    Image image;
    public void init() {
    image = getImage(getDocumentBase(), "auburn.jpg");
    and I get this error when I try to run it in Jbuilder:
    java.lang.NullPointerException
         at java.applet.Applet.getDocumentBase(Applet.java:125)
         at JavaProject.<init>(JavaProject.java:103)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at java.lang.Class.newInstance0(Class.java:308)
         at java.lang.Class.newInstance(Class.java:261)
         at sun.applet.AppletPanel.createApplet(AppletPanel.java:617)
         at sun.applet.AppletPanel.runLoader(AppletPanel.java:546)
         at sun.applet.AppletPanel.run(AppletPanel.java:298)
         at java.lang.Thread.run(Thread.java:534)
    What could be the problem?

  • Wrong image refresh in java applet AND Windows 7

    I'm managing since few days a java applet that takes an image from an industrial product and shows it in a browser (simple web server).
    There is following issue: the image is not correctly loaded and refreshed in its own window if just opened but only if the applet is running on Windows 7. The issue is solved as soon as I reduce the window to icon (minimize) and then resize it. I'm looking into java documentation on how to manage the image rendering, maybe I have to override some update or redraw method more, but it is taking time and I'm still learning. NOTE that the window opened does show the issue only when the windows size is not completely shown in the monitor.
    Meanwhile I'm wandering if some of you faced and solved similar problem.
    Thank you in advance,
    Elena

    Thank you Nitin for your quick reply!
    These are the calling of the functions in the code. As you can see, before to show the image, we are managing a zoom/unzoom by mouse wheel and an addition of writings data on the image itself. All is working fine except on W7:
    public void paint(Graphics g)
         //System.out.println("[ImageFrame::paint my paint!!!]");
         this.PaintImage(g);
    public void update(Graphics g)
         // System.out.println("[ImageFrame::update]");
         this.repaint();
    public void PaintImage(ImageInfo imageInfo, float fps)
         if (imageInfo != null)
              if (this.getImageInfoRef() == null){
                   this.setVisible(true);
              this.setTitle("Image Viewer (" + imageInfo.bufferedImage.getWidth() + "x" + imageInfo.bufferedImage.getHeight() + ") ");
              this.resizeImageFrame((int) (imageInfo.bufferedImage.getWidth() * zoomFactor), (int) (imageInfo.bufferedImage.getHeight() * zoomFactor));
              this.lastFps = fps;
              this.setImageInfoRef(imageInfo);
              //System.out.println("this.getWidth(): " + this.getWidth() + " this.getHeight(): " + this.getHeight() + " zoomFactor: " + zoomFactor);////
              this.PaintImage(this.getGraphics());
    public synchronized void PaintImage(Graphics g)
         ImageInfo locImageInfo = getImageInfoRef();
         if (locImageInfo != null)
              try
                   this.resizeImageFrame((int) (locImageInfo.bufferedImage.getWidth() * zoomFactor), (int) (locImageInfo.bufferedImage.getHeight() * zoomFactor));
                   BufferedImage bufferedImage = this.resizeBufferedImage(locImageInfo.bufferedImage, zoomFactor);
                   this.overlayCodeInfo(bufferedImage, locImageInfo.decInfoStruct, zoomFactor);
                   this.overlayPointerInfo(bufferedImage, locImageInfo.scaling, zoomFactor, this.crossX, this.crossY);
                   this.overlayFrameRateInfo(bufferedImage, this.lastFps);
                   Image img = Toolkit.getDefaultToolkit().createImage(bufferedImage.getSource());
                   boolean retdraw;
                   retdraw = g.drawImage(img, frameUpperBondarySizeX, frameUpperBondarySizeY, this);
              catch (Exception ex)
                   System.out.println("[ImageFrame::PaintImage] Exception: " + ex);
    Thank you again
    Elena

  • Problem facing when uploadin file thru java applet using WSA

    I am facing a issue, when I am trying to upload a pdf file on a website which uses java applet and WSA as proxy. On the java applet window when I select the file a click upload, it gives " Upload failed : java.net.Unknownhostexception ".
    On checking the issue in java console getting following error "SEVERE: java.net.UnknownHostException: www.mca.gov.in
    java.net.UnknownHostException: www.mca.gov.in
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:86)
    at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:652)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:628)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
    at javazoom.transfer.client.http.HTTPTransfer.headInfo(Unknown Source)
    at javazoom.transfer.client.http.HTTPUploadTransfer.dbupdate(HTTPUploadTransfer.java:973)
    at javazoom.transfer.client.http.HTTPUploadTransfer.run(HTTPUploadTransfer.java:155)
    at java.lang.Thread.run(Unknown Source)
    network: Connecting http://www.mca.gov.in:80/ with proxy=DIRECT
    29-Oct-2009 15:03:58 javazoom.transfer.client.http.HTTPTransfer headInfo
    SEVERE: java.net.UnknownHostException: www.mca.gov.in
    29-Oct-2009 15:03:58 javazoom.transfer.client.http.HTTPUploadTransfer run
    INFO: Upload failed"

    Done, what next ?
    Noah

Maybe you are looking for