Results 1 to 4 of 4
  1. #1
    PedramCarter is offline Member
    Join Date
    Nov 2014
    Posts
    27
    Rep Power
    0

    Default How do I do a button release if statement so calculations take place once released?

    So I have 2 forums, one is itemspage one is cashpay, I have already done itemspage and done a checkbox if statement so when the button is pressed it adds the total calculation of the costs and adds them inside a variable called "TotalPrice" I have then passed the variable to my CashPay Class now I want to be able to make calculations happen when button is pressed and released, what is the method?, my calculation will be if (CashAmount => TotalPrice) { CashAmount - TotalPrice}

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    14

    Default Re: How do I do a button release if statement so calculations take place once release

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

  3. #3
    PedramCarter is offline Member
    Join Date
    Nov 2014
    Posts
    27
    Rep Power
    0

    Default Re: How do I do a button release if statement so calculations take place once release

    Quote Originally Posted by jim829 View Post
    I'm sorry huge wall of text I didn't understand anything can you please help me what do I use like I use an actionlistener obviously but how do I declare the method what do I use? mouserelease mouserollover idk what it's called, I want it to be mouse release.

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    14

    Default Re: How do I do a button release if statement so calculations take place once release

    You don't need a mouse listener. Just look at the JButton examples. The button events are fired upon button release so that should do what you want. For more specific help, please provide a Short, Self Contained, Correct Example.

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

Similar Threads

  1. Help with Date calculations
    By iainnitro in forum New To Java
    Replies: 4
    Last Post: 11-17-2012, 08:38 AM
  2. Hypotenuse Calculations
    By Nightcrawler in forum New To Java
    Replies: 21
    Last Post: 03-17-2012, 07:23 PM
  3. OO for calculations?
    By StateMachine in forum New To Java
    Replies: 1
    Last Post: 12-31-2011, 08:17 AM
  4. Rounding calculations
    By lynxbci in forum New To Java
    Replies: 9
    Last Post: 08-20-2011, 03:49 PM
  5. decimal calculations?
    By arnab321 in forum CLDC and MIDP
    Replies: 5
    Last Post: 11-19-2008, 03:36 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
  •