Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23
  1. #21
    MomenT is offline Member
    Join Date
    Sep 2008
    Posts
    25
    Rep Power
    0

    Default

    yes.. i already done the if else statement in the JOptionPane.. I just want the switch statement to work in the JOptionPane..

  2. #22
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Well, considering this code
    Java Code:
    numStr = JOptionPane.showInputDialog ("Please enter the following number: \n1: $500 and above \n2: $300 and above \n3: $100 and above \n4: $99 and below");
    {
        switch (num)
        {
    Aren't you forgetting to convert numStr to an integer?

    Also, as I have said multiple times the first brace in the above reposted code (the piece in this post) in completely unneccessary. Remove it and it's associated closing brace.

  3. #23
    MomenT is offline Member
    Join Date
    Sep 2008
    Posts
    25
    Rep Power
    0

    Default

    oh ok.. i will try to correct my mistakes.. thanks for the guidiance and help guys.. thanks alot...

Page 2 of 2 FirstFirst 12

Similar Threads

  1. JOptionPane
    By Mir in forum New To Java
    Replies: 5
    Last Post: 11-29-2008, 02:04 AM
  2. [SOLVED] On Exit JoptionPane problem
    By Mir in forum New To Java
    Replies: 24
    Last Post: 07-15-2008, 07:39 AM
  3. About JOptionPane.showMessageDialog
    By jhetfield18 in forum AWT / Swing
    Replies: 2
    Last Post: 11-02-2007, 10:45 PM
  4. About JOptionPane.showMessageDialog
    By jhetfield18 in forum Advanced Java
    Replies: 0
    Last Post: 11-02-2007, 10:56 AM
  5. Problem with JOptionPane.showInputDialog()
    By romina in forum AWT / Swing
    Replies: 1
    Last Post: 08-07-2007, 05:33 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
  •