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


Python JTextPane.editable方法代码示例

本文整理汇总了Python中javax.swing.JTextPane.editable方法的典型用法代码示例。如果您正苦于以下问题:Python JTextPane.editable方法的具体用法?Python JTextPane.editable怎么用?Python JTextPane.editable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JTextPane的用法示例。


在下文中一共展示了JTextPane.editable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from javax.swing import JTextPane [as 别名]
# 或者: from javax.swing.JTextPane import editable [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: __init__

# 需要导入模块: from javax.swing import JTextPane [as 别名]
# 或者: from javax.swing.JTextPane import editable [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

示例3: __init__

# 需要导入模块: from javax.swing import JTextPane [as 别名]
# 或者: from javax.swing.JTextPane import editable [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


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