473,324 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

combo box event handlers

Jon
I'm trying to write code which accepts a choice from a combo box, but no
action is done until a button is pressed. The code that I have tried is
below, it executes, but no action happens when I press the button.

String choice = (String)((JComboBox)source).getSelectedItem();
if(choice=="Name of item")
{
//execute code
}

I have a feeling that it is because I am using
source twice, but again, I am not aware of any methods that I can use.
Thanks.

Jul 17 '05 #1
0 2724

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Scott | last post by:
I'm using C# to build an application. 1) I have two windows forms, A and B. 2) A uses a DataSet read from SQL server. 3) The user presses a button on A to open B. 4) B is passed a pointer to...
10
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script...
8
by: Dennis C. Drumm | last post by:
I have a class derived from a SortedList called SystemList that contains a list of objects indexed with a string value. The definition of the objects contained in the SortedList have a boolean...
4
by: orekinbck | last post by:
Hi There I have a combo box with DropDownStyle = DropDownList The user wants a different string to appear in the display rectangle than from the strings in the list. So for example, the...
3
by: Uri Dimant | last post by:
Hello,friends How do I make combobox within Data Grid? Does anyone have an examples?
13
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the...
16
by: Hamed | last post by:
Hello I am developing a utility to be reused in other programs. It I have an object of type Control (a TextBox, ComboBox, etc.) that other programmers use it in applications. they may set some...
14
by: Hamed | last post by:
Hello It seems that I should implement ICloneable to implement my own clone object. the critical point for me is to make a control object based on another control object that all of its event...
2
by: Ausclad | last post by:
Hi, I have a combo box that I want to populate, based on the selection of another combo box. So when combo box A is selected, combo box B is populated with related values. I have this all...
2
by: Adam Benson | last post by:
Hi, If you're not on the UI thread - responding to a network event, say - and you want to read the SelectedIndex of a combo box, do you have to do an Invoke? Or is it just a simple data read...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.