Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1512

Re: Embedding a Jframe in

From "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Subject Re: Embedding a Jframe in
Message-ID <71174edf22588@uwe> (permalink)
Newsgroups comp.lang.java.gui
References <1177257019.930895.220100@e65g2000hsc.googlegroups.com>
Date 2011-04-27 15:33 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
pramodsa wrote:
..
>I kind of got ur idea to work, ..

It is not so much my idea, as the way to go about converting
a frame to an applet.  (And that word is 'your'.)

>..but theres still seems to be a problem.
>The applet gets loaded now, but im not able to load the images on to
>the applet.
>
>Im trying to use the following statements to load the images:
>                   Image img1 =
>Toolkit.getDefaultToolkit().getImage("bg.gif");
>
>I also tried to use the below two:
>                  Image img1 = getImage(getDocumentBase(),"bg.gif") ;
>                  Image img1 = getImage(getCodeBase(),"bg.gif");
>
>But, im unsuccessful.

Where is the applet?  Can you give us the URL to the web
page it is in?  Where are the images?  What is the codebase 
and document base?  If the applet is not available on the net, 
describe exactly the structure of the directories and the 
paths to the images.*

If the image is found, it might be that you are attempting to
display it before it is loaded.

(I have no crystal ball, here - so I'm just guessing without
the information above)

* What do those statements produce as URL's?
Print them out to the console.  Try along these lines..
  System.out.println( "Image via codebase: " + 
    new URL(getCodeBase() + "blah.gif") );
( Do the same for the others. )
When you get URL's, try pasting them in the browser address 
bar and do a 'direct fetch' and check the ibrowser can load the 
image.

Note also that this is fairly basic stuff (finding resources and 
basic debugging).  For those learning Java, a good group is 
comp.lang.java.help.

-- 
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via http://www.javakb.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Embedding a Jframe in an "pramodsa" <pramodsa@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
  Re: Embedding a Jframe in "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
    Re: Embedding a Jframe in "pramodsa" <pramodsa@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
      Re: Embedding a Jframe in "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
        Re: Embedding a Jframe in "pramodsa" <pramodsa@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
          Re: Embedding a Jframe in "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
      Re: Embedding a Jframe in "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000

csiph-web