+ 1

Can java alert?

Can java give alerts like Javascript? It would be useful!

20th Jul 2025, 9:12 PM
Pou10mine
Pou10mine - avatar
2 Respuestas
0
Yes, that would be GUI. Hence, u would commonly create an alert box using a GUI library, like JavaFX. https://www.tutorialspoint.com/javafx/javafx_alert.htm
20th Jul 2025, 9:20 PM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
0
if you are using desktop console you can do: import javax.swing.JOptionPane; // public class Out { public static void alert( String message) { JOptionPane.showMessageDialog( null, message, "",JOptionPane.INFORMATION_MESSAGE); } } public class AlertTest { public static void main(String[] args) { Out.alert( "alert test"); } }
21st Jul 2025, 2:50 PM
zemiak