🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: What is wrong with this code: Combo box displays incorrectly?

#7812
From: Reid
Date: Mon, 01 Jan 2001 05:40
178 lines
6786 bytes
I just D/L'd the new Java-Plugin v1.3.0.1 (j2re-1_3_0_01-win.exe)
The new version of the plug-in enhances debugging greatly.  It provides 
a visual error dialog with the error description.  It also allows 
greater interaction with the debugging console.

As a result of this fruitful upgrade when the applet I am having 
problems with is launched outside the JBuilder IDE in an external 
browser, it now displays an error dialog with the following error:

The dialog is entitled : "Java Plugin Exception Dialog"
with an error message of ....

"java.lang.NoClassDefFoundError: com/borland/jbcl/layout/VerticalFlowLayout"

I did try changing the layout type for every component in the project to 
NULL.  When I load the applet in Netscape's browser externally it does 
not display the error.  The combobox's drop down also displays in the 
correct position!!!

Being new to Java I do not know how to resolve this.

I am using the JBuilder Enterprise version.  Can someone please offer me 
some insight?

Any help would be greatly appreciated.


Thanks
Reid Roman


Rich Wilkman wrote:

> Reid:
> 
> Beginners should not start with Applets...  What components, what
> browser (which version of the browser), etc.
> 
> -Rich
> 
> Reid wrote:
> 
>> Well I tried creating the applet using just AWT components and the
>> result was the same.
>> 
>> Being new to Java something so simple as dropping down a combobox's
>> items should go without a hitch.
>> 
>> It is making a beginner in this language move ahead with little faith..
>> 
>> If these types of things happen with something that should be so basic
>> (and nobody can answer the issue) I hate to see what happens when the
>> code gets complicated... ;)
>> 
>> Reid
>> 
>> Reid wrote:
>> 
>>> Thanks Rich for the response.
>>> 
>>> Hmmm...
>>> 
>>> I have not done much work on this applet yet so I will try to recreate
>>> it without the mix.
>>> 
>>> I will post my results to the thread A.S.A.P.
>>> 
>>> Thanks again for responding..
>>> 
>>> There is not much interaction in these forums ...
>>> 
>>> 
>>> Reid
>>> 
>>> Rich Wilkman wrote:
>>> 
>>>> Reid:
>>>> 
>>>> The offset is probably caused by using heavyweight and lightweight
>>>> components together.  You don't post the containers (i.e., Applet of
>>>> JApplet, JComboBox, etc.).  There's a really good article on this at the
>>>> Sun site.  Used to be referenced in the hints_and_tips docs with
>>>> JBuilder back when Swing was new and folks porting over to it kept
>>>> running into problems.
>>>> 
>>>> -Rich
>>>> 
>>>> Reid wrote:
>>>> 
>>>>> Hello James,
>>>>> 
>>>>> Thank you for responding to my post.
>>>>> 
>>>>> You have solved half of the problem!
>>>>> 
>>>>> The trailing semi colon was the reason the combo box was not being
>>>>> filled with it's values.
>>>>> 
>>>>> I still have a problem in that when the drop down list containing the
>>>>> combo box's items are displayed, the list does not display in the
>>>>> correct position.  The list displays in an offsetted way to the right
>>>>> and down approx 100-200 pixels.  This is not the effect I am looking
>>>>> for.  I of course want the list to drop down underneath the control and
>>>>> remain the same size in width.
>>>>> 
>>>>> If the applet is launched as a viewer (via F9) the drop down list
>>>>> remains directly under the control but extends out to the left and
>>>>> right
>>>>> of the applet's canvas and as a result it's width gets truncated.
>>>>> 
>>>>> I am coming primarily from a Delphi background and have never seen this
>>>>> type of behavior. (unless of course you are using the TCombobox as an
>>>>> OwnerDraw type and are drawing the control's canvas incorrectly)
>>>>> 
>>>>> Do you think it is related to the format of the underlying layout
>>>>> manager?
>>>>> 
>>>>> Any more help would be greatly appreciated!
>>>>> 
>>>>> Thanks
>>>>> 
>>>>> Reid
>>>>> 
>>>>> James A. Schulz wrote:
>>>>> 
>>>>>> Just a guess, but do you really want the semicolon after "...index++)"
>>>>>> 
>>>>>> James
>>>>>> 
>>>>>> "Reid" <reidr@buzybee.com> wrote in message
>>>>>> news:3A4BAE85.6010902@buzybee.com...
>>>>>> 
>>>>>>> Hello,
>>>>>>> 
>>>>>>> I am new to applets and am having a bit of a problem.
>>>>>>> 
>>>>>>> I have the following code to populate a combo box box with strings..
>>>>>>> 
>>>>>>> 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++);
>>>>>>>   {
>>>>>>>    cbAppNames.addItem(appnames[index]);
>>>>>>> 
>>>>>>>   }
>>>>>>> 
>>>>>>>  }
>>>>>>> 
>>>>>>> The code above compiles but when run it appears to fill the combo box
>>>>>>> with empty strings.
>>>>>>> 
>>>>>>> When the box drops down it appears to have some volume but not the
>>>>>>> array
>>>>>>> contents.  It also shows the drop down an inch or two down and to the
>>>>>>> right of the actual combo box control?
>>>>>>> 
>>>>>>> Can someone tell me what I am doing wrong?
>>>>>>> 
>>>>>>> 
>>>>>>> Any help would be greatly appreciated!
>>>>>>> 
>>>>>>> Thanks
>>>>>>> 
>>>>>>> 
>>>>>>> Reid Roman
>>>>>>> BuzyBee Software
>>>>>>> http://www.buzybee.com
>>>>>>> 
Technical Details
Message-ID: <3A50184D.1070902@buzybee.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!165.121.120.81
References: <3A4BAE85.6010902@buzybee.com> <92i49k$qai3@bornews.inprise.com> <3A4CCC64.8050402@buzybee.com> <3A4E6174.39CAF201@formlessvoid.com> <3A4E72EF.9070703@buzybee.com> <3A4EACB3.9080406@buzybee.com> <3A5015E6.F611EC11@formlessvoid.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,67e3718c633b6313
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2000-12-31 21:34:28 PST
Message-ID: <3A50184D.1070902@buzybee.com>
Date: Sun, 31 Dec 2000 21:40:29 -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: What is wrong with this code:  Combo box displays incorrectly?
References: <3A4BAE85.6010902@buzybee.com> <92i49k$qai3@bornews.inprise.com> <3A4CCC64.8050402@buzybee.com> <3A4E6174.39CAF201@formlessvoid.com> <3A4E72EF.9070703@buzybee.com> <3A4EACB3.9080406@buzybee.com> <3A5015E6.F611EC11@formlessvoid.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 165.121.120.81
X-Trace: 31 Dec 2000 21:31:51 -0800, 165.121.120.81
Lines: 181
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!165.121.120.81