当前位置: 首页>>代码示例>>Python>>正文


Python JFrame.__init__方法代码示例

本文整理汇总了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)
开发者ID:optivo-org,项目名称:informa-0.7.0-optivo,代码行数:34,代码来源:minigui.py

示例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()
开发者ID:Cybernetic-Shadow,项目名称:PlantStudio,代码行数:10,代码来源:reloader.py

示例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()
开发者ID:thecaffiend,项目名称:MagicDrawJythonTerminal,代码行数:15,代码来源:MagicDrawJythonTerminal.py

示例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) 
开发者ID:ryaneberly,项目名称:tn5250j,代码行数:26,代码来源:jyinfo.py

示例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)
开发者ID:fejd,项目名称:SwingingMonkeyCommander,代码行数:38,代码来源:SwingingMonkeyCommander.py

示例6: __init__

# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import __init__ [as 别名]
 def __init__(self):
     JFrame.__init__(self)
     self.initUI()
开发者ID:GikonyoB,项目名称:Tutorials,代码行数:5,代码来源:simple.py

示例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()
开发者ID:pdfernhout,项目名称:openvirgle,代码行数:7,代码来源:jreloadWindow.py


注:本文中的javax.swing.JFrame.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。