本文整理汇总了Python中javax.swing.JFrame.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python JFrame.__init__方法的具体用法?Python JFrame.__init__怎么用?Python JFrame.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JFrame
的用法示例。
在下文中一共展示了JFrame.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import __init__ [as 别名]
def __init__(self, channels):
JFrame.__init__(self, "Informa Example News Client")
self.setSize(400, 400)
self.addWindowListener(BasicWindowMonitor())
self.channels = channels
self.channel_dict = None
self.channelTree = None
self.channelPanel = None
self.itemTable = None
self.mediator = MainMediator(self)
# items (in table)
itemScrollPane = JScrollPane(self.getItemTable())
# channels (as tree)
channelScrollPane = JScrollPane(self.getChannelTree())
# put together channel info with item table
ch_and_items = JPanel()
ch_and_items.setLayout(BorderLayout())
ch_and_items.add(self.getChannelPanel(), BorderLayout.NORTH)
ch_and_items.add(itemScrollPane, BorderLayout.CENTER)
# final step
sp = JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
channelScrollPane, ch_and_items)
# print "dividerLocation", sp.getDividerLocation()
# sp.setDividerLocation(0.5)
self.getContentPane().add(sp, BorderLayout.CENTER)
示例2: __init__
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import __init__ [as 别名]
def __init__(self, title="Development Reloader Window"):
if jython:
JFrame.__init__(self, title, windowClosing=self.OnClose)
self.setBounds(0, 0, 300, 550)
else:
self.window = MakeWindow("pyGTK Python Reloader window", 200, 500)
self.BuildWindow()
示例3: __init__
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import __init__ [as 别名]
def __init__(self):
JFrame.__init__(self, 'MagicDraw Jython Console')
# grab the current out and err so we can set them back later (for the main java
# System.out/err, not the PythonInterpreter
self.__outOriginal = System.out
self.__errOriginal = System.err
# use the printStream as it updates the textarea
System.setOut(self.printStream)
System.setErr(self.printStream)
self.CreateComponents()
self.setVisible(True)
self.requestFocus()
self.inputField.requestFocus()
示例4: __init__
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import __init__ [as 别名]
def __init__(self, title=""):
JFrame.__init__(self, title)
self.size = 400,500
self.windowClosing = self.closing
label = JLabel(text="Class Name:")
label.horizontalAlignment = JLabel.RIGHT
tpanel = JPanel(layout = awt.FlowLayout())
self.text = JTextField(20, actionPerformed = self.entered)
btn = JButton("Enter", actionPerformed = self.entered)
tpanel.add(label)
tpanel.add(self.text)
tpanel.add(btn)
bpanel = JPanel()
self.tree = JTree(default_tree())
scrollpane = JScrollPane(self.tree)
scrollpane.setMinimumSize(awt.Dimension(200,200))
scrollpane.setPreferredSize(awt.Dimension(350,400))
bpanel.add(scrollpane)
bag = GridBag(self.contentPane)
bag.addRow(tpanel, fill='HORIZONTAL', weightx=1.0, weighty=0.5)
bag.addRow(bpanel, fill='BOTH', weightx=0.5, weighty=1.0)
示例5: __init__
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import __init__ [as 别名]
def __init__(self):
JFrame.__init__(self, "SwingingMonkeyCommander", \
layout=BorderLayout(), \
size=(505, 874), \
defaultCloseOperation=JFrame.EXIT_ON_CLOSE,) \
scriptDir = os.path.realpath(os.path.dirname(sys.argv[0]))
self.frameIcon = ImageIcon(scriptDir + '/smcs.png')
self.setIconImage(self.frameIcon.getImage())
self.image = ImageIcon()
self.label = JLabel(self.image)
self.scrollpane = JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED)
self.scrollpane.addMouseListener(ScreenMouseListener(self))
self.keyListener = ScreenKeyListener(self)
self.initAndroidKeyMap()
self.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, Collections.EMPTY_SET);
self.scrollpane.preferredSize = self._preferredWidth, self._preferredHeight
self.scrollpane.viewport.view = self.label
self.label.preferredSize = (self._preferredWidth, self._preferredHeight)
self.add(self.scrollpane, BorderLayout.PAGE_START)
self.show()
self.androidDevice = None
if self.waitForAndroidDeviceConnection() == False:
print "Could not establish connection with device."
return
self.screenPullTask = ScreenPullTask(self)
self.screenPullTask.execute()
self.dragStart = (0,0)
self.dragEnd = (0,0)
示例6: __init__
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import __init__ [as 别名]
def __init__(self):
JFrame.__init__(self)
self.initUI()
示例7: __init__
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import __init__ [as 别名]
def __init__(self, title="Development Reloader Window"):
JFrame.__init__(self, title, windowClosing=self.OnClose)
self.setBounds(0, 0, 300, 550)
self.BuildWindow()