Write a program that accepts two numeric values from the user and displays all integers between these values. Your program will

Accept a starting value
Accept an ending value
Display all the integers (inclusive) between those two values. Your program should count up or down (depending on whether the starting value is greater or less than the ending value)

Here's what I wrote:

String firstString = a.getText();
double a = Double.parseDouble(firstString);

String secondString = b.getText();
double b = Double.parseDouble(secondString);

if(b-a >=1){
for (i=a; i<= b; i++){

outputArea.setText("The value is "+ i);

The issue is that instead of displaying all the numbers between 2 numbers that user enters, my visual calculator only shows the bigger number in a screen. Please help!

Ignoring the syntax error of the missing close brace,

all you do is set the text to the latest string displayed. All the other strings are replaced. You need to append a new line for each value of i, not just do a clean reset of the text area each time.

It looks like the issue in your code is that you are using the `setText()` method inside the loop, which updates the display area with each iteration and overwrites the previous value. As a result, only the last value (`b`) is being displayed.

To fix this issue, you can concatenate the values inside the loop and then set the final result to the display area after the loop completes. Here's an updated version of your code:

```java
String firstString = a.getText();
double a = Double.parseDouble(firstString);

String secondString = b.getText();
double b = Double.parseDouble(secondString);

String output = ""; // Define an empty string to store the result

if (b >= a) {
for (double i = a; i <= b; i++) {
output += i + " "; // Concatenate each number with a space
}
} else {
for (double i = a; i >= b; i--) {
output += i + " ";
}
}

outputArea.setText("The values are: " + output);
```

This updated code will store all the numbers between `a` and `b` (inclusive) in the `output` string with spaces in between. Then, after the loop finishes, the `outputArea` will be set to the final result, which will display all the numbers.