+ 1
Can java alert?
Can java give alerts like Javascript? It would be useful!
2 Respostas
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
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");
}
}