Skip to content
Advertisement

How do I output a message using JFrame depending on whether data is incorrect or correct?

I have used a boolean method to decide whether the data is correct or not. For some reason, even when the data is correct or not the data still shows up as incorrect. The boolean is underlined and states that the variable error is never used. When the report button is clicked it should check if the data is correct or not. If the data is not correct it should show

Data problems

JavaScript

If the data is correct it should show

Medical Report

data here.

here is my code:

JavaScript

Advertisement

Answer

I needed to compare the boolean. To check if the error is true:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement