Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Andrew Thompson" Subject: Re: Embedding a Jframe in Message-ID: <71174edf22588@uwe> X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui In-Reply-To: <1177257019.930895.220100@e65g2000hsc.googlegroups.com> References: <1177257019.930895.220100@e65g2000hsc.googlegroups.com> Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 57 Date: Wed, 27 Apr 2011 15:33:45 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303918425 96.60.20.240 (Wed, 27 Apr 2011 10:33:45 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:33:45 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:1512 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