• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Assistance with JApplet

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Try 100 things. 2 will work out, but you will never know in advance which 2. This tiny ad might be one:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic