• Post Reply Bookmark Topic Watch Topic
  • New Topic

Date Program Error  RSS feed

 
Vanessa Roach
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got an error when trying to write a Gui Date program. My code and error are below and I have no idea how to fix it. I'm sure it's something small that I am overlooking but can't find it. Here is my code:
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

can you please post the exception or the error message which you got while running this code?

Your code seems to be fine to me , may be the exception would help.

Regards
Yogendra
 
Vanessa Roach
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yes... I'm sorry. Here is the error

----jGRASP exec: javac -g F:\Java\Test 3\GuiDate.java

GuiDate.java:47: operator + cannot be applied to java.lang.String
JOptionPane.showMessageDialog(null, "The current date and time is:", + df.format(today)+
^
Note: F:\Java\Test 3\GuiDate.java uses or overrides a deprecated API.
Note: Recompile with -Xlint eprecation for details.
1 error

----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not having tried to compile this,...



commas separate arguments to the method �



that third argument looks a little fishy
 
Vanessa Roach
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for the help. I got the problem fixed.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!