< prev index next >

## src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java

Print this page

    rev 48358 : Work in progress for JDK-6303622
    Use generic in Swing components like JComboBox
    1. Added generic return type and parameter type for JComboBox.
    2. Modified JList related classes as well.

    @@ -815,18 +815,18 @@
                 } else if (prop.equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) {
                     fireContentsChanged(this, -1, -1);
                 }
             }

    -        public void setSelectedItem(Object filter) {
    +        public void setSelectedItem(FileFilter filter) {
                 if(filter != null) {
    -                getFileChooser().setFileFilter((FileFilter) filter);
    +                getFileChooser().setFileFilter(filter);
                     fireContentsChanged(this, -1, -1);
                 }
             }

    -        public Object getSelectedItem() {
    +        public FileFilter getSelectedItem() {
                 // Ensure that the current filter is in the list.
                 // NOTE: we shouldnt' have to do this, since JFileChooser adds
                 // the filter to the choosable filters list when the filter
                 // is set. Lets be paranoid just in case someone overrides
                 // setFileFilter in JFileChooser.

< prev index next >