How to present a simple alert message in java?

后端 未结 5 466
无人及你
无人及你 2020-12-07 11:00

Coming from .NET i am so used calling Alert() in desktop apps. However in this java desktop app, I just want to alert a message saying \"thank you for using java\" I have to

5条回答
  •  醉话见心
    2020-12-07 11:24

    If you don't like "verbosity" you can always wrap your code in a short method:

    private void msgbox(String s){
       JOptionPane.showMessageDialog(null, s);
    }
    

    and the usage:

    msgbox("don't touch that!");
    

提交回复
热议问题