Results 1 to 8 of 8
  1. #1
    Krock999 is offline Member
    Join Date
    Jul 2013
    Posts
    10
    Rep Power
    0

    Unhappy How Can You Convert an Int to a String When It Is a JOptionPane.showOptionDialog?

    This is my code:

    Java Code:
    String GameDeath11;
    
    if (impact == 3) {
    							GameDeath11 = (String)JOptionPane.showOptionDialog(null, "The messages of Big Brother are not muttered in the ears of the people randomly anymore.", InformGame, JOptionPane.PLAIN_MESSAGE, JOptionPane.QUESTION_MESSAGE,icon, Options1BA, null);
    							impact = (byte) (impact - 1);
    							money = money - 250;
    							if (GameDeath11 == "I would like to hear the whisperings one last time.."){
    								
    							}
    This is a capitalist simulation game -- please don't judge. I am also not done whatsoever..

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: How Can You Convert an Int to a String When It Is a JOptionPane.showOptionDialog?

    I can't figure out what you're asking.
    Get in the habit of using standard Java naming conventions!

  3. #3
    Krock999 is offline Member
    Join Date
    Jul 2013
    Posts
    10
    Rep Power
    0

    Default Re: How Can You Convert an Int to a String When It Is a JOptionPane.showOptionDialog?

    I am talking about making the if statement and variable compatible..

  4. #4
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: How Can You Convert an Int to a String When It Is a JOptionPane.showOptionDialog?

    Which if statement? What variable? What do you mean by "compatible"? Are you a spambot running word-based Dissociated Press?
    Get in the habit of using standard Java naming conventions!

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,923
    Rep Power
    5

    Default Re: How Can You Convert an Int to a String When It Is a JOptionPane.showOptionDialog?

    Several days ago you also asked a question in an unclear manner and never responded when asked to clarify. Why should be respond to this question?

    How Do You Make Your Code Rewind to Redo Something?

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  6. #6
    Krock999 is offline Member
    Join Date
    Jul 2013
    Posts
    10
    Rep Power
    0

    Default Re: How Can You Convert an Int to a String When It Is a JOptionPane.showOptionDialog?

    I fixed it. Please answer this question..

  7. #7
    Krock999 is offline Member
    Join Date
    Jul 2013
    Posts
    10
    Rep Power
    0

    Default Re: How Can You Convert an Int to a String When It Is a JOptionPane.showOptionDialog?

    This is the If Statement:
    if (GameDeath11 == "I would like to hear the whisperings one last time.."){

    }

    This is the variable: GameDeath. By compatible, I mean I want them to be able to go together. No, I am not a spam bot.

  8. #8
    Krock999 is offline Member
    Join Date
    Jul 2013
    Posts
    10
    Rep Power
    0

    Default Re: How Can You Convert an Int to a String When It Is a JOptionPane.showOptionDialog?

    I already figured it out anyhow, I do not need help. I have other questions though.

Similar Threads

  1. Replies: 3
    Last Post: 02-10-2012, 07:26 PM
  2. JOptionPane.showOptionDialog
    By kris5228 in forum AWT / Swing
    Replies: 7
    Last Post: 11-26-2011, 11:02 PM
  3. Replies: 3
    Last Post: 07-28-2011, 08:52 AM
  4. Help with closing JOptionPane.showOptionDialog
    By Rafik in forum New To Java
    Replies: 3
    Last Post: 06-07-2011, 07:42 AM
  5. Replies: 0
    Last Post: 12-17-2007, 10:46 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
  •