Just recently I went back to a project I had not worked on in a while. The first time I ran it during this new programming session, it took over three minutes to load. I have no idea what could have changed between now and the last time I worked on it (about three months ago) but I know the code had not changed.
I tracked the problem down to the JFrame constructor. I found this post:
However it does seem relevant as his problem only took a few hundred milliseconds. I did use his code for a simple test and my output was as follows:
202720 for first JFrame. 0 for second JFrame.
I am using jdk-7u7-windows-x64. I have absolutely no idea what could be causing this so any assistance would be appreciated.
Thank you.
EDIT Here is the code that I copied from the linked post:
import javax.swing.*;
public class Main {
public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
long start;
start = System.currentTimeMillis();
JFrame frame1 = new JFrame("Frame1");
System.out.println((System.currentTimeMillis() - start) + " for first JFrame.");
start = System.currentTimeMillis();
JFrame frame2 = new JFrame("Frame2");
System.out.println((System.currentTimeMillis() - start) + " for second JFrame.");
frame1.setVisible(true);
frame2.setVisible(true);
}
});
}
}
EDIT I have done all of the usual guess work
+ Restarted Eclipse + Restarted Windows + Re-installed Java + Exported to a Jar (same result)