Changeset 32673 for main

Show
Ignore:
Timestamp:
12.12.2018 19:38:38 (7 months ago)
Author:
ak19
Message:

Experimental. Attempt to fix the Event Dispatch Thread GUI exceptions we often see when using GLI. To reverse this, a few lines in GathererProg?.java creating and showing the Gatherer object inside a run() call in invokeLater() need to be returned to happening outside those 2 methods.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/GathererProg.java

    r14974 r32673  
    3131import javax.swing.*; 
    3232import org.greenstone.gatherer.util.Utility; 
    33  
    3433 
    3534/** 
     
    7473    // We have a local GLI 
    7574    Gatherer.setGLIDirectoryPath(System.getProperty("user.dir") + File.separator); 
     75     
    7676 
    77     // Create an instance of the Gatherer class, which will parse the args and prepare the rest of the GLI 
    78     Gatherer gatherer = new Gatherer(args); 
    79  
    80     // Display the GUI immediately 
    81     gatherer.openGUI(); 
     77    // TESTING circumventing the old GUI event dispatch thread exceptions in GLI. Follows 
     78    // https://docs.oracle.com/javase/6/docs/api/javax/swing/package-summary.html#threading 
     79    // referred from Event Dispatch Thread page at https://joel-costigliola.github.io/assertj/assertj-swing-edt.html 
     80     
     81    // Schedule a job for the event-dispatching thread: 
     82        // creating and showing this application's GUI. 
     83        SwingUtilities.invokeLater(new Runnable() { 
     84            public void run() { 
     85        // These lines used to be done immediate after setGLIDirectoryPath() call above 
     86        // but are now inside an invokeLater(). 
     87         
     88        // Create an instance of the Gatherer class, which will parse the args and prepare the rest of the GLI 
     89        Gatherer gatherer = new Gatherer(args); 
     90         
     91        // Display the GUI immediately 
     92        gatherer.openGUI(); 
     93            } 
     94        }); 
    8295    } 
    8396}