I have two classes: one class AnalogClock and one class MainInterface.
I created the timeChanged method in the AnalogClock class, and it is called every time the time has changed. My AnalogClock is basically a patterned JPanel. In MainInterface, I set up a JFrame and add an object to my AnalogClock.
Is it possible to change the title of my window whenever "timeChanged" is called? I tried to use getParent() or getRootParent() , but they do not recognize setTitle() .
source share