當前位置: 首頁>>代碼示例>>Python>>正文


Python JScrollPane.preferredSize方法代碼示例

本文整理匯總了Python中javax.swing.JScrollPane.preferredSize方法的典型用法代碼示例。如果您正苦於以下問題:Python JScrollPane.preferredSize方法的具體用法?Python JScrollPane.preferredSize怎麽用?Python JScrollPane.preferredSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JScrollPane的用法示例。


在下文中一共展示了JScrollPane.preferredSize方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import preferredSize [as 別名]
    def __init__(self):
        super(AboutDialog, self).__init__()

        # Open the files and build a tab pane
        self.tabbedPane = tabs = JTabbedPane()

        for title, path in self.INFO_FILES:
            textPane = JTextPane()
            textPane.editable = False
            scrollPane = JScrollPane(textPane)
            scrollPane.preferredSize = (32767, 32767)   # just a large number

            with open(path, 'r') as fd:
                infoText = fd.read().decode('utf8')
                textPane.text = infoText

            textPane.caretPosition = 0
            tabs.addTab(title, scrollPane)

        # Load this tabbed pane into the layout
        self.add(tabs, BorderLayout.CENTER)

        # Add a label at the top
        versionLabel = JLabel(JESVersion.TITLE + " version " + JESVersion.RELEASE)
        versionLabel.alignmentX = Component.CENTER_ALIGNMENT

        versionPanel = JPanel()
        versionPanel.add(versionLabel)
        self.add(versionPanel, BorderLayout.PAGE_START)

        # Make an OK button
        self.okButton = JButton(self.ok)
        self.buttonPanel.add(self.okButton)
開發者ID:HenryStevens,項目名稱:jes,代碼行數:35,代碼來源:about.py

示例2: timeline

# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import preferredSize [as 別名]
    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)
開發者ID:jython,項目名稱:book,代碼行數:15,代碼來源:twitfriends.py

示例3: __init__

# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import preferredSize [as 別名]
    def __init__(self):
        super(IntroDialog, self).__init__()

        # Open the text file and make a text pane
        textPane = JTextPane()
        textPane.editable = False

        scrollPane = JScrollPane(textPane)
        scrollPane.preferredSize = (32767, 32767)   # just a large number

        with open(self.INFO_FILE, 'r') as fd:
            infoText = fd.read().decode('utf8').replace(
                "@[email protected]", JESVersion.VERSION
            )
            textPane.text = infoText

        # Load the scroll pane into the layout
        self.add(scrollPane, BorderLayout.CENTER)

        # Make an OK button
        self.okButton = JButton(self.ok)
        self.buttonPanel.add(self.okButton)
開發者ID:HenryStevens,項目名稱:jes,代碼行數:24,代碼來源:intro.py

示例4: __init__

# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import preferredSize [as 別名]
    def __init__(self):
        super(BugReportDialog, self).__init__()

        # Add a message
        textPane = JTextPane()
        textPane.editable = False

        version = "\n".join("    " + line for line in JESVersion.getMessage().splitlines())
        textPane.text = MESSAGE % version

        scrollPane = JScrollPane(textPane)
        scrollPane.preferredSize = (32767, 32767)   # just a large number

        # Load it into the layout
        self.add(scrollPane, BorderLayout.CENTER)

        # Make buttons
        self.sendButton = JButton(self.send)
        self.buttonPanel.add(self.sendButton)

        self.closeButton = JButton(self.close)
        self.buttonPanel.add(self.closeButton)
開發者ID:HenryStevens,項目名稱:jes,代碼行數:24,代碼來源:bugreport.py

示例5: menuItemClicked

# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import preferredSize [as 別名]
    def menuItemClicked(self, caption, messageInfo):
        response = messageInfo[0].getResponse()
        strResponse = ''.join([chr(c%256) for c in response])
        frame = JFrame('DOM XSS',size = (300,300))
        parentPanel = JPanel()


        #printedCode = JTextPane(text = strResponse)
        #'''
        #colored code
        printedCode = JTextPane()
        styledDoc = printedCode.getStyledDocument()
        style = printedCode.addStyle('ColoredCode',None)
        self.filter2(strResponse,styledDoc,style)
        #'''
        #Scroll Bar
        scrollPanel = JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED)
        scrollPanel.preferredSize = 1500,800
        scrollPanel.viewport.view = printedCode

        #Final Inclusion of Panels
        parentPanel.add(scrollPanel)
        frame.add(parentPanel)
        frame.visible = True
開發者ID:0x24bin,項目名稱:BurpSuite,代碼行數:26,代碼來源:DOM_XSS_Hilight.py


注:本文中的javax.swing.JScrollPane.preferredSize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。