package cn.lijinshen.ui;
import javax.swing.*;
public class GameFrame extends JFrame {
public GameFrame() {
initFrame();
setMenuBar();
this.setVisible(true);
}
// 设置菜单
private void setMenuBar() {
JMenuBar menuBar = new JMenuBar();
JMenu functionMenu = new JMenu("功能");
JMenu aboutMenu = new JMenu("关于我们");
JMenuItem replayGame = new JMenuItem("重新游戏");
JMenuItem replayLogin = new JMenuItem("重新登录");
JMenuItem cloneGame = new JMenuItem("关闭游戏");
JMenuItem wx = new JMenuItem("公众号");
functionMenu.add(replayGame);
functionMenu.add(replayLogin);
functionMenu.add(cloneGame);
aboutMenu.add(wx);
menuBar.add(functionMenu);
menuBar.add(aboutMenu);
this.setJMenuBar(menuBar);
}
// 窗口设置
private void initFrame() {
// 设置窗口大小
this.setSize(600, 800);
// 设置窗口位置
this.setLocationRelativeTo(null);
// 设置标题
this.setTitle("单机版拼图游戏 V1.0");
// 设置是否总是处于窗口顶部
this.setAlwaysOnTop(true);
//设置关闭模式
this.setDefaultCloseOperation(3);
}
}
java拼图小游戏.zip
版权申诉
90 浏览量
2023-07-19
09:21:34
上传
评论
收藏 6KB ZIP 举报
白话机器学习
- 粉丝: 8910
- 资源: 7681
最新资源
- Pytorch-pytorch深度学习教程之Tensorboard.zip
- 基于C++和Python开发yolov8-face作为人脸检测器dlib作为人脸识别器的人脸考勤系统源码+项目说明.zip
- Pytorch-pytorch深度学习教程之变分自动编码器.zip
- Pytorch-pytorch深度学习教程之神经风格迁移.zip
- Pytorch-pytorch深度学习教程之深度残差网络.zip
- Pytorch-pytorch深度学习教程之循环神经网络.zip
- Pytorch-pytorch深度学习教程之逻辑回归.zip
- Pytorch-pytorch深度学习教程之双向循环网络.zip
- Pytorch-pytorch深度学习教程之卷积神经网络.zip
- Pytorch-pytorch深度学习教程之前馈神经网络.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈