本文整理汇总了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)
示例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)
示例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)
示例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)
示例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