#34 call onResize() when window size is changed
[fanfix.git] / src / jexer / TDirectoryList.java
index 642366b7e23c42f11bf1baedacb8363c15fa1e00..c47b33054e95e8c200a24ee8c80f307ef11a86fe 100644 (file)
@@ -35,7 +35,7 @@ import java.util.List;
 /**
  * TDirectoryList shows the files within a directory.
  */
-public final class TDirectoryList extends TList {
+public class TDirectoryList extends TList {
 
     /**
      * Files in the directory.
@@ -73,6 +73,11 @@ public final class TDirectoryList extends TList {
             }
         }
         setList(newStrings);
+
+        // Select the first entry
+        if (getMaxSelectedIndex() >= 0) {
+            setSelectedIndex(0);
+        }
     }
 
     /**