Fastest way to create a Java message dialog (swing/awt/other)?

后端 未结 10 931
醉梦人生
醉梦人生 2021-01-17 12:41

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 -

10条回答
  •  深忆病人
    2021-01-17 12:57

    I would use a JOptionPane to show the message. Here's a simple example:

    import javax.swing.*;
    
    public class OptionDemo {
        public static void main(String[] args) throws Exception {
            JOptionPane.showMessageDialog(null, "Hello World");
        }
    }
    

    I'm afraid I can't explain the delay you're experiencing though. On my system, your code snippet runs in 500 milliseconds.

提交回复
热议问题