Article View: borland.public.jbuilder.java.swing
Article #8833Re: JComboBox Event Never Raised !
From: James Cook
Date: Mon, 17 Jul 2000 00:00
Date: Mon, 17 Jul 2000 00:00
43 lines
2033 bytes
2033 bytes
JComboBox is a composite object. The down button is a JButton that is embedded in the UI, and to get to it, you have to iterate
through the JComponent children of the combo box. Once you find it, you can add your mouse listener to the JButton.
If this seems daunting, you may want to specify what you are trying to do. There may be an alternative approach.
jim
--
_ _
___ _ __ ___ _ __ | |_ ___ ___ | | __ _____
/ _ \| '_ \ / _ \ '_ \| __/ _ \ / _ \| | \ \/ / __|
| (_) | |_) | __/ | | | || (_) | (_) | | > <\__ \
\___/| .__/ \___|_| |_|\__\___/ \___/|_| /_/\_\___/
|_|
http://www.javabuilders.com/opentools/index.html
Striving to add useful functions to JBuilder.
"Velu Erwan" <erwan@mandrakesoft.com> wrote in message news:8kvp3b$c0r5@bornews.borland.com...
> I'm using JBuilder 2 with a jdk 1.1.6 or 1.1.8 but i've one problem.
> I have a JComboBox and i want to put code on the onclick Event but it
> doesn't work.
> This event is never raised !
>
> Here it comes my source code:
>
> jComboBox1.addMouseListener(new java.awt.event.MouseAdapter() {
> public void mouseClicked(MouseEvent e) {
> jComboBox1_mouseClicked(e);
> }
> this.add(jComboBox1, new XYConstraints(53, 61, 161, 18));
>
>
> void jComboBox1_mouseClicked(MouseEvent e) {
> System.out.println("Combo Clicked");
> }
>
> If some could help me ?
> Thanks a lot.
>
>
>
>
>
Technical Details
Message-ID:
<8kvqvi$c146@bornews.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8kvp3b$c0r5@bornews.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c489b865d78a2501 X-Google-Attributes: gid111d45,public From: "James Cook" <jimcook.remove.for.spam@iname.com> Subject: Re: JComboBox Event Never Raised ! Date: 2000/07/17 Message-ID: <8kvqvi$c146@bornews.borland.com> X-Deja-AN: 647479634 References: <8kvp3b$c0r5@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