The joptionpane showinputdialog example cancel
I have a question in regards to pressing the cancel button of my inputDialoguebox. I have asked a similar question before so I apologize if I seem to repeat myself.
Using idonayojujid.web.fc2.computDialog | Payroll | Areas Of Computer Science
The main problem I have is that my code executes regardless of me pressing cancel and a socket connection does get made even if I don't add any input. So with the code being the way it is at the moment the clientsocket connection is made even if I do press cancel.
Is the reason for this perhaps because I have the Server and Client as two seperate programs on the same machine? How can I avoid this from happening?
java - JOptionPane cancel button - Stack Overflow
When you click on the Cancel Button of the showInputDialog So you can add this condition like this:. By posting your answer, you agree to the privacy policy and terms of service. By subscribing, you agree to the privacy policy and terms of service.
Stack Overflow Questions Developer Jobs Documentation beta Tags Users. Sign up or log in to customize your list.
Practical On JOptionPane : ShowMessageDialogTour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us. Log In Sign Up. Join the Stack Overflow Community.
java - Clicking the cancel button showInputDialogue - Stack Overflow
Stack Overflow is a community of 7. Join them; it only takes a minute: Clicking the cancel button showInputDialogue Ask Question. Why does this happen and how can I avoid this?
na Example of how to use the JOptionPane to make GUIs. · GitHub
Jacob Schoen 8, 11 59 Arianule 2, 25 73 For better help sooner, post an SSCCE. Please take more care typing posts. So you can add this condition like this: It will always go in else condition even if cancel button is pressed. Rahul Borkar 2, 9 Yes I have just stated a way of doing that and what questioner is missing.
Sign up or log in StackExchange. Sign up using Facebook.
Sign up using Email and Password. Post as a guest Name. In it, you'll get: The week's top questions and answers Important community announcements Questions that need answers. Stack Overflow works best with JavaScript enabled.
Seems like you doing a bit of mistake, the value returned by showInputDialog MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3. Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.