Solved

How to popup a message?

Posted on 2004-03-24
3
311 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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
servlet example 11 74
jsp login check 12 62
SequenceInputStream example 3 35
dao vs facade design patterns 2 68
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This video teaches viewers about errors in exception handling.
Suggested Courses

737 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