myList.setHorizontalTextPosition(myList.getSelectedIndex());
应该可以了

解决方案 »

  1.   

    查查API,肯定有一个方法可以滚动到当前项目的
    我忘了 
    手头也没有API
    我肯定有的
      

  2.   

    晕,JList控件没有setHorizontalTextPosition方法呀。神啊,帮帮我吧!
      

  3.   

    http://www.senun.com/Left/Programming/Java_old/Examples_swing/SwingExamples.html
    上面有一些例子,看看吧,或许对你有用。
    ^_^
      

  4.   

    用 setsetSelectionBackground(Color selectionBackground)    
    // Sets the background color for selected cells.  
    setSelectionForeground(Color selectionForeground)           
    //Sets the foreground color for selected cells. 呵呵 试试吧 ^_^
      

  5.   

    对不起,前面的帖子写错了,应该是
    jlist..scrollRectToVisible(jlist.getCellBounds(jlist.getSelectedIndex()-1,getSelectedIndex()+1))
    里面getCellBounds(jlist.getSelectedIndex()-1,getSelectedIndex()+1)是获得选中那一行之前到之后一行的范围,这样就可以显示了