本文整理汇总了Python中javax.swing.JTextPane.text方法的典型用法代码示例。如果您正苦于以下问题:Python JTextPane.text方法的具体用法?Python JTextPane.text怎么用?Python JTextPane.text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JTextPane
的用法示例。
在下文中一共展示了JTextPane.text方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from javax.swing import JTextPane [as 别名]
# 或者: from javax.swing.JTextPane import text [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)
示例2: __init__
# 需要导入模块: from javax.swing import JTextPane [as 别名]
# 或者: from javax.swing.JTextPane import text [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)
示例3: __init__
# 需要导入模块: from javax.swing import JTextPane [as 别名]
# 或者: from javax.swing.JTextPane import text [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)