🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #7810

Re: Applet problem: Empty Combo Box, Drop Down is offset

#7810
From: Reid
Date: Mon, 01 Jan 2001 03:25
112 lines
5433 bytes
--------------070507010303030400040107
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I have since corrected my flawed code in the for loop and the applet now 
loads the strings into the combo box.
My problem still lies in the fact that the drop down list displays in 
the wrong place.  Down and to the right an inch or two.

I have tried recreating the project from scratch only using AWT an no 
SWING.  Same results.

I have no code in the project other than FillAppNames() which you have 
seen that loads the strings.

If I REM out the FillAppNames() call and just manually add the strings 
like :

cbAppNames.AddItem("Item1");
cbAppNames.AddItem("Item2");
cbAppNames.AddItem("Item3");
cbAppNames.AddItem("Item4"); etc...

The result is still the same. The combo box displays to the right and 
over some.

I have posted this in the sun.java forum and have had no response.

Losing faith ...


Reid

Stephen L. De Rudder wrote:

>> (This is my second post on this topic..  I didn't think something this
>> simple would go unanswered)
> 
> 
> I think someone already answered you.  They said you may have a ";" in the
> wrong place...
> 
>> String [] appnames = { "Corel Clipart Locator", "Data Doctor", "Event
>> Organizer", "HTML Developer Database",  "Image Thumbnail Viewer",
>> "iTaxSystem", "Odyssey Warranty Tracker", "SFS Database" };
>> 
>>  private void jbInit() throws Exception {
>>  ...
>>   fillAppNames();
>>  }
>> 
>> 
>> public void fillAppNames() {
>>  int index;
>>  for (index = 0; index<appnames.length; index++);  // LOOK HERE
>>   {
>>    cbAppNames.addItem(appnames[index]);
>> 
>>   }
>> 
>>  }
> 
> 
> The ";" next to look here causes the for loop to do nothing except index++.
> The code after the for loop is executed only once with
> index=appnames.length.  I think if you remove the ";" next to LOOK HERE you
> will get the expected results.
> 
> SLDR
> (Stephen L. De Rudder)
> 
> 


--------------070507010303030400040107
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<html><head></head><body>I have since corrected my flawed code in the for loop and the applet now loads the strings into the combo box.<br>
<br>
My problem still lies in the fact that the drop down list displays in the wrong place.&nbsp; Down and to the right an inch or two.<br>
<br>
I have tried recreating the project from scratch only using AWT an no SWING.&nbsp; Same results.<br>
<br>
I have no code in the project other than FillAppNames() which you have seen that loads the strings.<br>
<br>
If I REM out the FillAppNames() call and just manually add the strings like :<br>
<br>
cbAppNames.AddItem("Item1");<br>
cbAppNames.AddItem("Item2");<br>
cbAppNames.AddItem("Item3");<br>
cbAppNames.AddItem("Item4"); etc...<br>
<br>
The result is still the same. The combo box displays to the right and over some.<br>
<br>
I have posted this in the sun.java forum and have had no response.<br>
<br>
Losing faith ...<br>
<br>
<br>
Reid<br>
<br>
Stephen L. De Rudder wrote:<br>
<blockquote type="cite" cite="mid:3a4f61d3$1_2@dnews">
  <blockquote type="cite"><pre wrap="">(This is my second post on this topic..  I didn't think something this<br>simple would go unanswered)<br></pre></blockquote>
    <pre wrap=""><!----><br>I think someone already answered you.  They said you may have a ";" in the<br>wrong place...<br><br></pre>
    <blockquote type="cite"><pre wrap="">String [] appnames = { "Corel Clipart Locator", "Data Doctor", "Event<br>Organizer", "HTML Developer Database",  "Image Thumbnail Viewer",<br>"iTaxSystem", "Odyssey Warranty Tracker", "SFS Database" };<br><br> private void jbInit() throws Exception {<br> ...<br>  fillAppNames();<br> }<br><br><br>public void fillAppNames() {<br> int index;<br> for (index = 0; index&lt;appnames.length; index++);  // LOOK HERE<br>  {<br>   cbAppNames.addItem(appnames[index]);<br><br>  }<br><br> }<br></pre></blockquote>
      <pre wrap=""><!----><br>The ";" next to look here causes the for loop to do nothing except index++.<br>The code after the for loop is executed only once with<br>index=appnames.length.  I think if you remove the ";" next to LOOK HERE you<br>will get the expected results.<br><br>SLDR<br>(Stephen L. De Rudder)<br><br><br></pre>
      </blockquote>
      <br>
</body></html>
--------------070507010303030400040107--
Technical Details
Message-ID: <3A4FF8B1.2060902@buzybee.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!newsfeed.mesh.ad.jp!news.stealth.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!165.121.118.192
References: <3A4B6848.4090404@buzybee.com> <3a4f61d3$1_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,7a74489420eb85
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2000-12-31 19:23:17 PST
Message-ID: <3A4FF8B1.2060902@buzybee.com>
Date: Sun, 31 Dec 2000 19:25:37 -0800
From: Reid <reidr@buzybee.com>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20001108 Netscape6/6.0
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing
Subject: Re: Applet problem:  Empty Combo Box, Drop Down is offset
References: <3A4B6848.4090404@buzybee.com> <3a4f61d3$1_2@dnews>
Content-Type: multipart/alternative;
 boundary="------------070507010303030400040107"
NNTP-Posting-Host: 165.121.118.192
X-Trace: 31 Dec 2000 19:17:15 -0800, 165.121.118.192
Lines: 115
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!newsfeed.mesh.ad.jp!news.stealth.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!165.121.118.192