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