JS-style alert box in java
An basic way to accomplish such a popup is to use JOptionPane.showMessageDialog, see here.
JOptionPane.showMessageDialog(frame, "here comes the text."); // assumes frame to be a reference to the desired parent frame
Think you are looking for JOptionPanes but here is a good description of the different dialogs: http://docs.oracle.com/javase/tutorial/uiswing/components/dialog.html
How to create a dialog box in Java:
- How to Make Dialogs (The Java Tutorials)
- Java - How to create a custom dialog box? (stackoverflow answer)