javax.swing.JScrollPane.getVerticalScrollBar()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(14.3k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中javax.swing.JScrollPane.getVerticalScrollBar()方法的一些代码示例,展示了JScrollPane.getVerticalScrollBar()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JScrollPane.getVerticalScrollBar()方法的具体详情如下:
包路径:javax.swing.JScrollPane
类名称:JScrollPane
方法名:getVerticalScrollBar

JScrollPane.getVerticalScrollBar介绍

暂无

代码示例

代码示例来源:origin: kiegroup/optaplanner

private Container createContentPane() {
  JPanel contentPane = new JPanel(new BorderLayout(5, 5));
  contentPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
  JLabel titleLabel = new JLabel("Which example do you want to see?", JLabel.CENTER);
  titleLabel.setFont(titleLabel.getFont().deriveFont(20.0f));
  contentPane.add(titleLabel, BorderLayout.NORTH);
  JScrollPane examplesScrollPane = new JScrollPane(createExamplesPanel());
  examplesScrollPane.getHorizontalScrollBar().setUnitIncrement(20);
  examplesScrollPane.getVerticalScrollBar().setUnitIncrement(20);
  examplesScrollPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
  contentPane.add(examplesScrollPane, BorderLayout.CENTER);
  JPanel bottomPanel = new JPanel(new BorderLayout(5, 5));
  bottomPanel.add(createDescriptionPanel(), BorderLayout.CENTER);
  bottomPanel.add(createExtraPanel(), BorderLayout.EAST);
  contentPane.add(bottomPanel, BorderLayout.SOUTH);
  return contentPane;
}

代码示例来源:origin: deathmarine/Luyten

protected JPanel getFontFamilyPanel() {
  if (fontNamePanel == null) {
    fontNamePanel = new JPanel();
    fontNamePanel.setLayout(new BorderLayout());
    fontNamePanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    fontNamePanel.setPreferredSize(new Dimension(180, 130));
    JScrollPane scrollPane = new JScrollPane(getFontFamilyList());
    scrollPane.getVerticalScrollBar().setFocusable(false);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    JPanel p = new JPanel();
    p.setLayout(new BorderLayout());
    p.add(getFontFamilyTextField(), BorderLayout.NORTH);
    p.add(scrollPane, BorderLayout.CENTER);
    JLabel label = new JLabel(("Font Name"));
    label.setHorizontalAlignment(JLabel.LEFT);
    label.setHorizontalTextPosition(JLabel.LEFT);
    label.setLabelFor(getFontFamilyTextField());
    label.setDisplayedMnemonic('F');
    fontNamePanel.add(label, BorderLayout.NORTH);
    fontNamePanel.add(p, BorderLayout.CENTER);
  }
  return fontNamePanel;
}

代码示例来源:origin: deathmarine/Luyten

protected JPanel getFontStylePanel() {
  if (fontStylePanel == null) {
    fontStylePanel = new JPanel();
    fontStylePanel.setLayout(new BorderLayout());
    fontStylePanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    fontStylePanel.setPreferredSize(new Dimension(140, 130));
    JScrollPane scrollPane = new JScrollPane(getFontStyleList());
    scrollPane.getVerticalScrollBar().setFocusable(false);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    JPanel p = new JPanel();
    p.setLayout(new BorderLayout());
    p.add(getFontStyleTextField(), BorderLayout.NORTH);
    p.add(scrollPane, BorderLayout.CENTER);
    JLabel label = new JLabel(("Font Style"));
    label.setHorizontalAlignment(JLabel.LEFT);
    label.setHorizontalTextPosition(JLabel.LEFT);
    label.setLabelFor(getFontStyleTextField());
    label.setDisplayedMnemonic('Y');
    fontStylePanel.add(label, BorderLayout.NORTH);
    fontStylePanel.add(p, BorderLayout.CENTER);
  }
  return fontStylePanel;
}

代码示例来源:origin: deathmarine/Luyten

protected JPanel getFontSizePanel() {
  if (fontSizePanel == null) {
    fontSizePanel = new JPanel();
    fontSizePanel.setLayout(new BorderLayout());
    fontSizePanel.setPreferredSize(new Dimension(70, 130));
    fontSizePanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    JScrollPane scrollPane = new JScrollPane(getFontSizeList());
    scrollPane.getVerticalScrollBar().setFocusable(false);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    JPanel p = new JPanel();
    p.setLayout(new BorderLayout());
    p.add(getFontSizeTextField(), BorderLayout.NORTH);
    p.add(scrollPane, BorderLayout.CENTER);
    JLabel label = new JLabel(("Font Size"));
    label.setHorizontalAlignment(JLabel.LEFT);
    label.setHorizontalTextPosition(JLabel.LEFT);
    label.setLabelFor(getFontSizeTextField());
    label.setDisplayedMnemonic('S');
    fontSizePanel.add(label, BorderLayout.NORTH);
    fontSizePanel.add(p, BorderLayout.CENTER);
  }
  return fontSizePanel;
}

代码示例来源:origin: kiegroup/optaplanner

private JComponent createQuickOpenPanel(JList<QuickOpenAction> listPanel, String title, List<File> fileList) {
  listPanel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  listPanel.addListSelectionListener(event -> {
    if (event.getValueIsAdjusting()) {
      return;
    }
    int selectedIndex = listPanel.getSelectedIndex();
    if (selectedIndex < 0) {
      return;
    }
    QuickOpenAction action = listPanel.getModel().getElementAt(selectedIndex);
    action.actionPerformed(new ActionEvent(listPanel, -1, null));
  });
  refreshQuickOpenPanel(listPanel, fileList);
  JScrollPane scrollPane = new JScrollPane(listPanel);
  scrollPane.getVerticalScrollBar().setUnitIncrement(25);
  scrollPane.setMinimumSize(new Dimension(100, 80));
  // Size fits into screen resolution 1024*768
  scrollPane.setPreferredSize(new Dimension(180, 200));
  JPanel titlePanel = new JPanel(new BorderLayout());
  titlePanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
  JLabel titleLabel = new JLabel(title);
  titleLabel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
  titlePanel.add(titleLabel, BorderLayout.NORTH);
  titlePanel.add(scrollPane, BorderLayout.CENTER);
  return titlePanel;
}

代码示例来源:origin: libgdx/libgdx

.createTitledBorder("Editor Properties")));
JScrollPane scroll = new JScrollPane();
propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH,
  GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  scroll.getVerticalScrollBar().setUnitIncrement(70);
.createTitledBorder("Emitter Properties")));
JScrollPane scroll = new JScrollPane();
propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH,
  GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  scroll.getVerticalScrollBar().setUnitIncrement(70);

代码示例来源:origin: libgdx/libgdx

.createTitledBorder("Editor Properties")));
JScrollPane scroll = new JScrollPane();
propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH,
  GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  scroll.getVerticalScrollBar().setUnitIncrement(70);
.createTitledBorder("Emitter Properties")));
JScrollPane scroll = new JScrollPane();
propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH,
  GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  scroll.getVerticalScrollBar().setUnitIncrement(70);

代码示例来源:origin: libgdx/libgdx

.createTitledBorder("Editor Properties")));
JScrollPane scroll = new JScrollPane();
propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH,
  GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  scroll.getVerticalScrollBar().setUnitIncrement(70);
.createTitledBorder("Influencers")));
JScrollPane scroll = new JScrollPane();
propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH,
  GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
  scroll.setViewportView(influencersPanel);
  scroll.getVerticalScrollBar().setUnitIncrement(70);
.createTitledBorder("Particle Controller Components")));
JScrollPane scroll = new JScrollPane();
propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH,
  GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  scroll.getVerticalScrollBar().setUnitIncrement(70);

代码示例来源:origin: libgdx/libgdx

.createTitledBorder("Editor Properties")));
JScrollPane scroll = new JScrollPane();
propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH,
  GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  scroll.getVerticalScrollBar().setUnitIncrement(70);
.createTitledBorder("Influencers")));
JScrollPane scroll = new JScrollPane();
propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH,
  GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
  scroll.setViewportView(influencersPanel);
  scroll.getVerticalScrollBar().setUnitIncrement(70);
.createTitledBorder("Particle Controller Components")));
JScrollPane scroll = new JScrollPane();
propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH,
  GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  scroll.getVerticalScrollBar().setUnitIncrement(70);

代码示例来源:origin: kiegroup/optaplanner

public MrProcessAssignmentListDialog() {
  setModal(true);
  setTitle(getMachineLabel());
  JPanel contentPanel = new JPanel();
  GroupLayout layout = new GroupLayout(contentPanel);
  contentPanel.setLayout(layout);
  JPanel assignmentsPanel = createAssignmentsPanel();
  JScrollPane contentScrollPane = new JScrollPane(assignmentsPanel);
  contentScrollPane.setPreferredSize(new Dimension(800, 200));
  contentScrollPane.getVerticalScrollBar().setUnitIncrement(20);
  setContentPane(contentScrollPane);
  pack();
}

代码示例来源:origin: kiegroup/optaplanner

public CloudProcessListDialog() {
  setModal(true);
  setTitle(getComputerLabel());
  JPanel contentPanel = new JPanel();
  contentPanel.setLayout(new BorderLayout());
  contentPanel.add(createHeaderPanel(), BorderLayout.NORTH);
  JPanel assignmentsPanel = createAssignmentsPanel();
  JScrollPane assignmentsScrollPane = new JScrollPane(assignmentsPanel);
  assignmentsScrollPane.setPreferredSize(new Dimension(800, 400));
  assignmentsScrollPane.getVerticalScrollBar().setUnitIncrement(20);
  contentPanel.add(assignmentsScrollPane, BorderLayout.CENTER);
  JPanel buttonPanel = new JPanel(new FlowLayout());
  Action okAction = new AbstractAction("Ok") {
    @Override
    public void actionPerformed(ActionEvent e) {
      dispose();
    }
  };
  buttonPanel.add(new JButton(okAction));
  contentPanel.add(buttonPanel, BorderLayout.SOUTH);
  setContentPane(contentPanel);
  pack();
}

代码示例来源:origin: stanfordnlp/CoreNLP

private DisplayMatchesPanel() {
 //data
 JPanel spaceholder = new JPanel();
 spaceholder.setBackground(Color.white);
 JTextArea message = new JTextArea("For non-English trees, first set up the tree reader and encoding in Preferences. Then load trees from the File menu.");
 message.setEditable(false);
 spaceholder.add(message);
 scroller = new JScrollPane(spaceholder);
 // Fix slow scrolling on OS X
 if (TregexGUI.isMacOSX()) {
  scroller.getVerticalScrollBar().setUnitIncrement(3);
  scroller.getHorizontalScrollBar().setUnitIncrement(3);
 }
 this.setFocusable(true);
 this.setTransferHandler(new DisplayTransferHandler());
 MatchesPanel.getInstance().addListener(this);
 //layout
 this.setLayout(new BorderLayout());
 this.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(),""));
 this.add(scroller, BorderLayout.CENTER);
}

代码示例来源:origin: runelite/runelite

JScrollPane resultsWrapper = new JScrollPane(wrapper);
resultsWrapper.setBackground(ColorScheme.DARK_GRAY_COLOR);
resultsWrapper.getVerticalScrollBar().setPreferredSize(new Dimension(12, 0));
resultsWrapper.getVerticalScrollBar().setBorder(new EmptyBorder(0, 5, 0, 0));
resultsWrapper.setVisible(false);

代码示例来源:origin: log4j/log4j

JScrollPane detailTAScrollPane = new JScrollPane(detailTA);
_table = new LogTable(detailTA);
setView(_currentView, _table);
_table.setFont(new Font(_fontName, Font.PLAIN, _fontSize));
_logTableScrollPane = new JScrollPane(_table);
 _logTableScrollPane.getVerticalScrollBar().addAdjustmentListener(
   new TrackingAdjustmentListener()
 );
  new JScrollPane(_categoryExplorerTree);
categoryExplorerTreeScrollPane.setPreferredSize(new Dimension(130, 400));

代码示例来源:origin: runelite/runelite

trackerWrapper.add(tracker, BorderLayout.NORTH);
final JScrollPane trackerScroller = new JScrollPane(trackerWrapper);
trackerScroller.setPreferredSize(new Dimension(400, 400));
final JScrollBar vertical = trackerScroller.getVerticalScrollBar();
vertical.addAdjustmentListener(new AdjustmentListener()

代码示例来源:origin: runelite/runelite

wrapped.setBackground(ColorScheme.DARK_GRAY_COLOR);
JScrollPane scroller = new JScrollPane(wrapped);
scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scroller.getVerticalScrollBar().setPreferredSize(new Dimension(16, 0));
scroller.getVerticalScrollBar().setBorder(new EmptyBorder(0, 9, 0, 0));
scroller.setBackground(ColorScheme.DARK_GRAY_COLOR);

代码示例来源:origin: chewiebug/GCViewer

public ChartPanelView(final GCPreferences preferences, final GCResource gcResource) {
  this.gcResource = gcResource;
  this.modelDetailsPanel = new ModelDetailsPanel();
  this.modelChart = new ModelChartImpl();
  this.preferences = preferences;
  this.modelMetricsPanel = new ModelMetricsPanel();
  this.modelLoaderView = new GCModelLoaderView(gcResource);
  
  JScrollPane modelDetailsScrollPane = new JScrollPane(modelDetailsPanel, 
      JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, 
      JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  JScrollBar hScrollBar = modelDetailsScrollPane.getHorizontalScrollBar();
  hScrollBar.setUnitIncrement(10);
  JScrollBar vScrollBar = modelDetailsScrollPane.getVerticalScrollBar();
  vScrollBar.setUnitIncrement(10);
  this.modelChartAndDetailsPanel = new JTabbedPane();
  this.modelChartAndDetailsPanel.addTab(LocalisationHelper.getString("data_panel_tab_chart"), modelChart);
  this.modelChartAndDetailsPanel.addTab(LocalisationHelper.getString("data_panel_tab_details"), modelDetailsScrollPane);
  this.modelChartAndDetailsPanel.addTab(LocalisationHelper.getString("data_panel_tab_parser"), modelLoaderView);
  
  this.viewBar = new ViewBar(this);
  this.propertyChangeSupport = new SwingPropertyChangeSupport(this);
  
  setGcResource(gcResource);
  updateTabDisplay(gcResource);
}

代码示例来源:origin: stackoverflow.com

JScrollPane scrollPane = new JScrollPane( textArea );
JScrollPane scrollPane = new JScrollPane( textArea );
JScrollPane scrollPane = new JScrollPane( textArea );
scrollPane.getVerticalScrollBar().setFocusable(false);
textArea.setText("Add Traversal Keys\n2\n3\n4\n5\n6\n7\n8\n9");
JScrollPane scrollPane = new JScrollPane( textArea );
scrollPane.getVerticalScrollBar().setFocusable(false);

代码示例来源:origin: stackoverflow.com

JPanel gui = new JPanel(new BorderLayout(3,3));
final JPanel panel = new JPanel(new GridLayout(0,1));
final JScrollPane scroll = new JScrollPane(panel);
scroll.setPreferredSize(new Dimension(80,100));
gui.add(scroll, BorderLayout.CENTER);
    panel.revalidate();
    int height = (int)panel.getPreferredSize().getHeight();
    scroll.getVerticalScrollBar().setValue(height);

代码示例来源:origin: stackoverflow.com

JPanel panel = new JPanel(new BorderLayout());
final JPanel buttons = new JPanel();
final JScrollPane pane = new JScrollPane(buttons);
pane.getViewport().addChangeListener(new ChangeListener() {
  public void stateChanged(ChangeEvent e) {
    System.err.println("Change in " + e.getSource());
    System.err.println("Vertical visible? " + pane.getVerticalScrollBar().isVisible());
    System.err.println("Horizontal visible? " + pane.getHorizontalScrollBar().isVisible());

相关文章

JScrollPane类方法