473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

jython applet

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())
Jul 18 '05 #1
2 2239
jennifer haynes wrote:
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())


http://www.catb.org/~esr/faqs/smart-questions.html

Jul 18 '05 #2
"jennifer haynes" <ha********@verizon.net> wrote in message news:<jq*******************@nwrddc02.gnilink.net>. ..
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.
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: gcash | last post by:
I've written an applet using Java3D for rendering, which works fine if you have Java3D installed, of course. What I want to do is try to import the Java3D libraries and bail with an error...
0
by: Ike | last post by:
I have a signed JApplet which has a JTextArea wherein one can put Jython Script. Upon clicking a JButton, the script is executed. The script which executes to code is listed below. If I run the...
4
by: angel | last post by:
A java runtime environment includes jvm and java class (for example classes.zip in sun jre). Of course jython need jvm,but does it need java class. Thanx
1
by: Federico | last post by:
Hi everybody, Someone knows where can I find an applet jython guide? I usually use python for my programming and now I'd like to make applets for web pages but I don't know java ... Thanks
6
by: Mike Wimpe | last post by:
Other than being used to wrap Java classes, what other real use is there for Jython being that Python has many other GUI toolkits available? Also, these toolkits like Tkinter are so much better for...
1
by: scott | last post by:
I installed darwinports and did a "sudo port install jython" ------------------------- scott$ which jython /opt/local/bin/jython ------------------------- Jython works in interactive...
12
by: Mark Fink | last post by:
I wrote a Jython class that inherits from a Java class and (thats the plan) overrides one method. Everything should stay the same. If I run this nothing happens whereas if I run the Java class it...
2
by: donkeyboy | last post by:
All, I've tried the jythonc compiler to try and create an applet to see how it works, but I get a number of Java compile errors that are way above my knowledge. Does anyone know what any of the...
2
by: Matt Bitten | last post by:
Hi, all. I'm in a situation where I need to be writing a bunch of quick-y (hopefully) self-contained programs that anyone can run from a web page. Java applets are the obvious way to do this....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.