I have a Java applet that displays the current date and time and automatically updates every second it is mandatory This is a live clock, it's showing date and time in the default format (this looks like this: Mon Oct 27 15:10:13 CDT 2014
), but I want to switch it up a bit I will display something like this: Mon 10/27/2014 15:10:13 CDT
.
I took a look at some past questions here and what I found to update my code, but now this time does not show at all, so I am doing something wrong. Here my original work was done after the modified, non-functional work:
Basic Function:
Public Zero Color (Graphics G) {g.drawString (New Java .Util.Date (.) ToString (), 10, 30); }
Modified, non-functional work:
public zero color (graphics g) {g.drawString (new java.util.Date ("E MM / dd / yyyy k: m: sz "). ToString (), 10, 30); }
new java.util.Date ("EMM / DD / Yyyy K: m: sz ")
This does not compile exactly for me and seems to be the source of your problem:
In the test," main "java Java.util.Date.parse (unknown source) in java.util.Date on .lang.IllegalArgumentException in Javascript exception. & Lt; Init & gt; (Unknown Source) Test.Main (Test.java.s)
Instead, I
SimpleDateFormat sdf = new SimpleDateFormat ("E MM / Dd / yyyy k: m: sz "); G.drawString (sdf.format (new date ()), 10, 30);
Comments
Post a Comment