2008년 10월 30일 목요일

JList

 private JList getJList() {
  if (jList == null) {
   list = new Vector();
   
   File file = new File("./music/");
   String f_list[] = null;
   f_list = file.list();
   filesize = f_list.length;
   for(int i = 0; i< f_list.length ; i++)
    list.add(f_list[i]);
   
   jList = new JList(list);
    jList.setSelectedIndex(0);
    jList.setVisibleRowCount(15);
    jList.setFont(new Font("Dialog", Font.BOLD, 12));
    name = (String) list.get(0);
   jList.setBackground(new Color(255, 228, 248));
   this.jList.addListSelectionListener(this);
  }
  return jList;
 }

http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JList.html 

댓글 없음:

댓글 쓰기