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

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

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

JScrollPane.setAutoscrolls介绍

暂无

代码示例

代码示例来源:origin: alibaba/druid

scrollPane.setAutoscrolls(true);
scrollPane.setBorder((TitledBorder) BorderFactory.createTitledBorder("数据区"));

代码示例来源:origin: apache/geode

int preferredHeight = (int) (Toolkit.getDefaultToolkit().getScreenSize().getHeight() - 100);
scroller.setPreferredSize(new Dimension(preferredWidth, preferredHeight));
scroller.setAutoscrolls(true);

代码示例来源:origin: com.alibaba/druid

scrollPane.setAutoscrolls(true);
scrollPane.setBorder((TitledBorder) BorderFactory.createTitledBorder("数据区"));

代码示例来源:origin: Refinitiv/Elektron-SDK

NewsStoryViewer(Font font)
{
  _story = new JTextArea(30, 80);
  _story.setFont(font);
  _scrollStory = new JScrollPane(_story);
  _scrollStory.setAutoscrolls(true);
}

代码示例来源:origin: Refinitiv/Elektron-SDK

NewsStoryViewer()
{
  Font font = new Font("Arial Unicode MS", Font.PLAIN, 12);
  _story = new JTextArea(30, 80);
  _story.setFont(font);
  _scrollStory = new JScrollPane(_story);
  _scrollStory.setAutoscrolls(true);
}

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

JTextArea txtArea = new JTextArea(40,100);
       txtArea.setAutoscrolls(true);
       txtArea.setBorder(BorderFactory.createLineBorder(Color.BLACK));
       txtArea.setFont(new Font("courier new", Font.PLAIN, 12));
       txtArea.setLineWrap(true);
       txtArea.setText(j);
       JScrollPane txtAreaScroll = new JScrollPane (txtArea, 
       JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
       txtAreaScroll.setViewportView(txtArea);
       txtAreaScroll.setAutoscrolls(true);
       // now add scroll pane in frame

代码示例来源:origin: MegaMek/megamek

private JPanel addGroup(IOptionGroup group) {
  JPanel groupPanel = new JPanel();
  JScrollPane scrOptions = new JScrollPane(groupPanel);
  groupPanel.setLayout(new BoxLayout(groupPanel, BoxLayout.Y_AXIS));
  scrOptions.setAutoscrolls(true);
  scrOptions.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
  scrOptions.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  panOptions.addTab(group.getDisplayableName(), scrOptions);
  return groupPanel;
}

代码示例来源:origin: GrammarViz2/grammarviz2_src

/**
 * Build the logging panel.
 */
private void buildLogPane() {
 // logging panel
 logTextArea.setFont(new Font("MonoSpaced", Font.PLAIN, 10));
 logTextArea.setEditable(false);
 logTextArea.setCaretPosition(logTextArea.getDocument().getLength());
 logTextPane.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
 logTextPane.setAutoscrolls(true);
 log(Level.INFO, "running GrammarViz 3.0 demo");
}

代码示例来源:origin: robward-scisys/sldeditor

/** Instantiates a new legend panel. */
public LegendPanel() {
  setLayout(new BorderLayout(0, 0));
  scrollPane = new JScrollPane(legendImagePanel);
  scrollPane.setAutoscrolls(true);
  scrollPane.setPreferredSize(new Dimension(SCROLL_PANE_WIDTH, SCROLL_PANE_HEIGHT));
  add(scrollPane, BorderLayout.CENTER);
}

代码示例来源:origin: Refinitiv/Elektron-SDK

public NewsHeadlineViewer(NewsStoryViewer storyViewer, Font font, NewsHandler MPHandler)
{
  _filterSelector = new NewsFilterSelector(this);
  _headlinesList = new Vector<Headline>();
  _headlineModel = new DefaultListModel<Headline>();
  _headlines = new JList<Headline>(_headlineModel);
  _headlines.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  _headlines.setFont(font);
  _headlines.setFixedCellWidth(700);
  _headlines.addMouseListener(new NewsHeadlineListener(storyViewer, MPHandler));
  _scroll = new JScrollPane(_headlines);
  _scroll.setAutoscrolls(true);
}

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

scrollPane.setAutoscrolls(true);
scrollPane.setPreferredSize(new Dimension(300, 400)); //========== this was missed

代码示例来源:origin: org.fudaa.framework.fudaa/fudaa-common

public FudaaReportFille(final BuCommonImplementation _app, FudaaReportFrameController _controller) {
 super(_app, FudaaLib.getS("Rapport"), _controller.grid_);
 controller_ = _controller;
 ScrollPaneSelector.installScrollPaneSelector(super.scrollPane_);
 super.scrollPane_.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
 super.scrollPane_.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
 super.scrollPane_.setAutoscrolls(true);
 controller_.grid_.setPane(scrollPane_);
}

代码示例来源:origin: robo-code/robocode

/**
 * Return the robotButtonsScrollPane
 *
 * @return JScrollPane
 */
private JScrollPane getRobotButtonsScrollPane() {
  if (robotButtonsScrollPane == null) {
    robotButtonsScrollPane = new JScrollPane();
    robotButtonsScrollPane.setAutoscrolls(false);
    robotButtonsScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    robotButtonsScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    robotButtonsScrollPane.setAlignmentY(Component.TOP_ALIGNMENT);
    robotButtonsScrollPane.setMaximumSize(new Dimension(113, 32767));
    robotButtonsScrollPane.setPreferredSize(new Dimension(113, 28));
    robotButtonsScrollPane.setAlignmentX(Component.CENTER_ALIGNMENT);
    robotButtonsScrollPane.setMinimumSize(new Dimension(113, 53));
    robotButtonsScrollPane.setViewportView(getRobotButtonsPanel());
  }
  return robotButtonsScrollPane;
}

代码示例来源:origin: GourdErwa/MyNote

private void initComponent() {
  JTextPane helpContentTextPane = new JTextPane();
  helpContentTextPane.setEditable(false);
  helpContentTextPane.setContentType("text/html;charset=utf-8");
  try {
    helpContentTextPane.setText(FileUtil.readFileToString(Config.HELP_FILE_PATH));
  } catch (IOException e) {
    e.printStackTrace();
  }
  JScrollPane scrollPane = new JScrollPane(helpContentTextPane);
  scrollPane.setAutoscrolls(true);
  Container c = this.getContentPane();
  c.add(scrollPane, BorderLayout.CENTER);
  this.setTitle("Help");
  this.setIconImage(new ImageIcon(Config.LOGO_IMG).getImage());
  this.setSize(Config.HELP_DIALOG_WIDTH, Config.HELP_DIALOG_HEIGHT);
  this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
}

代码示例来源:origin: robward-scisys/sldeditor

/**
 * Creates the UI.
 *
 * @param noOfRows the no of rows
 */
private void createUI(int noOfRows) {
  setLayout(new BorderLayout());
  int xPos = 0;
  int width = BasePanel.FIELD_PANEL_WIDTH - xPos - 20;
  int height = BasePanel.WIDGET_HEIGHT * (noOfRows - 1);
  this.setBounds(0, 0, width, height);
  textField = new JTextArea();
  textField.setBounds(xPos, BasePanel.WIDGET_HEIGHT, width, height);
  Font font = textField.getFont();
  // Create a new, smaller font from the current font
  Font updatedFont = new Font(font.getFontName(), font.getStyle(), FONT_SIZE);
  // Set the new font in the editing area
  textField.setFont(updatedFont);
  textField.setEditable(true);
  // Wrap the text field with a scroll pane
  JScrollPane scroll = new JScrollPane(textField);
  scroll.setAutoscrolls(true);
  add(scroll, BorderLayout.CENTER);
}

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

scroll.setAutoscrolls(true);

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

contentScrollPane.setAutoscrolls(false);

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

public static void showAlignmentPanel(AFPChain afpChain, Atom[] ca1, Atom[] ca2, AbstractAlignmentJmol jmol) throws StructureException {
  AligPanel me = new AligPanel();
  me.setAlignmentJmol(jmol);
  me.setAFPChain(afpChain);
  me.setCa1(ca1);
  me.setCa2(ca2);
  JFrame frame = new JFrame();
  frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  frame.setTitle(afpChain.getName1() + " vs. " + afpChain.getName2() + " | " + afpChain.getAlgorithmName() + " V. " + afpChain.getVersion());
  me.setPreferredSize(new Dimension(me.getCoordManager().getPreferredWidth() , me.getCoordManager().getPreferredHeight()));
  JMenuBar menu = MenuCreator.getAlignmentPanelMenu(frame,me,afpChain,null);
  frame.setJMenuBar(menu);
  JScrollPane scroll = new JScrollPane(me);
  scroll.setAutoscrolls(true);
  StatusDisplay status = new StatusDisplay();
  status.setAfpChain(afpChain);
  status.setCa1(ca1);
  status.setCa2(ca2);
  me.addAlignmentPositionListener(status);
  Box vBox = Box.createVerticalBox();
  vBox.add(scroll);
  vBox.add(status);
  frame.getContentPane().add(vBox);
  frame.pack();
  frame.setVisible(true);
  // make sure they get cleaned up correctly:
  frame.addWindowListener(me);
  frame.addWindowListener(status);
}

代码示例来源:origin: raydac/netbeans-mmd-plugin

this.scrollPane.setAutoscrolls(true);

代码示例来源:origin: bcdev/beam

@Override
protected void initUI() {
  setDefaultLabelComponent(true);
  _list = new JList();
  nameEditorComponent(_list);
  _listScrollPane = new JScrollPane(_list);
  nameComponent(_listScrollPane, "ScrollPane");
  // Configure scroll pane
  //
  _listScrollPane.setAutoscrolls(true);
  _listScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  _listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
  // Configure list box
  //
  if (getParameter().getProperties().getDescription() != null) {
    _list.setToolTipText(getParameter().getProperties().getDescription());
  }
  _list.setListData(getParameter().getProperties().getValueSet());
  _list.setEnabled(!getParameter().getProperties().isReadOnly());
  _list.setVisibleRowCount(6); /* really 6? */
  _list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  setSelectedIndices(getParameter());
  _list.addListSelectionListener(createListSelectionListener());
  _list.addFocusListener(createListFocusListener());
}

相关文章

JScrollPane类方法