[nbusers] Re: How to check the values in jCombobox??

  • From: Edson Richter < >
  • To:
  • Subject: [nbusers] Re: How to check the values in jCombobox??
  • Date: Fri, 3 May 2013 14:56:42 -0300
  • Organization: Simkorp Inform├ítica Ltda

Try here: http://docs.oracle.com/javase/tutorial/uiswing/components/combobox.html

Regards,

Edson Richter


Em 03/05/2013 12:38, prabhukrish escreveu:
Hi i'm using 3 jCombobox to get DOB from  the user..this the code how i did 
that

         [Integer birthdate=(Integer)date.getSelectedItem();
         Integer  birthmonth=(Integer) month.getSelectedItem();
         Integer  birthyear=(Integer) year.getSelectedItem();]

I didn't use mode properties for jCombobox...to get the values i used for 
loop as follows..

For date...
       [private void dateActionPerformed(java.awt.event.ActionEvent evt) {
for(int i=1;i<=31;i++)
         {
date.addItem(i);
}
}]

for month
[ private void monthActionPerformed(java.awt.event.ActionEvent evt) {
for(int l=1;l<=12;l++)
         {
             month.addItem(l);
         }
     }  ]

for year

    [private void monthActionPerformed(java.awt.event.ActionEvent evt) {
for(int j=1;j<=12;j++)
         {
             year.addItem(j);
         }
     } ]

so my question is
    1.how set err message if the user didn't select DOB???

     In jCombobox First item name for DATE is (date),MONTH is (month),YEAR is 
(year)

    2.At the run time the jCombobox shows only one item (date) for all 
jcombobox....It shows all item when i click the that first item(date) for all 
jCombobox.how to change that???

Thanks in advance,,,









[nbusers] How to check the values in jCombobox??

prabhukrish 05/03/2013

[nbusers] Re: How to check the values in jCombobox??

Edson Richter 05/03/2013

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close