Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Java Message Box

Have Programming Question? Ask it here!
 
 
 


Pushpa Sheela
Java Message Box
2 Answer(s)      3 years and 7 months ago
Posted in : Java Beginners


I want to display the variable value in message box. For example

var s="Welcome to Java";
JOptionPane.showMessageDialog(this,s);

But the message box display nothing. Is there any way to display the value of s in message box.

Please help me as soon as possible.

Advertisement
View Answers

September 28, 2010 at 10:30 AM


Hi Friend,

Try the following code:

import javax.swing.*;
class Message
{
public static void main(String[] args)
{
String st="Welcome";
JOptionPane.showMessageDialog(null,st);
}
}

Hope that it will be helpful for you.
Thanks


September 28, 2010 at 12:14 PM


Thankyou. Its working.


Related Tutorials/Questions & Answers:
Java Message Box - Java Beginners
Java Message Box  I want to display the variable value in message box...); But the message box display nothing. Is there any way to display the value of s in message box. Please help me as soon as possible.  Hi
Message Box Java
In this section we will create a message box in Java using a Java API class... Box"); } } } Resource: Java Message Box Show Dialog Box in Java - Swing Dialogs Show Message and Confirm Dialog Box
Advertisements
confirm message box - Java Beginners
confirm message box  How can I create a confirm message with Yes and No button instead of OK/Cancel buttons in java script inside a jsp?   ... Title', 'My Confirm Message', 2,0,0) if (retVal==true) return true; else
Java Message Box
Java Message Box In this tutorials you will learn about how to create Message Box in Java. Java API provide a class to create a message Box in java. By message box we mean a box in which message is displayed or a box from which input
message box
message box  How to show the message "invalid username and password" after redirecting the page to the login form
input ang message box - Java Beginners
Boxes. Show the result with Message Dialog Boxes. Set the Message Dialog Box Type to Information Message.  Hi Friend, Try the following code: import...input ang message box  can you help me to calculates for the sum
Changing the message box to a specific color
Changing the message box to a specific color  How do you change the message box color to a specific color? I can get the color to change with each... the message box to red but its not really working. Can you help me
Show message and confirm dialog box
Show Message and Confirm Dialog Box - Swing Dialogs... types of message box. There are three types of message dialog box that you can.... Once you click on the first button then the simple message box will open which
Java Alert Box
Java Alert Box In this example we will describe java alert box. First of all... JOptionPane class to display the message alert box.  JOptionPane class is available... JOptionPane to show message and we can use any java application. JOptionPane
how to add save,discard,& cancel button in a message box - Struts
how to add save,discard,& cancel button in a message box  how to add save,discard,& cancel button in a message box
Java Message Services - JMS
Java Message Services  What is Java Message Services
how do you change the message box to a specific color
how do you change the message box to a specific color  How do you change the message box color to a specific color? I can get the color to change... the message box to red but its not really working. Can you help me
Show Dialog Box in Java
Show Dialog Box in Java - Swing Dialogs       Message dialog box is used to display informative... the message Dialog box. Our program display "Click Me" button on the window
pop up message in java
an automatic message to change the password.how is it done??the forms are done using java...pop up message in java  hii..i have developed an application in which a login and registration form is there.when the registration is done the user
error message - Java Beginners
(print my name)I get error message like" javac is not recognized as internal...;Hi friend, To compile and run a java program we need to install java platform. JDK (Java Development Kit). JDK is the basic set of tools required to compile
Popup dialog box in java
Popup dialog box in java  How to display popup dialog box in java... can create popup dialog box. Java swing toolkit provide tow types of dialog box... dialogs-user can customize dialog box. Here is a simple popup message dialog box
Java message services
; Java Message Services In this section, you will read about the java... and offers the basics for developing programs using it. The java message services API is a java Message oriented Middleware API for sending successfully the messages
Java Message Services
Java Message Services       In this section, you will read about the java messages Services (JMS... for developing programs using it. The java message services API is a java Message oriented
java program to exchange soap message
java program to exchange soap message  Hi Friends, I want to developed a webservice using soap as a protocol,in this webservice the client sends... that how can I write the server side program in order to receive the message
to retrieve message body - Java Beginners
to retrieve message body  hi, Using dbfile system to store message using mysql. dbfile system is to store headers in database and message body in file system . i retrieved message contents like from :, to :, delivered
retrieve message contents - Java Beginners
retrieve message contents   hi , dbfile system to store message headsers in mysql database and message contents in file system . how to retrieve message contents. thanks bala..   Hi friend, Content
java script text box
java script text box  hi, I created a button when i click... in alert). i also want the text box should generate in front of NEW button(next/prev) and after it submits it should show before the NEW line.dont add again two box
java combo box
java combo box  how to display messagedialogbox when the combobox is null, Thanks in advance
Login Box - Java Beginners
Login Box   Hi, I am new to Java and I am in the process of developing a small application which needs a login page. I am planning to have my database... it with the corresponding password tosee if the login details match.I've
Java Message Service(JMS)
Java Message Service(JMS)       JMS (Java Message Service) is a Java API that allows java... will get the message and producer knows the consumer of the message. publish
Java error dialog
; A Java dialog box is an independent sub window  that is used to notice a temporary message to the user. The dialog box find its extensive... box show an error box that gives an error message or  warning message.To
Sending and receiving xml message using Java Program
Sending and receiving xml message using Java Program  Hi Friends, I want to send and receive xml files between two java programs using wire format, could you suggest me the steps to be followed to acheive it or suggest some
Sending and receiving xml message using Java Program
Sending and receiving xml message using Java Program  Hi Friends, I want to send and receive xml files between two java programs using wire format, could you suggest me the steps to be followed to acheive it or suggest some
Scrolling List Box. - Java Beginners
Scrolling List Box.  How can is make a list box scrollable by using method ? Please give me the code snipetts
Scrolling List Box. - Java Beginners
Scrolling List Box.  How can is make a list box scrollable by using method ? Please give me the code snipetts
receive message from mobile to java program
receive message from mobile to java program  i got a code to receive message....but wen i receive it its showing a string which is not readable... if possible please edit dis code to retreive the origianl string message.... here
message interruption - Java Server Faces Questions
message interruption  hello I am dealing with jsf. when I... this message: "The page you are trying to view contains POSTDATA if you resend... not interrupted by this dialog message. how can make it vanish this message
Session timeout message need to be displayed - Java Beginners
Session timeout message need to be displayed  Hi, I want to display a session timeout on website. i want to find session - remaining time set in web.xml. Thanks Manu
Scrolling List Box. - Java Beginners
Scrolling List Box.  How can is make a list box scrollable by using method ? Please give me the code snipetts.  Hi friend, import... for more information. http://www.roseindia.net/java/ Thanks
jsp list box - Java Beginners
jsp list box  I have two list boxs. the values for the first list box is retrieved from the mysql database. I want to fill the second list box selected item from the database. Please help me in this regard. Your help
Option Box Value - Java Beginners
Option Box Value  Hi Friends, I have one option box which is division, division have dynamically data,if user select any division then his option box is populated (work schedule,Peronal Area,personal sub area,business
Jdialog box with textfield - Java Beginners
Jdialog box with textfield  i have to create a dialog box with 2 textFields(to take input from user) and 2 JLabels. how to do that please tell.thanks  Hi Friend, Try the following code: import javax.swing.
Flex Alert Box example
Flex Alert Box example       Alert box is a dialog box that appears on window with some message and stays rigid until the event associated with it is not done. Alert
Sending message using Java Mail
Sending message using Java Mail        This Example shows you how to send a message using javamail api. A client create new message by using Message subclass
AutoSuggestion Box in Java Swing
Auto Suggestion Box in Java Swing In this section, you will learn how to create autosuggestion/autocomplete box in java swing. For this, we have created combo box and add array of countries using DefaultComboBoxModel to it. Now
Creating Check Box in Java Swing
Creating Check Box in Java Swing       This section illustrates you how to create a Check Box component in Java Swing. In this section, you can learn simply creating the Check Box
How to Display an alert message when nothing is selected in jspinner in java?
How to Display an alert message when nothing is selected in jspinner in java?  Hello, i'm trying to code a jspinner in java and i want to display a message when nothing is selected. My initial value is 0 min value = 0 max value
JList box java
JList box java We are going to describe JList box java. First of all we have... the JComponent class in Swing. We can use select item from the combo box because...", "List3" }; JFrame frame = new JFrame("Creating a JList box"); JPanel panel
Read attachment message using Java Mail
Read attachment message using Java Mail   ... a Attachment message using javamail api. Java Mail API provides classes to send multiple Mime body part with one Mime Message. MulipltMimeBody parts can be text, file
find the volume of the box - Java Interview Questions
find the volume of the box  Write a class Box with the variable width... and a method to find the volume of the box and also write the main program, which creates the box object, and find the volume of the box. Print the result
dropdown box in jsf - Java Server Faces Questions
dropdown box in jsf  Hi friends, 1.how to create dropdown boxes in jsf. 2.if the dropdown box contains id values like 1,2,3,4..........,if i click... for above queries. And one more how to create morethan one dropdown box in one jsf
List the names of classes used to create button and text box in Java.
List the names of classes used to create button and text box in Java.  List the names of classes used to create button and text box in Java
dropdown box in jsf - Java Server Faces Questions
dropdown box in jsf  Hi friends, AssigningJob    ... box
Change background color of text box - Java Beginners
Change background color of text box  Hi how can i change the background color to red of Javascript text box when ever user enters an incorrect value while on entering a correct value its background color should change green
action for dropdown box - Java Server Faces Questions
for populating a list box from a drop-down selection? What I want to do is give... a selection from the drop-down list, the list box beside it gets populated... from my table. When the user selects one catagory, the list box gets populated
 

 

 

DMCA.com