コード例 #1
0
    public Component getListCellRendererComponent(
        JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {

      super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
      setText(getFileChooser().getName((File) value));
      return this;
    }
コード例 #2
0
    public Component getListCellRendererComponent(
        JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {

      super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);

      if (value != null && value instanceof FileFilter) {
        setText(((FileFilter) value).getDescription());
      }

      return this;
    }