Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1259

Re: How can JComboBox lis

From phillip.s.powell@gmail.co.remove-dii-this
Subject Re: How can JComboBox lis
Message-ID <1174504576.800515.29460@e65g2000hsc.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
References <etms18$efe$1@news.nems.noaa.gov>
Date 2011-04-27 15:32 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui,comp.l
On Mar 19, 4:29 pm, RC <raymond.c...@nospam.noaa.gov> wrote:
> Since JComboBox and JButton both are
> extends from JComponent.
> When I addMouseListener(this);
> for jButton, it listens to the MouseEvent.
> But jComboBox doesn't listen to the MouseEvent.
>
> public void mouseEntered(MouseEvent me) {
>         System.out.println("mouse entered");
>          jComboBox.setToolTipText("mouse entered"); // not work
>          jButton.setToolTipText("mouse entered button"); // works fine
>
> }
>
> mouseEntered just move your mouse pointer on
> the object, no need to click (pressed and released).
>
> I just want to detect the mouse entered on JComboBox
> (i.e. popup a ToolTip) before I click it for select an item.
>
> Do I miss something? Do I need to setXXX and/or enableXXX
> JComboBox before I addMouseListener?
>
> Thank Q for your help!

I am not thinking that you'd want a MouseListener for the JComboBox,
but instead consider a PopupMenuListener instead, chances are that
will give you the results you want within the JComboBox.

Phil

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

How can JComboBox listene "RC" <rc@THRWHITE.remove-dii-this> - 2011-04-27 15:32 +0000
  Re: How can JComboBox lis "Tom Hawtin" <tom.hawtin@THRWHITE.remove-dii-this> - 2011-04-27 15:32 +0000
  Re: How can JComboBox lis phillip.s.powell@gmail.co.remove-dii-this - 2011-04-27 15:32 +0000

csiph-web