Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

Java Tip 48: How to create a reusable MessageBox class

Display a message on your browser screen, with Java 1.1 or later

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone

Page 3 of 3

To avoid this deadlock catastrophe, either switch to a "better" language or use the advanced features of Java (which makes Java the better language). Simply show the modal dialog box in a new thread, and all is peaches and roses in Javaland. This is what we have done in the code above. This type of deadlock is common until one understands its cause and has a simple solution for preventing it.

Conclusion

The rest of MessageBox is self-explanatory. Study the MessageBox code and the MessageBoxTest application and have fun.

JavaWorld would like to pass on your Java Tip to the rest of the Java world. Write up your coolest tips and tricks now, and send them to javatips@javaworld.com. You may find yourself an author in JavaWorld with your helpful hints chosen as the next Java Tip!

About the author

Jack Harich, aka "Happy Jack," is a fun-loving Renaissance man who switched to software after his career as a sculptor came to a quick end due to a neck injury. He's currently a consultant in Atlanta (the Silicon Cotton Field of the South) and is very active with the Atlanta Java User's Group, it's Java As A Second Language SIG, and the Atlanta Java Consortium.
  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comments (1)
Login
Forgot your account info?

cvzxvzBy Anonymous on September 9, 2009, 12:58 pmvzxcvczx

Reply | Read entire comment

View all comments

Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources