combo program

combo program

I want to give DOB in combo box for that i have to give 1 to 30 for days and 1900 to 2010. Without giving all, using for loop i have to get the values. Please help me..
View Answers

February 2, 2010 at 11:59 AM

Hi Friend,

Please visit the following link:

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class GetDOB{

public static void main(String args[]){
GetDOB get=new GetDOB();
}
public GetDOB(){
JFrame f = new JFrame();
f.getContentPane().setLayout(null);
JComboBox day=new JComboBox();
JComboBox month=new JComboBox();
JComboBox year=new JComboBox();
for(int i=1;i<=31;i++){
day.addItem(i);
}
day.setBounds(10,10,10,10);
for(int j=1;j<=12;j++){
month.addItem(j);
}
for(int k=1900;k<=2010;k++){
year.addItem(k);
}
day.setBounds(50,50,40,20);
month.setBounds(100,50,40,20);
year.setBounds(150,50,60,20);
f.add(day);
f.add(month);
f.add(year);

f.setVisible(true);
f.setSize(300,200);
}
}

Thanks









Related Tutorials/Questions & Answers:
combo program - Java Beginners
combo program  I want to give DOB in combo box for that i have to give 1 to 30 for days and 1900 to 2010. Without giving all, using for loop i have to get the values. Please help me..   Hi Friend, Please visit
ModuleNotFoundError: No module named 'combo'
ModuleNotFoundError: No module named 'combo'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'combo' How to remove the ModuleNotFoundError: No module named 'combo'
Advertisements
ModuleNotFoundError: No module named 'combo'
ModuleNotFoundError: No module named 'combo'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'combo' How to remove the ModuleNotFoundError: No module named 'combo'
assigning arraylist to combo box
assigning arraylist to combo box  Hi I am busy coding the Airline Reservation program, i have an arraylist of locations which i want to assing to the combo box. please help
ModuleNotFoundError: No module named 'distribution-combo'
ModuleNotFoundError: No module named 'distribution-combo'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'distribution-combo' How to remove the ModuleNotFoundError: No module
combo box
combo box  Hi, [_|] dropdown box [ ] [INCLUDE] [ ] | | [INCLUDE All
combo boxes
combo boxes  how do you store numbers in the choices. ex. soda is $.75 and tax is $.07 then it equals a new total. I've been trying to use the Itemlistener but i can't figure out how to store the numbers import javax.swing.
combo box - JSP-Servlet
combo box  how to get a combo box in jsp page which allows editing as well as list box
populate Combo Box dynamically
populate Combo Box dynamically  Hi, How to populate the Combo Box dynamically using Flex with Jsp's
date in combo box
date in combo box  strong texthello, how can i desplay the current year and next year in combo box???!!! it must be uppdate atumaticaly every year>>>
program
program  any program of hotel or school management
program
program  program of jdbc using ms access for creating table
program
program  write a html program in show table and this word in box
program
program  write a program different between to dates in terms of days in java
program
program  write a javascript program to create a application form with validation
java combo box
java combo box  how to display messagedialogbox when the combobox is null, Thanks in advance
program
program  WAP a java program to form 1/2+3/4+5/6+7/8 series
program
program   Write a program to find the difference between sum of the squares and the square of the sums of n numbers
program
program  write a program reversee a string. input-hi this is roseindia output-roseindia is this hi
program
program  develop a servlet to insert the data in the database from our program in the table stored in the database
program
program   An old-style movie theater has a simple profit program. Each customer pays $5 per ticket. Every performance costs the theater $20, plus $.50 per attendee. Develop the program calculateTotalProfit that consumes
program
program  write a java program to input a no. and print wheather the no. is a special no or not. (special no. are those no whose factorial of the sum of digit of the no is same as the original
program
program  Develop the program calculateCylinderArea, which accepts radius of the cylinder's base disk and its height and computes surface area of the cylinder
program
program  explanation of program on extending thread class   Hi Friend, Please go through the following link:ADS_TO_REPLACE_1 Java Threads Thanks
program
program  Develop a program that computes the distance a boat travels across a river, given the width of the river, the boat's speed perpendicular to the river, and the river's speed. Speed is distance/time, and the Pythagorean
program
program  how to improve programming skills plss tell some tips..i am understanding concepts but unable to write program so,pls give some guideness plsss
Program
Program  a program to prove that default constructor of super class is available to subclass by default. Define a parameterize constructor for super class to store name = â??Tommyâ?? age=â??23â?? and call this constructor
Program
Program  a program to create two classes Commercial and Domestic. Override the method calculatebill() of Commercial class(Rs.8 per unit) into Domestic class(Rs 6 per unit) to compute electricity bill for both classes
program
program  no i want a program that shows how merge sort algorithm works in graphical representations like numbers are taken in circles and computation... in rectangles or circles wat ever it may be. the theme of program is to show algorithm
program
program  . Develop a program that accepts an initial amount of money (called the principal), a simple annual interest rate, and a number of months will compute the balance at the end of that time. Assume that no additional
program
program  Write a JSP Program, which displays a web page containing the name of the Courses, Courses being offered currently, number of students enrolled in each course, new courses to be offered, eligibility criteria for taking
program
program  i want a progra in java to print a sentence in alphabetic order, taking the input from the user.the program should writen without using the array for example : if input= this is a cat then output sould = a cat
program
program  Utopias tax accountants always use programs that compute income taxes even though the tax rate is a solid, never-changing 15%. Define the program calculateTax which determines the tax on the gross pay. Define
program
program  Write a JSP Program, which displays a web page containing two web links one for your profiling and other for the schedule of theory of practical classes of your Batch. When one click on link for getting your profile
program
program  Write a program to print details of a week for a particular day using array of objects Integer and String. OUTPUT: First Day of Week is Monday Second Day of Week is Tuesday Third Day of Week is Wednesday Forth Day
Dojo Combo Box
Dojo Combo Box          In this section, you will learn what is combo box and how to create a combo box in dojo. For creating the Combo box  you need "
Disable of Combo - JSP-Servlet
am giving grading facility to the user. Once user selected his grade in combo , the combo should be disabled auotmatically. It should not get enabled at any... combo once grade selected.... pleas help me regarding this aspect.... Thanks
Combo Box - Struts
Combo Box  I hava acombo box cnnected to my database via html collections. When selecting an option, i want to display specific parts (sectons) on my web page....am trying to use logic:present and logic:empty but its not working
combo box connection
combo box connection  how to provide connection between three combo boxes,if my 1st combo box is course and 2nd combo box is semester and 3rd combo... combo boxes.   Here is Java swing code: import java.sql.*; import
Problem With Combo Box Editable Property
Problem With Combo Box Editable Property  Hi I am new To Flex i had set Combo Box Editable Property as true. But I didn't get the property filtering in the combo box like when you enter text "S" in the combo box then the names
combo box - JSP-Servlet
combo box  I am using a JSP form in which a combobox is given and I want to populate data in it from database and on the basis of yhe selected item I want to display related data in a textbox  Hi Friend, Create
Loading combo box from oracle
Loading combo box from oracle  how can i load values into a combobox from oracle database when a value is selected in another combo box
populating the combo box - Struts
populating the combo box  Hi I am having problem populating the combo box with a table in MS SQL Server 2005 Management Studio Express. Belo is the extract from the Struct?jsp application. Sector
Helps with combo box and frame
Helps with combo box and frame  Hi i have a combobox and when i click... on the second window and click confirm i would have the information on the combo box. i... combo; JTextField txtBox; private String PersonViewing; private String
Combo Box operation in Java Swing
, remove items from the combo box. This program shows a text field, a combo box... JComboBox(items); The above code has been used to create a combo box in this program... Combo Box operation in Java Swing   
combo box value
combo box value   i want to populate one combo box value based on another combo box value using ajax   1)country.jsp: <%@page import="java.sql.*"%> <html> <head>
combo box value
combo box value   i want to populate one combo box value based on another combo box value using ajax   1)country.jsp: <%@page import="java.sql.*"%> <html> <head> <script language
jtable combo - Java Beginners
jtable combo  i am using jtable (using defaulttablemodel) ,when i am click on a particular cell of jtable i want to display the combo box in that cell,plz provide program  Hi Friend, Try the following code: import
combo box code problem
combo box code problem  in this my problem related to : when i select state MP then i wil open the its corresponding city but in database it only stores the option value no like MP at option value 10 then it will stores the 10
JavaScript Dynamic Combo Box
JavaScript Dynamic Combo Box Here we are going to create dynamic combo box. For this, we have created two combo boxes where combo1 represents countries and combo2 represents the cities. The values of the combo boxes are stored

Ads