I\'m creating a Java application that will do some processing then needs to display a message to give the user feedback.
However, it appears to be incredibly slow -
The reason for the delay it because Java is an interpreted language and it takes time to start a new JVM ( the interpreter )
Actually creating the frame takes less than a few ms ( about 70 ms in my machine ).
If this is going to be used within a Java app, you don't need to worry about it. It will be almost instantaneous ( you should use JDialog or JOptionPane for this )
If this is NOT going to be used inside a Java app, and 2 secs it too much ( and I think it is too much ) you should consider another tool for the job.
Here's how I measure the time in your code:
import javax.swing.JFrame;
public class Dialog {
public static void main( String[] args ) {
long start = System.currentTimeMillis();
JFrame frame = new JFrame( "DialogDemo" );
System.out.println( "Took: " + ( System.currentTimeMillis() - start ) );
}
}