I've been banging my head against a wall for almost 3 hours now, trying to get a progress monitor to open up while I load a big file. Here is my code:
public static void main(String[] args) { AttTest testit = new AttTest(); testit.runAttTest(); } public void runAttTest() { String fname = "C:/test.model"; Vector<Object> test = new Vector<Object>(); try { ObjectInputStream input = new ObjectInputStream (new ProgressMonitorInputStream(null, "Loading", new FileInputStream(fname))); while (true) { test.add(input.readObject()); } input.close(); } catch (Exception ex) { System.err.println("Deserialization failed: " + ex.getMessage()); ex.printStackTrace(); } }
The file is big - takes over 5 minutes to load. It loads fine, but the progress monitor never pops up. Can anyone tell me what I'm doing wrong here? Thanks for the help!
Best regards,
Michael


LinkBack URL
About LinkBacks
Reply With Quote