Results 1 to 3 of 3
  1. #1
    dr4g0nk1ng is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

    Default need help with a JOptionPane

    Java Code:
    		int card = JOptionPane.YES_OPTION;
    
    		 do {
    	            card = JOptionPane.showConfirmDialog(null, "Want another card?", "Input",
    	            JOptionPane.YES_OPTION);
    	            
    	            hand.deal();
    	            
    	            
    	        } while(card == JOptionPane.YES_OPTION);
    i need it to not deal a card when i hit no as well? how do i alter the code?

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,784
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by dr4g0nk1ng View Post
    Java Code:
    		int card = JOptionPane.YES_OPTION;
    
    		 do {
    	            card = JOptionPane.showConfirmDialog(null, "Want another card?", "Input",
    	            JOptionPane.YES_OPTION);
    	            
    	            hand.deal();
    	            
    	            
    	        } while(card == JOptionPane.YES_OPTION);
    i need it to not deal a card when i hit no as well? how do i alter the code?
    Does this make sense to you?

    Java Code:
    while (JOptionPane.showConfirmDialog(null, "Want another card?", "Input", JOptionPane.YES_OPTION) 
           == JOptionPane.YES_OPTION)
       hand.deal();
    kind regards,

    Jos
    Last edited by JosAH; 02-19-2010 at 10:32 PM.

  3. #3
    dr4g0nk1ng is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

Similar Threads

  1. need help for JOptionPane....
    By keycoffee in forum New To Java
    Replies: 1
    Last Post: 02-09-2010, 09:59 AM
  2. Help with JOptionPane
    By SwEeTAcTioN in forum New To Java
    Replies: 12
    Last Post: 11-03-2009, 05:12 AM
  3. JOptionpane
    By tommyyyy in forum New To Java
    Replies: 2
    Last Post: 03-20-2009, 09:33 AM
  4. JOptionPane
    By Mir in forum New To Java
    Replies: 5
    Last Post: 11-29-2008, 03:04 AM
  5. JOptionPane
    By whosadork in forum New To Java
    Replies: 2
    Last Post: 10-23-2008, 03:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •