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

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

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

JScrollPane.scrollRectToVisible介绍

暂无

代码示例

代码示例来源:origin: triplea-game/triplea

void layoutNotes() {
  if (gameNotesPane == null) {
   return;
  }
  removeAll();
  final JScrollPane scroll = new JScrollPane(gameNotesPane);
  scroll.scrollRectToVisible(new Rectangle(0, 0, 0, 0));
  add(scroll);
 }
}

代码示例来源:origin: otros-systems/otroslogviewer

@Override
public void focusGained(final FocusEvent e) {
 highlightSuggestion(suggestionComponent);
 SwingUtilities.invokeLater(() -> {
  final Component component = e.getComponent();
  suggestionScrollPane.scrollRectToVisible(component.getBounds());
 });
}

代码示例来源:origin: otros-systems/otroslogviewer

private void highlightSuggestion(JComponent suggestion) {
 for (JComponent toClearHighlight : suggestionComponents) {
  removeHighlightSuggestion(toClearHighlight);
 }
 suggestion.setBorder(BorderFactory.createLineBorder(suggestion.getForeground()));
 suggestionScrollPane.scrollRectToVisible(suggestion.getBounds());
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

public ErrorPanel(ISession session, ErrorPanelListener errorPanelListener, ArrayList<String> sqlExecErrorMsgs, String lastExecutedStatement)
{
 super(new BorderLayout());
 _errorPanelListener = errorPanelListener;
 _txtArea = new JTextArea();
 _txtArea.setFont(_txtArea.getFont().deriveFont(Font.BOLD));
 _txtArea.setForeground(Color.red);
 _txtArea.setSelectedTextColor(Color.red);
 _txtArea.setEditable(false);
 for (int i = 0; i < sqlExecErrorMsgs.size(); i++)
 {
   _txtArea.append(sqlExecErrorMsgs.get(i));
   if(i < sqlExecErrorMsgs.size() - 1)
   {
    _txtArea.append("\n\n");
   }
 }
 JScrollPane scrp = new JScrollPane(_txtArea);
 add(createNorthPanel(session, sqlExecErrorMsgs, lastExecutedStatement), BorderLayout.NORTH);
 add(scrp, BorderLayout.CENTER);
 initPopup();
 scrp.scrollRectToVisible(new Rectangle(0,0,1,1));
}

代码示例来源:origin: realXuJiang/bigtable-sql

public ErrorPanel(ISession session, ErrorPanelListener errorPanelListener, ArrayList<String> sqlExecErrorMsgs, String lastExecutedStatement)
{
 super(new BorderLayout());
 _errorPanelListener = errorPanelListener;
 _txtArea = new JTextArea();
 _txtArea.setFont(_txtArea.getFont().deriveFont(Font.BOLD));
 _txtArea.setForeground(Color.red);
 _txtArea.setSelectedTextColor(Color.red);
 _txtArea.setEditable(false);
 for (int i = 0; i < sqlExecErrorMsgs.size(); i++)
 {
   _txtArea.append(sqlExecErrorMsgs.get(i));
   if(i < sqlExecErrorMsgs.size() - 1)
   {
    _txtArea.append("\n\n");
   }
 }
 JScrollPane scrp = new JScrollPane(_txtArea);
 add(createNorthPanel(session, sqlExecErrorMsgs, lastExecutedStatement), BorderLayout.NORTH);
 add(scrp, BorderLayout.CENTER);
 initPopup();
 scrp.scrollRectToVisible(new Rectangle(0,0,1,1));
}

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

bar.setValue(bar.getValue() - blockIncr);
scrollPane.scrollRectToVisible(rect);

代码示例来源:origin: triplea-game/triplea

add(SwingAction.of(gameNotesTitle, e -> SwingUtilities.invokeLater(() -> {
 final JScrollPane scroll = new JScrollPane(gameNotesPane);
 scroll.scrollRectToVisible(new Rectangle(0, 0, 0, 0));
 final JDialog dialog = new JDialog((JFrame) null, gameNotesTitle);
 dialog.add(scroll, BorderLayout.CENTER);

代码示例来源:origin: RPTools/maptool

imageSelected = imageModel.size() - 1;
((JScrollPane) formPanel.getComponentByName("tokenBarImagesScroll")).scrollRectToVisible(imageList.getCellBounds(imageSelected, imageSelected));
AppPreferences.setLoadDir(imageFile.getParentFile());
changedUpdate(null);

代码示例来源:origin: net.sf.mmax2/mmax2

attributepanel.getScrollPane().scrollRectToVisible(attributepanel.getLastAttribute().getVisibleRect());
attributepanel.invalidate();
attributepanel.repaint();

相关文章

JScrollPane类方法