当前位置: 首页>>代码示例>>Python>>正文


Python JScrollPane.verticalScrollBarPolicy方法代码示例

本文整理汇总了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)
开发者ID:sz33psz,项目名称:perf_abstr_solution,代码行数:42,代码来源:MainWindow.py


注:本文中的javax.swing.JScrollPane.verticalScrollBarPolicy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。