If you know computers check this out..

Collapse

Recommended Videos

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dtownballa
    MVP
    • Feb 2003
    • 1450

    #46
    Re: If you know computers check this out..

    Originally posted by aukevin
    You would use a JOptionPane just like you did when you were showing an error for when the user entered a bad value for the numbers.



    Except you would change the message and title in it to make sense for displaying the results. Do you know how to append a variable to a string? The message that appears in the JOptionPane is just a String, so you would create a String that displays the result.

    For example if you have these two statements:
    String name = "Kevin";
    String s1 = “My name is” + name;


    If you said: System.out.println(s1);
    You would get: "My name is Kevin"

    So if I wanted a JOptionPane that showed my string above, it would be:

    JOptionPane.showMessageDialog(null, "My name is "+name, "This is how you append values to a String", JOptionPane.INFORMATION_MESSAGE);

    So the you need to make a string that displays the results variable just like how above shows the name variable.

    Gotcha!

    Once again Kev, anything you need man let me know.
    PSN: The_TechNinja
    Check me out on YouTube as well: http://tinyurl.com/lqd6s9j

    Comment

    • aukevin
      War Eagle, Go Braves!
      • Dec 2002
      • 14700

      #47
      Re: If you know computers check this out..

      Originally posted by Dtownballa
      Gotcha!

      Once again Kev, anything you need man let me know.
      I'm glad you got it figured out. You still have a few requirements left on it don't you? Good luck!

      Atlanta Braves
      - Auburn Tigers - Nashville Predators

      Comment

      Working...