トップ 差分 一覧 ping ソース 検索 ヘルプ PDF RSS ログイン

Jython Swing はじめに



目次



記事一覧

キーワード

Jython Swing はじめに

[Jython][Python][Jython Swing][Swing]

ソース
# -*- coding:utf-8 -*-

from javax.swing import JFrame, JButton, JLabel
from java.awt.BorderLayout import NORTH

def react(event):
    message.text = "Thanks for pushing the button"
    
frame = JFrame("My First Swing GUI", size=(300,150))
button = JButton("Push Me", actionPerformed=react)
frame.add(button)
message = JLabel(" ")
frame.add(message, NORTH)
frame.visible = True



YAGI Hiroto (piroto@a-net.email.ne.jp)
twitter http://twitter.com/pppiroto

Copyright© 矢木 浩人 All Rights Reserved.