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: Store numbers in mvc Calculator java

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Store numbers in mvc Calculator java

    Hi there,
    I'm just making a mvc java calculator in java. At the moment i can't store numbers then do the calculations.
    I have only done double text field calculators not single.
    What has to happen is type a number into the display field, then by clicking + or - key the number stores the number so the second can be entered and then perform the calculation etc.
    Any links would be awesome , thanks. I've searched around but can't find it yet.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    22,310
    Thanks
    56
    Thanked 2,373 Times in 2,344 Posts

    Default Re: Store numbers in mvc Calculator java

    i can't store numbers then do the calculations.
    What is the problem storing the numbers?
    Most operators take two operands.
    When are the operations done?
    After the operand following the operator is entered?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Feb 2013
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Store numbers in mvc Calculator java

    Thanks Norm, Basically its a typical calculator set up with one input screen/textfield.
    I need the calculator to read the number, ie. the user inputs 123, then when they push + _ * etc. it clears the screen stores the number then reads the next number the user inputs, then stores that number.
    Then, when pushing equals, it will perform the calculation, i was gonna do a switch statement for the operands but i need to read the numbers properly first, i have read numerous articles and source code but this is a specific scientific calculator written in java mvc. I have yet to come across a good example of mvc calc written in java.

Similar Threads

  1. How java programs store in Heap and Stack.
    By rayan2004 in forum Object Oriented Programming
    Replies: 3
    Last Post: December 14th, 2012, 07:46 AM
  2. Call SQL store proc from Java
    By nil2012 in forum JDBC & Databases
    Replies: 0
    Last Post: September 19th, 2012, 02:41 PM
  3. Java, Best way to store information?
    By Emperor_Xyn in forum Java Theory & Questions
    Replies: 4
    Last Post: December 22nd, 2011, 05:46 PM
  4. MVC - Split the Java servlet(help needed)
    By kamweshi in forum Java Servlet
    Replies: 1
    Last Post: October 18th, 2010, 10:02 AM
  5. Replies: 2
    Last Post: February 19th, 2010, 08:10 AM

Tags for this Thread