I'm displaying the date in a program currently like this:
This code works but gives me the date all at once. I know I don't have to do DateFormat.FULL but I want all that information I just want to be able to retrieve the day of the week, the month, the date and the year all separately. I've been searching through the Java API and I couldn't figure out a simple way (or any way at all) to just get the current day of the week, month, date or year by themselves.
How can I retrieve the current day, month, date, and year separately so that I can display them on different lines instead of either it saying "Wednesday, February 8, 2..." or me making the frame bigger which I don't want to do.
1 2 3 | Date today = new Date(); setText(DateFormat.getDateInstance(DateFormat.FULL).format(today)); setText(DateFormat.getTimeInstance().format(today)); // the main part is what's in the parenthesis ignore the setText which won't do anything |