myList.setHorizontalTextPosition(myList.getSelectedIndex());
应该可以了
应该可以了
解决方案 »
- 关于swt的应用 如果谁搞过一定是高人
- 请教session.setAttribute("admin","ghyghost");这样的代码在JAVA文件中可以写吗?
- 初学Swing,求教卡片布局
- 谁有汉字排序的解决方法。。。。
- 我试图想用actionPerformed(ActionEvent e) ,但是很不幸………… 高手请指点迷津
- 谁有象Windows里的画图那样的程序的原代码
- 关于super?
- 有关javamail的问题!!
- 使用RandomAccessFile()时,如何指定当前project下的readme.txt的路径?
- 请教如何用java虚拟机运行hello.class文件,谢谢。
- 如何在窗体中内嵌excel
- ----怎样关闭frame------
我忘了
手头也没有API
我肯定有的
上面有一些例子,看看吧,或许对你有用。
^_^
// Sets the background color for selected cells.
setSelectionForeground(Color selectionForeground)
//Sets the foreground color for selected cells. 呵呵 试试吧 ^_^
jlist..scrollRectToVisible(jlist.getCellBounds(jlist.getSelectedIndex()-1,getSelectedIndex()+1))
里面getCellBounds(jlist.getSelectedIndex()-1,getSelectedIndex()+1)是获得选中那一行之前到之后一行的范围,这样就可以显示了