Article View: borland.public.jbuilder.java.swing
Article #1084Two last problems
From: Ted Byers
Date: Tue, 23 Mar 2004 20:18
Date: Tue, 23 Mar 2004 20:18
33 lines
2098 bytes
2098 bytes
I have this test program working, almost.
The image I load is visible both at design time and, when the applet is run
in the applet viewer, at run time.
But there are two problems.
1) The image still does not appear, and is replaced by a small red 'X', when
the html file is opened in a browser (MS' IE).
2) When running in the applet viewer, the viewer ignores the size
information I give for the applet window, and as a result, only the top left
corner of the image is visible, even after I resize the window. After I
resize the window to a size well able to accomodate the image I'm using, I
just get grey empty space around the image of the corner of the real image
rather than the real image centred in the window.
So, it is working in that some or all of my image is visible when I run the
applet from the applet viewer. It isn't quite working in that the applet
viewer gets the window size wrong and an internet browser doesn't display
the image.
The line JBuilder9 adds when I select an image to use is:
jLabel1.setIcon(new
ImageIcon(HotSpotImageTest.class.getResource("sunset.jpg")));
Is this correct for an applet?
Will this work in a browser once I figure out how to make a jar file?
Thanks,
Ted
Technical Details
Message-ID:
<40609ab3$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,52654c77b754f7e3,start X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2004-03-23 12:40:20 PST From: "Ted Byers" <r.ted.byers@sympatico.ca> Newsgroups: borland.public.jbuilder.java.swing Subject: Two last problems Date: Tue, 23 Mar 2004 15:18:43 -0500 Lines: 35 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 65.95.240.180 Message-ID: <40609ab3$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1080072883 65.95.240.180 (23 Mar 2004 12:14:43 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail