本文整理汇总了Python中javax.swing.JFrame.show方法的典型用法代码示例。如果您正苦于以下问题:Python JFrame.show方法的具体用法?Python JFrame.show怎么用?Python JFrame.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JFrame
的用法示例。
在下文中一共展示了JFrame.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: desty
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
class myAnimFrame:
"""
Supporting class for animations.
"""
def desty(self, event):
self.display.destroy()
self.frame.dispose()
def __init__(self, display, widget, width, height, title):
from javax.swing import JFrame, JPanel
from java.awt import BorderLayout, FlowLayout
self.display = display
self.panel = JPanel(BorderLayout())
self.panel2 = JPanel(FlowLayout())
self.panel2.add(widget)
self.panel.add("North", self.panel2)
self.panel.add("Center",self.display.getComponent())
self.frame = JFrame(title, windowClosing=self.desty)
self.pane = self.frame.getContentPane()
self.pane.add(self.panel)
self.frame.setSize(width,height)
self.frame.pack()
self.frame.show()
示例2: __init__
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
class _AccountAdder:
def __init__(self, contactslist):
self.contactslist = contactslist
self.mainframe = JFrame("Add New Contact")
self.account = JComboBox(self.contactslist.clientsByName.keys())
self.contactname = JTextField()
self.buildpane()
def buildpane(self):
buttons = JPanel()
buttons.add(JButton("OK", actionPerformed=self.add))
buttons.add(JButton("Cancel", actionPerformed=self.cancel))
acct = JPanel(GridLayout(1, 2), doublebuffered)
acct.add(JLabel("Account"))
acct.add(self.account)
mainpane = self.mainframe.getContentPane()
mainpane.setLayout(BoxLayout(mainpane, BoxLayout.Y_AXIS))
mainpane.add(self.contactname)
mainpane.add(acct)
mainpane.add(buttons)
self.mainframe.pack()
self.mainframe.show()
#action listeners
def add(self, ae):
acct = self.contactslist.clientsByName[self.account.getSelectedItem()]
acct.addContact(self.contactname.getText())
self.mainframe.dispose()
def cancel(self, ae):
self.mainframe.dispose()
示例3: test_swing
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
def test_swing():
frame = JFrame("Hello Jython")
button = JButton("Pulsar", actionPerformed = hello)
frame.add(button)
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
frame.setSize(200, 100)
frame.show()
示例4: ConversationWindow
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
class ConversationWindow(Conversation):
"""A GUI window of a conversation with a specific person"""
def __init__(self, person, chatui):
"""ConversationWindow(basesupport.AbstractPerson:person)"""
Conversation.__init__(self, person, chatui)
self.mainframe = JFrame("Conversation with "+person.name)
self.display = JTextArea(columns=100,
rows=15,
editable=0,
lineWrap=1)
self.typepad = JTextField()
self.buildpane()
self.lentext = 0
def buildpane(self):
buttons = JPanel(doublebuffered)
buttons.add(JButton("Send", actionPerformed=self.send))
buttons.add(JButton("Hide", actionPerformed=self.hidewindow))
mainpane = self.mainframe.getContentPane()
mainpane.setLayout(BoxLayout(mainpane, BoxLayout.Y_AXIS))
mainpane.add(JScrollPane(self.display))
self.typepad.actionPerformed = self.send
mainpane.add(self.typepad)
mainpane.add(buttons)
def show(self):
self.mainframe.pack()
self.mainframe.show()
def hide(self):
self.mainframe.hide()
def sendText(self, text):
self.displayText("\n"+self.person.client.name+": "+text)
Conversation.sendText(self, text)
def showMessage(self, text, metadata=None):
self.displayText("\n"+self.person.name+": "+text)
def contactChangedNick(self, person, newnick):
Conversation.contactChangedNick(self, person, newnick)
self.mainframe.setTitle("Conversation with "+newnick)
#GUI code
def displayText(self, text):
self.lentext = self.lentext + len(text)
self.display.append(text)
self.display.setCaretPosition(self.lentext)
#actionlisteners
def hidewindow(self, ae):
self.hide()
def send(self, ae):
text = self.typepad.getText()
self.typepad.setText("")
if text != "" and text != None:
self.sendText(text)
示例5: run_fn
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
def run_fn(event):
log_window = JFrame('Galahad Log')
log_text_area = JTextArea()
log_text_area.editable = False
log_window.setSize(400, 500)
log_window.add(log_text_area)
log_window.show()
log_text_area.append('sdfsdfsdfsdfsd %d' % 3)
示例6: show_plot_in_frame
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
def show_plot_in_frame(mainPanel):
"""
embeds panel containing plots in a closable frame
clears the panel background to white
"""
fr=JFrame()
fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
fr.getContentPane().add(mainPanel)
fr.setSize(1100,850);
mainPanel.setSize(1100,850);
mainPanel.setBackground(Color.WHITE);
fr.show();
return fr
示例7: main
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
def main():
activeLayers=getActiveLayers()
if len(activeLayers)==0:
JOptionPane.showMessageDialog(None,
"Add and activate at least one vector layer in the view. Retry!",
"Batch Transparency", JOptionPane.WARNING_MESSAGE)
return
else:
numFLyrVect=0
for i in range(len(activeLayers)):
if activeLayers[i].getClass().getCanonicalName()=="com.iver.cit.gvsig.fmap.layers.FLyrVect":
numFLyrVect=numFLyrVect+1
if numFLyrVect==0:
JOptionPane.showMessageDialog(None,
"You have to add and activate at least one vector layer in the view. Retry!",
"Batch Transparency", JOptionPane.WARNING_MESSAGE)
return
else:
global frame, outCheckbox, fillCheckbox, slider
frame = JFrame("Batch Transparency", defaultCloseOperation=JFrame.DISPOSE_ON_CLOSE,
bounds=(100, 100, 450, 80), layout=FlowLayout(), resizable=0)
outCheckbox = JCheckBox("outline", 1)
fillCheckbox = JCheckBox("fill", 1)
# Create a horizontal slider with min=0, max=100, value=50
slider = JSlider()
slider.setPreferredSize(Dimension(200, 50))
slider.setValue(100)
slider.setMajorTickSpacing(25)
slider.setMinorTickSpacing(5)
slider.setPaintTicks(1)
slider.setPaintLabels(1)
applyButton = JButton("Apply", actionPerformed=action)
acceptButton = JButton("Accept", actionPerformed=accept)
frame.add(outCheckbox)
frame.add(fillCheckbox)
frame.add(slider)
frame.add(applyButton)
frame.add(acceptButton)
frame.show()
return
示例8: getGUI
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
def getGUI(sym_dict):
global frame, outCheckbox, fillCheckbox, slider, colorTF, widthTF
frame = JFrame("Border Symbology", defaultCloseOperation=JFrame.DISPOSE_ON_CLOSE,
bounds=(100, 100, 450, 200), layout=FlowLayout(), resizable=0)
colorL = JLabel('Color: ')
colorTF = JTextField(20)
color = sym_dict["color"]
color = Color(color.getRed(), color.getGreen(), color.getBlue(), sym_dict["alpha"])
colorTF.setBackground(color)
colorTF.setText(color.toString())
colorB = JButton('...', actionPerformed=colorChooser)
frame.add(colorL)
frame.add(colorTF)
frame.add(colorB)
widthL = JLabel('Width: ')
widthTF = JTextField(3)
widthTF.setText(str(sym_dict["width"]))
frame.add(widthL)
frame.add(widthTF)
alphaL = JLabel('Transparency: ')
frame.add(alphaL)
# Create a horizontal slider with min=0, max=100, value=50
slider = JSlider()
slider.setPreferredSize(Dimension(200, 50))
slider.setValue(sym_dict["alpha"]*100/255)
slider.setMajorTickSpacing(25)
slider.setMinorTickSpacing(5)
slider.setPaintTicks(1)
slider.setPaintLabels(1)
applyButton = JButton("Apply", actionPerformed=action)
acceptButton = JButton("Accept", actionPerformed=accept)
frame.add(slider)
frame.add(applyButton)
frame.add(acceptButton)
frame.show()
示例9: show_gui
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
def show_gui():
"""
Shows a GUI to select dss files to compare and select an input file
"""
from javax.swing import JPanel, JFrame, JButton, SpringLayout, JTextBox
from javax.swing.border import LineBorder
textBox1 = JTextBox()
textBox2 = JTextBox()
file1ChooseButton = JButton("Choose File")
file2ChooseButton = JButton("Choose File")
contentPane = JPanel(SpringLayout())
contentPane.setBorder(LineBorder(Color.blue))
contentPane.add(JLabel("Alternative DSS File"))
contentPane.add(textBox1)
contentPane.add(file1ChooseButton)
contentPane.add(JLabel("Base DSS File"))
contentPane.add(textBox2)
contentPane.add(file2ChooseButton)
fr = JFrame("Calsim Report Generator")
fr.contentPane().add(contentPane)
fr.pack();fr.show();
示例10: JyTwitter
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
class JyTwitter(object):
def __init__(self):
self.frame = JFrame("Jython Twitter")
self.frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)
self.loginPanel = JPanel(GridLayout(0,2))
self.frame.add(self.loginPanel)
self.usernameField = JTextField('',15)
self.loginPanel.add(JLabel("username:", SwingConstants.RIGHT))
self.loginPanel.add(self.usernameField)
self.passwordField = JPasswordField('', 15)
self.loginPanel.add(JLabel("password:", SwingConstants.RIGHT))
self.loginPanel.add(self.passwordField)
self.loginButton = JButton('Log in',actionPerformed=self.login)
self.loginPanel.add(self.loginButton)
self.message = JLabel("Please Log in")
self.loginPanel.add(self.message)
self.frame.pack()
self.frame.visible = True
def login(self,event):
self.message.text = "Attempting to Log in..."
self.frame.show()
username = self.usernameField.text
try:
self.api = twitter.Api(username, self.passwordField.text)
self.timeline(username)
self.loginPanel.visible = False
self.message.text = "Logged in"
except:
self.message.text = "Log in failed."
raise
self.frame.size = 400,800
self.frame.show()
def timeline(self, username):
timeline = self.api.GetFriendsTimeline(username)
self.resultPanel = JPanel()
self.resultPanel.layout = BoxLayout(self.resultPanel, BoxLayout.Y_AXIS)
for s in timeline:
self.showTweet(s)
scrollpane = JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER)
scrollpane.preferredSize = 400, 800
scrollpane.viewport.view = self.resultPanel
self.frame.add(scrollpane)
def showTweet(self, status):
user = status.user
p = JPanel()
# image grabbing seems very expensive, good place for a callback?
p.add(JLabel(ImageIcon(URL(user.profile_image_url))))
p.add(JTextArea(text = status.text,
editable = False,
wrapStyleWord = True,
lineWrap = True,
alignmentX = Component.LEFT_ALIGNMENT,
size = (300, 1)
))
self.resultPanel.add(p)
示例11: __init__
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
class NewAccountGUI:
def __init__(self, amgui):
self.amgui = amgui
self.am = amgui.acctmanager
self.buildgwinfo()
self.autologin = JCheckBox("Automatically Log In")
self.acctname = JTextField()
self.gwoptions = JPanel(doublebuffered)
self.gwoptions.border = TitledBorder("Gateway Options")
self.buildgwoptions("Twisted")
self.mainframe = JFrame("New Account Window")
self.buildpane()
def buildgwinfo(self):
self.gateways = {
"Twisted": {
"ident": JTextField(),
"passwd": JPasswordField(),
"host": JTextField("twistedmatrix.com"),
"port": JTextField("8787"),
"service": JTextField("twisted.words"),
"persp": JTextField(),
},
"AIM": {
"ident": JTextField(),
"passwd": JPasswordField(),
"host": JTextField("toc.oscar.aol.com"),
"port": JTextField("9898"),
},
"IRC": {
"ident": JTextField(),
"passwd": JPasswordField(),
"host": JTextField(),
"port": JTextField("6667"),
"channels": JTextField(),
},
}
self.displayorder = {
"Twisted": [
["Identity Name", "ident"],
["Password", "passwd"],
["Host", "host"],
["Port", "port"],
["Service Name", "service"],
["Perspective Name", "persp"],
],
"AIM": [["Screen Name", "ident"], ["Password", "passwd"], ["Host", "host"], ["Port", "port"]],
"IRC": [
["Nickname", "ident"],
["Password", "passwd"],
["Host", "host"],
["Port", "port"],
["Channels", "channels"],
],
}
def buildgwoptions(self, gw):
self.gwoptions.removeAll()
self.gwoptions.layout = GridLayout(len(self.gateways[gw]), 2)
for mapping in self.displayorder[gw]:
self.gwoptions.add(JLabel(mapping[0]))
self.gwoptions.add(self.gateways[gw][mapping[1]])
def buildpane(self):
gw = JPanel(GridLayout(1, 2), doublebuffered)
gw.add(JLabel("Gateway"))
self.gwlist = JComboBox(self.gateways.keys()) # , actionPerformed=self.changegw)
self.gwlist.setSelectedItem("Twisted")
gw.add(self.gwlist)
stdoptions = JPanel(GridLayout(2, 2), doublebuffered)
stdoptions.border = TitledBorder("Standard Options")
stdoptions.add(JLabel())
stdoptions.add(self.autologin)
stdoptions.add(JLabel("Account Name"))
stdoptions.add(self.acctname)
buttons = JPanel(FlowLayout(), doublebuffered)
buttons.add(JButton("OK", actionPerformed=self.addaccount))
buttons.add(JButton("Cancel", actionPerformed=self.cancel))
mainpane = self.mainframe.getContentPane()
mainpane.layout = BoxLayout(mainpane, BoxLayout.Y_AXIS)
mainpane.add(gw)
mainpane.add(self.gwoptions)
mainpane.add(stdoptions)
mainpane.add(buttons)
def show(self):
self.mainframe.setLocation(100, 100)
self.mainframe.pack()
self.mainframe.show()
# actionlisteners
def changegw(self, ae):
self.buildgwoptions(self.gwlist.getSelectedItem())
self.mainframe.pack()
self.mainframe.show()
def addaccount(self, ae):
#.........这里部分代码省略.........
示例12: GroupConversationWindow
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
class GroupConversationWindow(GroupConversation):
"""A GUI window of a conversation witha group of people"""
def __init__(self, group, chatui):
GroupConversation.__init__(self, group, chatui)
self.mainframe = JFrame(self.group.name)
self.headers = ["Member"]
self.memberdata = UneditableTableModel([], self.headers)
self.display = JTextArea(columns=100, rows=15, editable=0, lineWrap=1)
self.typepad = JTextField()
self.buildpane()
self.lentext = 0
def show(self):
self.mainframe.pack()
self.mainframe.show()
def hide(self):
self.mainframe.hide()
def showGroupMessage(self, sender, text, metadata=None):
self.displayText(sender + ": " + text)
def setGroupMembers(self, members):
GroupConversation.setGroupMembers(self, members)
self.updatelist()
def setTopic(self, topic, author):
topictext = "Topic: " + topic + ", set by " + author
self.mainframe.setTitle(self.group.name + ": " + topictext)
self.displayText(topictext)
def memberJoined(self, member):
GroupConversation.memberJoined(self, member)
self.updatelist()
def memberChangedNick(self, oldnick, newnick):
GroupConversation.memberChangedNick(self, oldnick, newnick)
self.updatelist()
def memberLeft(self, member):
GroupConversation.memberLeft(self, member)
self.updatelist()
#GUI code
def buildpane(self):
buttons = JPanel(doublebuffered)
buttons.add(JButton("Hide", actionPerformed=self.hidewindow))
memberpane = JTable(self.memberdata)
memberframe = JScrollPane(memberpane)
chat = JPanel(doublebuffered)
chat.setLayout(BoxLayout(chat, BoxLayout.Y_AXIS))
chat.add(JScrollPane(self.display))
self.typepad.actionPerformed = self.send
chat.add(self.typepad)
chat.add(buttons)
mainpane = self.mainframe.getContentPane()
mainpane.setLayout(BoxLayout(mainpane, BoxLayout.X_AXIS))
mainpane.add(chat)
mainpane.add(memberframe)
def displayText(self, text):
self.lentext = self.lentext + len(text)
self.display.append(text)
self.display.setCaretPosition(self.lentext)
def updatelist(self):
self.memberdata.setDataVector([self.members], self.headers)
#actionListener
def send(self, ae):
text = self.typepad.getText()
self.typepad.setText("")
if text != "" and text != None:
GroupConversation.sendText(self, text)
def hidewindow(self, ae):
self.hide()
示例13: execfile
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
#Auto generated by installer
import vutils; from vutils import *
import getopt,xgui,sys
from java.lang import System
if __name__=='__main__':
optlist, args = getopt.getopt(sys.argv[1:],'f:d')
vhome = System.getProperty('vista_home')
sep = System.getProperty('file.separator')
if vhome != None:
func_file = vhome+sep+'lib'+sep+'Lib'+sep+'vfuncs.py'
try:
execfile(func_file)
except:
pass # print 'Loading functions from: ', func_file
file = None
for option in optlist:
if option[0] == '-f':
file = option[1]
elif option[0] == '-d':
xgui._debug = 1
else:
pass
if file!=None and len(file)==0:
file=None
#xgui.MainGui(file)
from javax.swing import JFrame
fr=JFrame("Test")
fr.show();
print 'Start xgui '
示例14: doall
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
def doall(locations, fileobs,filerun1,filerun2,stime,etime,imageDir='d:/temp',weights=None,filter_type="AVE",normalize=False):
obs=HecDss.open(fileobs,True)
obs.setTimeWindow(stime,etime)
run1=HecDss.open(filerun1,True)
run1.setTimeWindow(stime,etime)
if filerun2 != None:
run2=HecDss.open(filerun2,True)
run2.setTimeWindow(stime,etime)
else:
run2=None
rms1=0
rms1_min,rms1_max=0,0
rms2=0
rms2_min,rms2_max=0,0
rmsmap={}
#run2=None
sumwts=0
average_interval=None;
for l in locations:
data1=get_matching(obs,'A=%s C=%s E=15MIN'%(l,type))
if data1 == None:
data1=get_matching(obs,'A=%s C=%s E=1DAY'%(l,type))
if data1 == None:
data1=get_matching(obs,'A=%s C=%s E=IR-DAY'%(l,type))
if data1 == None:
data1=get_matching(obs,'A=%s C=%s E=1HOUR'%(l,type))
drun1=get_matching(run1,'B=%s C=%s'%(l,type))
if run2 != None:
drun2=get_matching(run2, 'B=%s C=%s'%(l,type))
else:
drun2=None
avg_intvl="1DAY"
if data1 != None:
if average_interval != None:
dobsd=TimeSeriesMath(data1).transformTimeSeries(average_interval, None, filter_type, 0)
else:
dobsd=TimeSeriesMath(data1)
if normalize:
dobsd=dobsd.divide(TimeSeriesMath(data1).mean())
dobsm=TimeSeriesMath(data1).transformTimeSeries(avg_intvl, None, filter_type, 0)
dobsm_max=TimeSeriesMath(data1).transformTimeSeries(avg_intvl, None, "MAX", 0)
dobsm_max.data.fullName=dobsm_max.data.fullName+"MAX"
dobsm_min=TimeSeriesMath(data1).transformTimeSeries(avg_intvl, None, "MIN", 0)
dobsm_min.data.fullName=dobsm_min.data.fullName+"MIN"
if normalize:
dobsm=dobsm.divide(TimeSeriesMath(data1).mean())
if drun1==None:
continue;
else:
if average_interval != None:
drun1d=TimeSeriesMath(drun1).transformTimeSeries(average_interval, None, filter_type, 0)
else:
drun1d=TimeSeriesMath(drun1)
if normalize:
drun1d=drun1d.divide(TimeSeriesMath(drun1).mean())
if drun2 != None:
if average_interval != None:
drun2d=TimeSeriesMath(drun2).transformTimeSeries(average_interval, None, filter_type, 0)
else:
drun2d=TimeSeriesMath(drun2)
if normalize:
drun2d=drun2d.divide(TimeSeriesMath(drun2).mean())
drun1m=TimeSeriesMath(drun1).transformTimeSeries(avg_intvl, None, filter_type, 0)
drun1m_max=TimeSeriesMath(drun1).transformTimeSeries(avg_intvl, None, "MAX", 0)
drun1m_min=TimeSeriesMath(drun1).transformTimeSeries(avg_intvl, None, "MIN", 0)
if normalize:
drun1m=drun1m.divide(TimeSeriesMath(drun1).mean())
if drun2 != None:
drun2m=TimeSeriesMath(drun2).transformTimeSeries(avg_intvl, None, filter_type, 0)
drun2m_max=TimeSeriesMath(drun2).transformTimeSeries(avg_intvl, None, "MAX", 0)
drun2m_min=TimeSeriesMath(drun2).transformTimeSeries(avg_intvl, None, "MIN", 0)
if normalize:
drun2m=drun2m.divide(TimeSeriesMath(drun2).mean())
else:
drun2m=None
if weights != None:
sumwts=sumwts+weights[l]
lrms1 = calculate_rms(drun1m.data, dobsm.data)*weights[l]
lrms1_min=calculate_rms(drun1m_min.data,dobsm_min.data)*weights[l]
lrms1_max=calculate_rms(drun1m_max.data,dobsm_max.data)*weights[l]
rms1=rms1+lrms1
rms1_min=rms1_min+lrms1_min
rms1_max=rms1_max+lrms1_max
lrms2 = calculate_rms(drun2m.data,dobsm.data)*weights[l]
lrms2_min=calculate_rms(drun2m_min.data,dobsm_min.data)*weights[l]
lrms2_max=calculate_rms(drun2m_max.data,dobsm_max.data)*weights[l]
rmsmap[l] = lrms1,lrms2,lrms1_min,lrms2_min,lrms1_max,lrms2_max
rms2=rms2+lrms2
rms2_min=rms2_min+lrms2_min
rms2_max=rms2_max+lrms2_max
plotd = newPlot("Hist vs New Geom [%s]"%l)
if data1 != None:
plotd.addData(dobsd.data)
plotd.addData(drun1d.data)
if drun2 != None:
plotd.addData(drun2d.data)
plotd.showPlot()
legend_label = plotd.getLegendLabel(drun1d.data)
legend_label.setText(legend_label.getText()+" ["+str(int(lrms1*100)/100.)+","+str(int(lrms1_min*100)/100.)+","+str(int(lrms1_max*100)/100.)+"]")
legend_label = plotd.getLegendLabel(drun2d.data)
#.........这里部分代码省略.........
示例15: JFrame
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import show [as 别名]
# Introduction to Jython
from javax.swing import JFrame, JLabel
frame = JFrame("Hello, Jython!",
defaultCloseOperation = JFrame.EXIT_ON_CLOSE,
size = (200, 200)
)
label = JLabel("Hello, Jython")
frame.add(label)
frame.show()