private void updateRecentItems ( ) { if ( menuRecent == null ) return ; menuRecent . removeAll ( ) ; List < String > recentFiles = BoofSwingUtil . getListOfRecentFiles ( this ) ; for ( String filePath : recentFiles ) { final File f = new File ( filePath ) ; JMenuItem recentItem = new JMenuItem ( f . getName ( ) ) ; recentItem . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent e ) { openFile ( f ) ; } } ) ; menuRecent . add ( recentItem ) ; } }
Updates the list in recent menu