NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Combobox events

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Jekutin



Joined: 05 May 2012
Posts: 13

PostPosted: Sat May 19, 2012 11:30 am    Post subject: Combobox events Reply with quote

I have been trying to make an accounting program, but got any further from the very beginning. I need a combobox which has a drop down list with 2 columns, and it opens when the user starts to write to the combobox text field. It should also have a incremental search feature. This kind of combobox seems to be almost impossible to find, so I decided to make my own. The problem now is, that I cannot get event from the text field, when the user starts to type. I have tried several different approaches. Last was an idea to use combobox in Netbeans palette and then copy the code. Unfortunately this does not work. None of the *key* actions seem to be fired. Only ActionPerformed works, but that is not the one I can use. I have tested with editable and not editable combo boxes.

My question is now, does these *key* events fire and if yes, how to use them. If not, should they be taken away from the events list.
Back to top
bolsover



Joined: 24 Jun 2010
Posts: 185

PostPosted: Tue May 22, 2012 2:05 pm    Post subject: Reply with quote

JCombobox is a slightly unusual component in that it is a compound component. The combobox fires action events, the subcomponents fire key, mouse and some other events... check out the combobox tutorial...
http://docs.oracle.com/javase/tutorial/uiswing/components/combobox.html
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo