• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Assistance with JApplet

 
Sarah Heffron
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a calendar applet, that is going to be very specialized for scheduling, but I've never written an applet before and I'm having some trouble. I'm learning Java in school, but for some reason the curriculum doesn't include any gui stuff.
The problem I'm having right now is that I have the month and year at the top and buttons to scroll ahead or back a month. Like < February 2003 >. When the buttons are pressed the values for month and year (if necessary) change properly, but the text "February 2003" stays the same, no matter what. How can I get this text label to change? Here is my code thus far:

Also...eventually this will be a calendar used to schedule daycare for dogs. So I want to lay out all the days in a grid (like a calendar) and click on the days to schedule a dog and change that day's square to green. Then for cancellations I'd like to do the same thing but change the square to red. I haven't gotten this far yet, but I'm not sure what to use to implement the grid of the calendar that would be used to marking days in certain colors and recording them the best way.
Any help for any issues is appreciated. And if you can see a better way to do this other than an applet (this is going to be a web based scheduling thing and rather than doing some DHTML calendar, I decided to try an applet) let me know.

(Marilyn added code tags)
[ February 13, 2003: Message edited by: Marilyn de Queiroz ]
 
Linda Jones
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sarah,
Your JLabel won't dynamically update just because the variables you initially set its value with have changed.
In the actionPerformed() method, after you set the new values of "month" and "year" you need to add something like:


Linda
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic