Solved

How to popup a message?

Posted on 2004-03-24
3
305 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:Mayank S
ID: 10665835
import javax.swing.* or javax.swing.JOptionPane for that. The parameters are: parent-frame, message, title, type-of-message.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Glassfish admin console not working 1 56
How to configure empty element in XML Document parser? 15 44
Java class and jar 3 41
What is the use of Forwarding Class in java 1 34
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…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

763 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