我想從「PART3」的任何幫助控制JFrame嗎? StackOverflow的要求更多的信息;)所以我的想法是在PART3 GF,我知道這是不對的所以任何幫助控制JFrame其他無效?
import java.io.IOException;
import javax.swing.JFrame;
public class test {
public static void main(String[] args) throws IOException{
SetUp g =new SetUp();
g.PART2();
g.PART3();
}}
class SetUp {
void PART2()throws IOException{
JFrame f = new JFrame();
f.setTitle("Test");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// System.out.println(f);
}
void PART3()throws IOException{
SetUp g =new SetUp();
g.f.setSize(128,128);
g.f.setLocation(10,10);
g.f.setVisible(true);
// System.out.println(g.f);
}
}
所以我的想法是在PART3 GF,我知道這是不對的所以任何幫助
你是什麼意思控制JFrame? – Lemonov