一个界面问题,快来拿分

lindianxuan 2003-05-16 06:36:34
一个JScrollPane+JList怎样实现JList一有新数据JScrollPane就自动滚到最后插进的那条数据
...全文
30 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zh_baiyu 2003-06-19
  • 打赏
  • 举报
回复
UP~
alexll 2003-06-19
  • 打赏
  • 举报
回复
setSelected应可以
XKP 2003-06-19
  • 打赏
  • 举报
回复
用这个吧

ensureIndexIsVisible

public void ensureIndexIsVisible(int index)


Scrolls the viewport to make the specified cell completely visible. Note, for this method to work, the JList must be displayed within a JViewport.

Parameters:

index - the index of the cell to make visible
stars_of_leo 2003-06-19
  • 打赏
  • 举报
回复
up
alemjann 2003-06-19
  • 打赏
  • 举报
回复
setSelectedIndex()
hlding 2003-06-19
  • 打赏
  • 举报
回复
应该用setSelectedValue或者是setSelectedIndex()
hlding 2003-06-19
  • 打赏
  • 举报
回复
使用setSelected设置或者是使用setIndex()

62,628

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧