Access Java JFrame from another class
问题 I have a class that creates a JFrame. When the JFrame is created it has a start button. When the start button is clicked, it runs two threads until the stop button is clicked. The two threads are in another class file. From the class that contains the threads, how can I access the JFrame instance in order to change value that are displayed? 回答1: In order to acheive this you have to pass the reference of JFrame using this keyword. 回答2: To have access to a private instance within another class,