KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a small program that displays the current week from todays date, like this: GregorianCalendar gc = new GregorianCalendar(); int day = 0; gc.add(Calendar.DATE, day); And then a JLabel that displays the week number: JLabel week = new JLabel("Week " + gc.get(Calendar.WEEK_OF_YEAR)); So right now I'd like to have a JTextField where you can enter a date and the JLabel will update with the week number of that date. I'm really not sure how to do this as I'm quite new to Java. Do I need to save the input as a String? An integer? And what format would it have to be (yyyyMMdd etc)? If anyone could help me out I'd appreciate it!
Tags (comma-separated)
Save Edits
Cancel