426
Comment:
|
895
|
Deletions are marked like this. | Additions are marked like this. |
Line 7: | Line 7: |
Examples related to Swing using Jython will be here. | DocumentationAndEducation |
Line 9: | Line 9: |
[[TableOfContents]] ---- Using Java Swing with Jython is a lot of fun and makes it really easy to develop a nice UI in much less code then a similar Java app. All of the examples below work with Jython 2.2 and require a 1.5 (or greater) JVM. |
|
Line 12: | Line 17: |
from javax.swing import JFrame frm = JFrame('Hello, World!', defaultCloseOperation=JFrame.EXIT_ON_CLOSE, size=(300, 300), locationRelativeTo=None) frm.show() |
These are some ways of creating a simple frame with the title 'Hello, World!' on it. {{{from javax.swing import JFrame JFrame('Hello, World!', defaultCloseOperation=JFrame.EXIT_ON_CLOSE, size=(300, 300), locationRelativeTo=None).show()}}} {{{from javax.swing import JFrame f = JFrame('Hello, World!', defaultCloseOperation=JFrame.EXIT_ON_CLOSE, size=(300, 300), locationRelativeTo=None) f.show()}}} |
Swing Examples in Jython
Using Java Swing with Jython is a lot of fun and makes it really easy to develop a nice UI in much less code then a similar Java app. All of the examples below work with Jython 2.2 and require a 1.5 (or greater) JVM.
Hello, World!
These are some ways of creating a simple frame with the title 'Hello, World!' on it.
{{{from javax.swing import JFrame JFrame('Hello, World!', defaultCloseOperation=JFrame.EXIT_ON_CLOSE, size=(300, 300), locationRelativeTo=None).show()}}}
{{{from javax.swing import JFrame f = JFrame('Hello, World!', defaultCloseOperation=JFrame.EXIT_ON_CLOSE, size=(300, 300), locationRelativeTo=None) f.show()}}}
List of pages in this category:
- Something simple
- Something else simple