Solved

How to popup a message?

Posted on 2004-03-24
3
282 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Android studio getdrawable(int) is deprecated 4 36
Free Alternative to JIRA 4 91
advertisement module in core php 4 144
Java array passed to SQL where clause 23 62
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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 will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

914 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

19 Experts available now in Live!

Get 1:1 Help Now