Solved

JComboBox event in an applet.

Posted on 2004-08-09
7
709 Views
Last Modified: 2012-05-05
Hmmm, I am using JBuilder X and I am trying to create an event for a JComboBox that is in a JTabbedPane in a JApplet.  It doesn't seem to be able to catch the event for the JComboBox.  I can make and catch events for my JListBox.  Is there a special procedure that I must call or can I create a different event?  I was trying to create a caretPositionChanged event, but it doesn't seem to want to work in the applet.  Any suggestions?  Thanks.

0
Comment
Question by:kesea
7 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 11750819
You will need to add an InputMethodListener to your JComboBox. Can you post some code?
0
 
LVL 9

Expert Comment

by:Nick_72
ID: 11750828
In design view for the applet in JBuilder, select the JComboBox. To the right you have a tab with the properties of the combo, and there is also a tab named 'Events'.
Select that tab, and doubleclick in the field named 'actionPerformed' (at the top) and JBuilder will create the neccessary code for you, and place the cursor where the event is caught.

Hope it helps,

/Nick
0
 
LVL 92

Expert Comment

by:objects
ID: 11750890
try adding your listener to the combobox editor.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 37

Accepted Solution

by:
zzynx earned 500 total points
ID: 11751498
>> I am trying to create an event for a JComboBox

yourComboBox.addActionListener( new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
           System.out.println("A new item is chosen in the combo box: " + yourComboBox.getModel().getSelectedItem() );
      }
});
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 11751830
Can you post code?
0
 
LVL 37

Expert Comment

by:zzynx
ID: 11754117
Thanks for accepting :°)
0
 
LVL 92

Expert Comment

by:objects
ID: 11758328
Isn't that what Nick_72 suggested?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mapAB Challlenge 35 124
Error with Java/Cache JDBC Classpath 2 31
Apps blocked by Java 9 63
egit plugin on eclipse 8 37
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now