jython applet

J

jennifer haynes

I can't Date() to print out in an applet
this is what I have

from java.util import Date
from java import awt, applet
from java.lang import String

class Enhanced(applet.Applet):
def paint(self, g):
today = Date()
g.drawString(today, 10, 30)



if __name__ == '__main__':
import pawt
pawt.test(Enhanced())
 
P

Paul Clinch

jennifer haynes said:
I can't Date() to print out in an applet
this is what I have

from java.util import Date
from java import awt, applet
from java.lang import String

class Enhanced(applet.Applet):
def paint(self, g):
today = Date()
g.drawString(today, 10, 30)

Indentation is import in python, it replaces block delimeters;

class Enhanced(applet.Applet):
def paint(self, g):
today = Date()
g.drawString(today, 10, 30)
if __name__ == '__main__':
import pawt
pawt.test(Enhanced())

I helps if you report any error message as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top