aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes problem in JComboBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "problem in JComboBox" Watch "problem in JComboBox" New topic
Author

problem in JComboBox

Ramaswamy Narayanan
Greenhorn

Joined: Jan 19, 2005
Posts: 24
i have problem with JComboBox in my program.
i am adding items to JComboBox at the time of itemStateChanged of a JRadioButton.
Every time the selected JRadioButton is changed, i am changing the JComboBox items.
i am retrieving the selected JComboBox item at the time of JButton click.
But i got only the null value.
i have also used another JComboBox. The items for this JComboBox is added only at the time of constructig the object. When i selected an item in this JComboBox i get the selected value correctly.
What is the problem with the first JComboBox?
i need the immediate reply.
thank you.
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
In this case, we cannot imagine how your code behaves, without having a look at your code. Could you provide us a portion of your code so that we can figure out what is wrong with the code...

I guess the problem would be in the way you use the method of fetching the values from the JComboBox...


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Ramaswamy Narayanan
Greenhorn

Joined: Jan 19, 2005
Posts: 24
Sorry friends

actually the problem is not in java.
it is in my coding.
i have analyzed the code again and again and i got the solution.
sorry for my inconvenience.

thank you
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem in JComboBox