Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Friday, May 24, 2013

How to Display a JavaScript-like Alert in Java

Just put the following in your Java code:

javax.swing.JOptionPane.showMessageDialog(null, "Your message here");

Note:
Similar to JavaScript, your code will pause executing until you close the message dialog. So be careful when deploying your code for the client.

Saturday, October 8, 2011

Refresh Web Page in JavaScript

Here's a very simple code:

window.location.reload(true);

So simple that you might not even care & easily forget about its syntax... that's why it's here. :)