answersLogoWhite

0

I am assuming you want a dialog to pop up.

1) Write a class that implements ActionListener. Implement actionPerformed(ActionEvent).

2) In the actionPerformed() method, put "JOptionPane.showConfirmDialog(<the JFrame or JDialog or component you are using to display the button>, <the title you want>, <the text you want>);"

3) Call the method addActionListener(<your ActionListener-implementing class here>); on the JButton.

4) Display the button

5) Click the button to your heart's content.

Did that answer your question?

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How do you display message in php?

There are various ways of doing it. Here are a few examples: printf("Hello world!"); echo "Hello world!"; print "Hello world!"; If you are looking to offer a pop-up message (a separate window with a button that the user must click to acknowledge), you would have to do it with Javascript instead.


I want to make a warning window and when you click the 'ok' button the internet browser must close How do i do that in HTML?

You use the input tag and the button and add a bit of Javascript. The following will create a simple button, that when clicked will pop up a message, using a bit of javascript. Copy and paste it or type it exactly as it is into your code and it will work. Replace the Hello with the message you want. Your message must be in single quotes, the alert must be in lower case and there must be double quotes outside it. &lt;FORM&gt; &lt;INPUT Type=Button value="Click Here" onClick="alert('Hello');"&gt; &lt;/FORM&gt;


Seed spitters in adventure quest?

go to town, say hello to twilly, click the "heard any rumours" button and click "hunt the seed spitter"


What is hello in Cree language?

&quot;Hello&quot; in Cree language is &quot;tansi&quot;.


What is hello in Tausug language?

&quot;Hello&quot; in Tausug language is &quot;Marayaw.&quot;


How do you say hello in swaziland?

It depends on which Swaziland language you are talking about. The following 5 languages are spoken in Swaziland:AfrikaansEnglishSwatiTsongaZulu


How do you say hello in kashmiri language?

In Kashmiri language, &quot;hello&quot; is said as &quot;salaam aleikum&quot;.


Direction on sakar hello kitty sms text messenger helpmy little girl is having a fit to use this thing?

1 Press the "ID" key and at the "Lock?" prompt, enter a four-digit password to set a protection lock on the Hello Kitty Text Messenger. 2 Press the "Chat" button on one Hello Kitty SMS Text Messenger. "Chat" will display on their screens. 3 Press the "Recv" button on the other Hello Kitty SMS Text Messenger so it can receive a message. 4 Type your message on the keypad of the messenger set to Chat mode. Press a key three times to cycle through the three different letters assigned to it. For example, pressing the "7" key will cycle through the letters "A" "B" and "C." 5 Press the "Send" button. "P/I?" will appear on the screen. Press the "ICQ Call" key to send the message to the other Hello Kitty SMS Text Messenger that is set to receive mode. 6 Press the "Enter" button to save the message. 7 Press the "Recv" button on your Hello Kitty SMS Text Messenger to receive messages from the other unit, whose "Chat" button the other person will press to send messages to you. 8 Press the "Send" button after typing in a text message, and when "P/I?" appear on the screen, press the "Private Call" key. "ID" will appear on the screen. Enter your friend's preset chat password ID number, then press the "Enter" button to sent the message privately. If you forget your password, you can press the "Reset" button to restart the Hello Kitty Text Messenger.


Hello in alien language?

Hello comes from Hell in alien language


How do you say Hello in Aymara language?

&quot;Hello&quot; in Aymara language is &quot;Janiw.&quot;


How do you say hello in tigrinya language?

&quot;Selam&quot; is hello in Tigrinya language.


What is hello in ifugao language?

The word &quot;hello&quot; in Ifugao language can be translated as &quot;Kumusta.&quot;