To change the state of any object from an outside class, you either need to make the field public or provide a method to access/change it.
Considering JFrame's setTitle(String title), (inherited from Frame)
, you pass a string as the new title.
Making fr public would allow fr.setTitle(title); to work.
On the other hand the TabClass could have a method setTitle(String title); where inside the body you use the fr.setTitle(title); and keep fr private.
(Using the method and keeping the field private would be my recommendation)