showConfirmDialog « JOptionPane « Java Swing Q&A





1. Bug in JOptionPane.showConfirmDialog?    stackoverflow.com

I want to prompt the user for a confirmation when they want to close the frame window, like so:

addWindowListener(new WindowAdapter()
{
    public void windowClosing(WindowEvent e)
    {
 ...

2. JOptionPane.showConfirmDialog question    coderanch.com

Look at the following code. When run, expected behavior is when "Yes" is selected, 0 returned. when "No" is selected 1 is returned. I found it pretty odd that above is true when you use mouse. It is not true when you use the keys. After you see the confirmation dialog, hit tab to move focus to "No" and hit enter, ...

3. how to wrap large message of JOptionPane.showConfirmDialog in scrollbar ...    coderanch.com

Hi, I am using JOptionPane.showConfirmDialog(..) to display a message where sometimes the message is so big that it displays the dialog with buttons not visible properly to the user. In such cases the message should get wrapped and should appear in the scrollbar. Is there any way to wrap the message and display properly. Or Should we have to write out ...

6. [SOLVED] JOptionPane.ShowConfirmDialog() problem    java-forums.org

I've come across this code which I'm trying to understand and presumably it should show a series of popups (i.e. JOptionPane.ShowConfirmDialog(), JOptionPane.ShowInputDialog() etc), however nothing happens when I tinker with the radio buttons. Java Code: [b]OptionDialogFrame.java[/b] package homenetwork.bkr.training; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Date; import javax.swing.*; @SuppressWarnings("serial") public class OptionDialogFrame extends JFrame { public OptionDialogFrame() { setTitle("Option Dialog Test"); ...

8. Problem With JOptionPane.showConfirmDialog    forums.oracle.com

thanks mr Michael_Dunn it worked but i have a little bug here that when the user presses the no option the confirmation message appear again to ask him and when i press no again the focus return to frame i want the confirmation message not to appear again when the user presses the no option.

9. JOptionPane.showConfirmDialog()+grab focus    forums.oracle.com

It will be hard because a confirm dialog does not contain a JTextField. In the future, Swing related questions should be posted in the Swing forum. If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour. Don't forget to use the Code Formatting Tags so the ...





10. JOptionPane.showConfirmDialog()    forums.oracle.com

Please fix the code tag at the bottom of your post. yes i got it.But one problem is still here when i click on Cancel button then code is hang.. I suppose a lot depends on what code is supposed to be run after your method returns when cancel is pressed. I can't help you on this one without compilable code. ...