本文整理匯總了Python中javax.swing.JScrollPane.setSize方法的典型用法代碼示例。如果您正苦於以下問題:Python JScrollPane.setSize方法的具體用法?Python JScrollPane.setSize怎麽用?Python JScrollPane.setSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JScrollPane
的用法示例。
在下文中一共展示了JScrollPane.setSize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Dimension
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setSize [as 別名]
size = Dimension(600, 200 * numberOfStringPairs)
panel.setSize(size)
panel.setPreferredSize(size)
records.sort()
for record in records:
try:
oldname, oldVertices, oldEdges = record.oldstring.split(' ')
newname, newVertices, newEdges = record.newstring.split(' ')
oldPanel = LinearViewPanel(300, 200)
oldPanel.renderVertices(oldVertices)
oldPanel.renderEdges(oldEdges)
oldPanel.setToolTipText(oldname)
panel.add(oldPanel)
newPanel = LinearViewPanel(300, 200)
newPanel.renderVertices(newVertices)
newPanel.renderEdges(newEdges)
newPanel.setToolTipText(newname)
panel.add(newPanel)
except ValueError:
pass
#print oldstring, newstring
scrollPane = JScrollPane(panel, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED)
scrollPane.setSize(800,400)
frame.getContentPane().add(scrollPane)
frame.setVisible(1)