How to present a simple alert message in java?

后端 未结 5 470
无人及你
无人及你 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:30

    Even without importing swing, you can get the call in one, all be it long, string. Otherwise just use the swing import and simple call:

    JOptionPane.showMessageDialog(null, "Thank you for using Java", "Yay, java", JOptionPane.PLAIN_MESSAGE);
    

    Easy enough.

提交回复
热议问题