tempNumbers isn't a very explanatory variable name. Let the variable itself describe what it is temp for. For a simple calculator though, perhaps number1 and number2 would suffice.
You're using strange indentation in your constructor. It's good that you separate the fields, but no need to add an extra indentation for the lines where you call methods on the buttons.
The class numberButtonsAction should be named with capital N to be consistent with the Java coding conventions.
You have this if in your code:
if (!resultJText.getText().equals("0.0")) {
But when you clear that textfield, you don't set it to "0.0", you set it to an empty string:
resultJText.setText("");
I am not sure how it all works out when running it, but it is a bit suspicious to me. Perhaps you would want to parse the text as a double (set it to 0.0 if it's not a number), check the value, and compare using the value instead of the text. Just an idea though.
For the different operations, you should consider using the Strategy Pattern.
You can use an enum instead of a byte.
public enum CalcFunction {
ADDITION, SUBTRACTION, MULTIPLICATION, DIVISION;
}
If you would use Java 8, you could use the DoubleBinaryOperator interface and lambdas. You could also make the whole ActionListener things a lot smoother by using Java method references. button.addActionListener(this::divideButtonClick); (I love Java 8!)
The current class names DivideButton, MultiplyButton etc sounds like they extend JButton, but they don't (and they shouldn't so that's good). Better names would be adding Listener at the end, however, if you are unable to use Java 8, you can create a common class like this:
private class CalculationListener implements ActionListener {
private final CalcFunction operation;
public SomeFunction(CalcFunction function) {
this.operation = function;
}
@Override
public void actionPerformed(ActionEvent e) {
if (tempNumbers1 == 0) {
tempNumbers1 = Double.parseDouble(resultJText.getText());
resultJText.setText("");
} else {
tempNumbers2 = Double.parseDouble(resultJText.getText());
resultJText.setText("");
}
function = operation;
}
}
And use it like this:
divideButton.addActionListener(new CalculationListener(CalcFunction.DIVISION));