(1)
import javax.swing.*;
public class GameJFrame extends JFrame {
//游戏主界面,游戏的所有逻辑
public GameJFrame(){
this.setSize(603,680);
this.setVisible(true);//true是展示,flase是隐藏
}
}
(2)
import javax.swing.*;
public class LoginJFrame extends JFrame {
//登录主界面,相关代码
public LoginJFrame(){
this.setSize(488,430);
this.setVisible(true);
}
}
(3)
import javax.swing.*;
public class RegisterJFame extends JFrame {
//注册相关的代码,
public RegisterJFame(){
this.setSize(488,500);
this.setVisible(true);
}
}
2
import com.liujiawei.ui.GameJFrame;
import com.liujiawei.ui.RegisterJFame;
import com.liujiawei.ui.LoginJFrame;
import javax.security.auth.login.LoginContext;
public class App {
public static void main(String[] args) {
new GameJFrame();
new RegisterJFame();
new LoginJFrame();
}
}
这只是第一小步!!