Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-07-2007, 02:57 AM
Member
 
Join Date: Jul 2007
Posts: 40
barney is on a distinguished road
Help with dropdown list
Hi, My requirement is that i have a radio button fail.after selecting data I have to select the reason also using the dropdown list. If the reason is not selected an error should be thrown. How to accomplish this in java.can anyone please help.

Thanks.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-07-2007, 08:17 AM
zoe zoe is offline
Member
 
Join Date: Jul 2007
Posts: 40
zoe is on a distinguished road
There are many ways you could do this, some more difficult than others. I will list a couple of ideas, but depending on how your code has been written, they might not fit in.
1) You could set the first value in the combo box to be "none", then you could obtain the value from the combo box and check that the value is not equal to "none" i.e. if(!ComboValue.compareTo("none")) //something like that.
Code:
{ } else { System.out.println.........please select reason....(whatever) }
2)The other way you could do this, would be to have a boolean global variable called "reason"(this is a bad name) set to false. When the check box is then used, inside the combobox handler set "reason" to true, then you can check the status of "reason". But remember to set it back to false again.

With both of these examples i am assuming you have a JButton that you press after the fail radio button is pressed to submit the reason. These are both very simple examples. But they will both work.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
JCombox DropDown is displayed on primary monitor when the box is in between two monit Kalpana.k AWT / Swing 1 05-01-2008 04:19 PM
getting values from database in dropdown aa74 JavaServer Pages (JSP) and JSTL 1 04-21-2008 11:00 PM
Servlet with a Form/Dropdown Java Tip Java Tips 0 01-16-2008 11:24 AM
list Zensai New To Java 3 11-20-2007 08:22 AM
How to get the max value from a list osval New To Java 1 07-30-2007 06:43 PM


All times are GMT +3. The time now is 05:55 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org