本文整理匯總了Python中javax.swing.JScrollPane.setBorder方法的典型用法代碼示例。如果您正苦於以下問題:Python JScrollPane.setBorder方法的具體用法?Python JScrollPane.setBorder怎麽用?Python JScrollPane.setBorder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JScrollPane
的用法示例。
在下文中一共展示了JScrollPane.setBorder方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: fillPanel
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setBorder [as 別名]
def fillPanel(self, question):
self.pnlQuestion.removeAll()
if question.getKind() == 2:
panel = TrueFalsePanel(question).getPanel()
elif question.getKind() == 3:
panel = MultipleChoicePanel(question).getPanel()
scrollpanel = JScrollPane(panel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED)
scrollpanel.setBorder(None)
self.pnlQuestion.add(scrollpanel, BorderLayout.CENTER)
self.pnlQuestion.updateUI()
示例2: __fillQuestions
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setBorder [as 別名]
def __fillQuestions(self):
panel = JPanel()
panel.setLayout(GridBagLayout())
panel.setBorder(None)
c = GridBagConstraints()
c.gridx = 0
c.gridy = 0
c.weightx = 1.0
c.fill = GridBagConstraints.HORIZONTAL
c.anchor = GridBagConstraints.PAGE_START
line = 0
for question in self.test.getQuestions():
c.gridy = line
panel.add(question.getPanel().asJComponent(),c)
line += 1
scrollPanel = JScrollPane(panel)
scrollPanel.setBorder(None)
self.questionsContainer.setLayout(BorderLayout())
self.questionsContainer.add(scrollPanel, BorderLayout.CENTER)