定时自动滚动JScrollpane

时间:2018-07-10 18:51:33

标签: java jtable jscrollpane

我是新手,对JScrollPanes有疑问。 我创建了一个JSP,并用表填充了它,一切正常。但是,我想知道是否仍然有自动滚动到底部但又定时的方式(就像电影后的字幕一样)。

任何建议将不胜感激!

谢谢

编辑:

TableValue people = new TableValue();
    thA = new JScrollPane(people.pTable());//fills tables with people values

    thA.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    thA.setBounds(0, (int) (0 * height), (int) (0.333 * widthFull), (int) (0.97 * height));

    thA.setOpaque(false);
    thA.getViewport().setOpaque(false);
    thA.setBorder(javax.swing.BorderFactory.createEmptyBorder());
    thA.setViewportBorder(BorderFactory.createEmptyBorder());
    thA.setViewportBorder(null);

    rightPanel.add(thA);

    JScrollBar jsb = thA.getVerticalScrollBar();
    jsb.setOpaque(false);
    jsb.setPreferredSize(new Dimension((int) (0.035 * widthFull), (int) (height)));
    jsb.setBorder(javax.swing.BorderFactory.createEmptyBorder());
    jsb.setBorder(null);
    for (Component c : jsb.getComponents()) {
        jsb.remove(c);
    }

    jsb.setAutoscrolls(true);

0 个答案:

没有答案