Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can I get some help with this Calendar Applet? When I run the program I get six

ID: 3711658 • Letter: C

Question

Can I get some help with this Calendar Applet? When I run the program I get six errors

I have applied bold to the errors

1. public class Calendar extends Applet

A) Applet in java.applet has been deprecated

B) [serial] serializable class Calendar has no definition of serialVersion UID

2. userMonth = now.getMonth();

userYear = nowgetYear() + 1900;

A) get.month In date has been deprecated

B) get.year in dat has been deprecated

3. public boolean action(Event e, Object o)

A) action(Event,Object) in component has been deprecated

B) Event in java.awt has been deprecated

Here is the code that I have:

Explanation / Answer

There Errors you have said are warnings about API deprication. You are on a higher version of java. May be on java 9.

Anyway I have fixed most of them except this one

1. public class Calendar extends Applet

A) Applet in java.applet has been deprecated

B) [serial] serializable class Calendar has no definition of serialVersion UID

Because Applet is depricated in java 9. And there are other secure ways to do the same. like Java jsp, Swing etc

For Other, warnings I have used Calendar inbuilt class instead of Date class. (Hence I have renamed your class to MyCalendar.java so you don't be confuse)

See these changes

and I have removed action() method, I have done the action like this

Here is complete code

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote