As many probably know, I am a complete Java newbie. I have already attempted to research this (by reading other posts on StackOverflow, Googling and asking a friend who is less of a java newbie) but I can't figure it out. The answer is probably clear and easy but I am blind to it. I am attempting to dispose a JFrame
from a different frame.
My application is supposed to work as follows:
- Frame X has a button, when pressed: spawns frame Y
- Frame Y has a button, when pressed: spawns frame Z
- Frame Z has a button, when pressed: performs method from frame Y before disposing frame Y and itself.
Getting frame Z to dispose frame Y is where most of my issues are. Any help is greatly appreciated. Ideally help will be phrased in such a way that even a baby could understand (because that is my level of Java comprehension).
I know many will think this is a duplicate question of either this question or this other question. I believe it is not a duplicate question because I have read both and have not understood how to resolve my own problem.