🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: jdbNavComboBox and eventhandling?

#9137
From: Ren� Thomsen
Date: Tue, 16 May 2000 00:00
70 lines
3090 bytes
when trying to use some of the member functions of the jdbnavcombobox
(editorcomponent related?)
an exception occurs.

AppAccelerator(tm) 1.2.010 for Java (JDK 1.2), x86 version.
Copyright (c) 1997-1999 Inprise Corporation. All Rights Reserved.
java.lang.InternalError: Cannot use this method with a non-Mutable data
model.
        at
javax.swing.JComboBox.checkMutableComboBoxModel(JComboBox.java:506)
        at javax.swing.JComboBox.removeAllItems(JComboBox.java:489)
        at untitled4.Applet1.jbInit(Applet1.java:84)
        at untitled4.Applet1.init(Applet1.java:38)
        at sun.applet.AppletPanel.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)

i cant use the textfields functions since it havent got a removeallitems()
function
please help...
is this a bug in the language, what good is a component without decent
eventhandling?


"Ren� Thomsen" <rtNOSPAM@bankinvest.dk> wrote in message
news:8fooi3$3vn4@bornews.borland.com...
> it works!
> that is some nice headprogrammering!
>
> mainframe
>
> "Paul Furbacher [TeamB]" <pnf@home.com> wrote in message
> news:391C19C5.3396C61C@home.com...
> > Forum Borland wrote:
> > >
> > > when using a swing jdbNavcombobox i want to use some events attached
to
> the
> > > this component.
> > > the keylistener events Keypressed,keyTyped, keyReleased Dont fire when
> > > typing in the box.
> > > i have tried making my own eventhandlers (keylistener) and adding it
to
> the
> > > jdbnavcombobox, since components can fire events to several
> eventhandlers
> > > but that dont work either.
> > >
> > > maybe swing overides the event somehow since its used in the
> functionality
> > > of the component or????
> >
> > My guess is that since JComboBox, from which JdbNavComboBox extends (via
> > another class or two), is a compound component, consisting of an editor
> > and a list (did I forget something else?), you have to reach into
> > this compound component and add listeners to the desired component.
> >
> > In this case, it would be the editor.  So, you'd write something like
> > the following (I might be a little off since I don't have a Swing
> > reference in front of me):
> >
> >   // given a JdbComboBox cb
> >
> >   JTextField tf = (JTextField)cb.getEditor().getEditorComponent();
> >   tf.addMouseListener(new java.awt.event.MouseAdapter() {...});
> >   tf.addKeyListener(...);
> >
> >
> > Paul Furbacher (TeamB)
>
>
Technical Details
Message-ID: <8frjep$2jk2@bornews.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8fgtpv$iot2@bornews.borland.com> <391C19C5.3396C61C@home.com> <8fooi3$3vn4@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 111d45,e90c7079d92d94ee
X-Google-Attributes: gid111d45,public
From: "Ren� Thomsen" <rtNOSPAM@bankinvest.dk>
Subject: Re: jdbNavComboBox and eventhandling?
Date: 2000/05/16
Message-ID: <8frjep$2jk2@bornews.borland.com>
X-Deja-AN: 624076240
References: <8fgtpv$iot2@bornews.borland.com> <391C19C5.3396C61C@home.com> <8fooi3$3vn4@bornews.borland.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Newsgroups: borland.public.jbuilder.java.swing