Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Assistance with unintended termination of Get area of circle and rectangle Program

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Location
    USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Assistance with unintended termination of Get area of circle and rectangle Program

    Hello Java connoisseurs, I'm new to this forum, but not new to internet forums. The following code is practice I'm doing for an upcoming exam. I have 3 classes (application, GUI, and structures).

    I want to enter 1 for get the area of a circle and 2 for square (okay, I realize that a square is really quadrilateral)

    Anyway, here is/are the problems. Eclipse shows no errors but as soon as I enter 1 or 2, the program terminates.

    code deleted


    Hopefully you all are able help this extreme java noob out.


  2. #2
    Junior Member
    Join Date
    Oct 2012
    Location
    USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Assistance with unintended termination of Get area of circle and rectangle Progra

    In GUI, I think I'm storing my input as strLaunchMessage and then using intInput in the if statement. Correct? That may cause a problem...


    How do I "connect the dots" there?
    Last edited by Yellowcab; October 16th, 2012 at 09:04 PM.

  3. #3
    Junior Member
    Join Date
    Oct 2012
    Location
    USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Assistance with unintended termination of Get area of circle and rectangle Progra

    Problem solved

    I needed to add:

    intLaunchMessage = Integer.parseInt(strLaunchMessage);

Similar Threads

  1. Rectangle/Ellipse program help
    By ja3n in forum AWT / Java Swing
    Replies: 1
    Last Post: March 1st, 2012, 05:51 AM
  2. Vector Loop Termination
    By embeddedhelp in forum Loops & Control Statements
    Replies: 1
    Last Post: February 7th, 2011, 02:12 AM
  3. NEED ASSISTANCE W/ JAVA PROGRAM
    By Neddrick in forum What's Wrong With My Code?
    Replies: 0
    Last Post: April 29th, 2010, 08:20 PM
  4. array program assistance needed
    By JavaNoob82 in forum Collections and Generics
    Replies: 4
    Last Post: December 14th, 2009, 05:49 AM
  5. Replies: 5
    Last Post: December 13th, 2009, 07:10 PM