I am try to populate a JComboBox with the days of a particular month and year. I researched the problem and came up with this: public void actionPerformed(ActionEvent e) { //code to respond to the buttons goes here if ( e.getSource() == cmbMonth || e.getSource() == cmbYear ) { cmbDay.removeAllItems(); int year = Integer.parseInt(cmbYear.getSelectedItem().toString()); int month = cmbMonth.getSelectedIndex() + 1; Calendar currMonYear = Calendar.getInstance(); currMonYear.set(Calendar.YEAR, year); currMonYear.set(Calendar.MONTH, month); int daysInMon = currMonYear.getActualMaximum(Calendar.DAY_OF_MONTH); for ( int i = 1; i <= daysInMon; ++i ) cmbDay.addItem(i); int x = 0; } }//end actionPerformed() Though I am getting incorrect values. Any suggestions?

Member Avatar
Member Avatar
+0 forum 3

need simple code vb.net code tht uses issue date and return date to calculate fine but doesnt use datetimepicker tool..

Member Avatar
Member Avatar
+0 forum 2

Hello Community, I was wondering if it is possible to run a php file every week that checks if a user has activated there account after 7 days they will be deleted. Please help. Thanks in advance.

Member Avatar
Member Avatar
+0 forum 4

I'm completely lost with this assignment code. The objective is to modify this program that originally asked the user for an input 1-12 for a month, and it outputs the number of days in that month. The modifications would make it so that the user inputs the name of the month instead of the value, and the program outputs the number of days. I also have to incorporate lines that asks the user to reenter the month if it is not a valid month, and to reenter the year if if the year is < 0 (negative). I think the …

Member Avatar
Member Avatar
+0 forum 4

Hello Every One ! I m working on a software , i have one field name expiry_Date , now i want to make an query which subtract the current date from the expiry_date and give answer in no.of days , i use getdate() for current date , can any one help me:( Regards M.Waqas Aslam

Member Avatar
Member Avatar
+0 forum 2

I wrote the following method to get the current date for an invoice: [CODE] public String getDate() { DateFormat dateFormat = new SimpleDateFormat("MMMMMMMMM d, yyyy"); Date orderDate = new Date(); return dateFormat.format(orderDate); }[/CODE] but now I have to add two weeks (14 days) to that date (to get the expected delivery date). I've come across ways to do the same thing with a date acquired using Calendar. I tried changing my method to use Calendar instead but had issues. Is there a way to add 14 days to this date without re-doing my method? If not how would I write …

Member Avatar
Member Avatar
+0 forum 9

I'm new to C/C++ and I'm having difficulty with calculating leap years in my Zeller's Algorithm program (based off of the Gregorian Calendar). I've lost sleep over this code for the last week and this is my final breaking point. I continually get "This day is Friday." for input 1 16 2012 ... which should be Monday instead.. etc, etc. If anyone could help or give me hints, that would be excellent. Here is my code so far: [ICODE] #include<iostream> using namespace std; void DisplayTitle(); // displays the title void GetDate(int&, int&, int&); // collects the user's input and/or terminates …

Member Avatar
Member Avatar
+0 forum 1

The End.