Solved

How to popup a message?

Posted on 2004-03-24
3
273 Views
Last Modified: 2010-03-31
In my Java-Program I want to pop up a message dialog or message box such as:

...
...
if(error)
  pop-up error message;

...
...

Is there any easy way to do that?
0
Comment
Question by:chenwei
  • 2
3 Comments
 
LVL 9

Expert Comment

by:mmuruganandam
ID: 10665756
JOptionPane.showMessageDialog(this, "message", "Error occured", JOptionPane.WARNING_MESSAGE);

JOptionPane.showMessageDialog(this, "message", "Error occured", JOptionPane.ERROR_MESSAGE);

and so on....



0
 
LVL 9

Accepted Solution

by:
mmuruganandam earned 20 total points
ID: 10665759
JOptionPane.showMessageDialog(this, "message", "Error occured", JOptionPane.WARNING_MESSAGE);

JOptionPane.showMessageDialog(this, "message", "Error occured", JOptionPane.ERROR_MESSAGE);

and so on...
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 10665835
import javax.swing.* or javax.swing.JOptionPane for that. The parameters are: parent-frame, message, title, type-of-message.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now