Jython tutorial

Thread Starter

syed_husain

Joined Aug 24, 2009
61
can anyone give me some resources about how to learn JYTHON apart from its website? as i don't know java i am having quite problem with different java module like, swing, io. btw, i found wxpython quite hard to understand.
 

Thread Starter

syed_husain

Joined Aug 24, 2009
61
Hello,

Would this tutorial from IBM help?
http://www.ibm.com/developerworks/java/tutorials/j-jython1/

Bertus
thanks for the link. but still it did not serve my purpose. i think i was not clear enough in my first post. look at this simple example.

Rich (BB code):
from javax.swing import *
from java.awt import *


#show two message by clicking two buttons
frame = JFrame("Title",size=(300,120))
button1 = JButton("Click")
frame.add(button1)
button1.setSize(10,10)
button1.setLocation(10,10)

button2 = JButton("Click2")
frame.add(button2)
button2.setSize(10,10)
button2.setLocation(20,20)

frame.visible = True
what i want is to create 2 buttons and when clicked they will show two different messages. but i could not even able to create two buttons nor i can resize or set the locations of these buttons. what i need is a tutorial that will help me how to use JButton, JFrame etc. by using Jython. i have fair knowledge of python and most of the jython tutorials i found they are actually talking about python syntax. i went oracle site to find out more about JButton and JFrame and from there i found out about the setSize and setLocation method but it did not work when i used it in my jython code.

any help will be much appreciated. thanks in advance.
 
Top