Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / November 2003

Tip: Looking for answers? Try searching our database.

Detect double-click in editable JComboBox?

Thread view: 
John Moore - 28 Nov 2003 16:30 GMT
I have an editable JComboBox. I want it to scroll to the default value
if the user double-clicks in the edit area. So, I tried using
'addMouseListener()' with a MouseAdapter to listen for the click
count. I'm hearing nothing, though. Can a JComboBox not respond to a
mouse listener? What am I doing wrong?

TIA,

John
ak - 28 Nov 2003 16:56 GMT
> I have an editable JComboBox. I want it to scroll to the default value
> if the user double-clicks in the edit area. So, I tried using
> 'addMouseListener()' with a MouseAdapter to listen for the click
> count. I'm hearing nothing, though. Can a JComboBox not respond to a
> mouse listener? What am I doing wrong?

you click not on JComboBox, but in editorComponent (JTextField) of
ComboBoxEditor. see ComboBoxEditor.getEditorComponent();

--

____________

http://reader.imagero.com the best java image reader.
John Moore - 28 Nov 2003 17:30 GMT
>you click not on JComboBox, but in editorComponent (JTextField) of
>ComboBoxEditor. see ComboBoxEditor.getEditorComponent();

You do indeed! How stupid of me to forget that. It now works like a
dream! Thanks!

John


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.