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