D
D
Dmitry Borisenko2018-09-22 12:54:34
User interface
Dmitry Borisenko, 2018-09-22 12:54:34

Is it possible to create an instance of the JDialog class that performs the calculation and get the calculation data from it into the calling class?

Good afternoon! There is a main panel with combo boxes, and one of them records the mean arterial pressure. For the convenience of the user, there is a button next to the combobox, when clicked, a modal window (an instance of the JDialog class) appears, where data is inserted, which allows calculating the average based on the systolic and diastolic pressure indicators. When the JDialog instance is closed, the calculated value must be passed to the caller. Initially, I made JDialog an inner class, and there were no problems with passing. But since the calculation of the average blood pressure is also required in other places in the program, I had to make it a separate class, and I had a problem with passing the value. Maybe stupid, but I don't know how to do it. Can anyone help?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question