using methods in different classes.

I created a GUI. with a bunch of classes (that extended JPanel) and one that extends JFrame and now I can't figure out how to transfer data between them. lets say I have a public variable set in the JFrame class and a get method like the one below:

public double getBalance()
{
return balance;
}

How do i access this get method from one of the panel classes so I can update the GUI? I tried adding:

double b=atmEngine.getBalance();

but it gave me this error:
non-static method getBalance() cannot be referenced from a static context
I thought about designing a send method from my launcher but I just don't understand how this works!

(Btw this is my first large GUI program sorry for all the questions I am trying as hard as I can to figure it out myself :P)

The panel class needs a reference to your frame class. Assuming your frame class creates the panels, the frame should send a reference to itself (this) as an argument to the panel constructor. You will need to change the panel constructor to accept this argument and store it. Now when the panel wants to call a method in the frame class you can use that reference.

EDIT: one more thing, you should generally not make the variable in panel public, that's what the public get method is for. Make the variable private and the get method public.

One approach would be to put a static method inside the JFrame class called getInstace() that would return an instance of the JFrame class (not necessarily new instance) you can restirct the instance to be single. Once this instance is returned you can call a non-static method on it.
E.g.

Okay so I'm trying to figure out how to use the 'this' keyword. I have no idea where to use this. From what I can understand from my textbook it has to be in the atmEngine class and then the FunctionPanel class will get it in using a constructor problem is I don't know how to send it to the constructor.
Here are both of my classes:

I just spent 5 minutes looking over your code and I have no idea what you're talking about. Could you explain what you want each one of your classes to do? Then, explain which of these classes is not working like you want it to, and explain how you want it to work. You only posted two classes, neither of which contains a main method. And you're talking about FunctionPanel, but you didn't say what FunctionPanel does. Also, post the code for any classes that you want help with that currently aren't working.

Btw, to further explain what others have said, here is what you want to do:

If you want class ATM to be able to update class BankGUI, then the constructor for ATM would look like this:
public ATM(BankGUI theGUI, ....){
atmsBankGUI = theGUI; //ATM has to have a variable called atmsBankGUI
}
And lets say ATM lets you withdraw money.
public void withdraw(){
int amount = dollarAmount; //get the dollar amount the user wants to withdraw
atmsBankGUI.withDrawCash(amount);
}
//Now, this method would be in the BankGUI class
withDrawCash(){
//Do whatever you have to, to make the GUI display the withdrawal
//For example, you could use JLabel.setValue to set it to the new amount of money the user has.
}

If you wanted to do the opposite, the BankGUI class to be able to get input from the user, but you wanted the ATM class to do the calculations (for example, the user types the amount they want to withdraw in the BankGUI, but you want to calculate this amount in ATM class) you would do the opposite: When you invoked the BankGUI classes constructor, one of the arguments passed would be an ATM. You could also do a mixture of the two.