本文整理汇总了Python中javax.swing.JScrollPane.verticalScrollBarPolicy方法的典型用法代码示例。如果您正苦于以下问题:Python JScrollPane.verticalScrollBarPolicy方法的具体用法?Python JScrollPane.verticalScrollBarPolicy怎么用?Python JScrollPane.verticalScrollBarPolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JScrollPane
的用法示例。
在下文中一共展示了JScrollPane.verticalScrollBarPolicy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from javax.swing import JScrollPane [as 别名]
# 或者: from javax.swing.JScrollPane import verticalScrollBarPolicy [as 别名]
def __init__(self):
self.frame = JFrame('Hello, Jython!',
defaultCloseOperation=JFrame.EXIT_ON_CLOSE,
size=(400, 600))
bag_layout = GridBagLayout()
self.frame.layout = bag_layout
grid_constraints = GridBagConstraints()
format_1_string_label = JLabel("Format 1 string:")
grid_constraints.weightx = 0.1
grid_constraints.weighty = 0.1
grid_constraints.gridy = 0
grid_constraints.fill = GridBagConstraints.NONE
self._add_component(format_1_string_label, bag_layout, grid_constraints)
self.input_textbox = JTextArea()
grid_constraints.weightx = 1
grid_constraints.weighty = 1
grid_constraints.gridy = 1
grid_constraints.fill = GridBagConstraints.BOTH
input_scroll_pane = JScrollPane(self.input_textbox)
input_scroll_pane.verticalScrollBarPolicy = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS
self._add_component(input_scroll_pane, bag_layout, grid_constraints)
output_string_label = JLabel("Output:")
grid_constraints.weightx = 0.1
grid_constraints.weighty = 0.1
grid_constraints.gridy = 2
grid_constraints.fill = GridBagConstraints.NONE
self._add_component(output_string_label, bag_layout, grid_constraints)
self.output_textbox = JTextArea()
grid_constraints.weightx = 1
grid_constraints.weighty = 1
grid_constraints.gridy = 3
grid_constraints.fill = GridBagConstraints.BOTH
self.output_textbox.editable = False
output_scroll_pane = JScrollPane(self.output_textbox)
output_scroll_pane.verticalScrollBarPolicy = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS
self._add_component(output_scroll_pane, bag_layout, grid_constraints)