S
Qwen3-VL-8B与Transformer原理详解:从理论到多模态实践
首页
速度
优化工具
☰
首页
速度
收录
工具
首页
/
速度优化
/
造相-Z-Image-Turbo LoRA 赋能网络安全:生成模拟人物头像用于隐私保护测试
网站优化
知识图谱在AI测试工具选型中的革命性应用:ROI优化与智能推荐
春节回家,怎么跟爸妈解释“AI到底是个啥“
2026-06-12 13:57:26
阅读时长:4分钟
562次阅读
核心内容摘要
(含关键技术人员解析)从“千问崩了”到“系统重生”:一场30亿级高并发实战背后的全链路技术复盘
预期实现功能V
0准备数据 找到 单词与翻译的对照数据 存入到文件中在程序中读取文件中的数据V
0:1:随机抽取单词去掉其中某个字母要求用户输入这个字母填空2给出中文翻译输入单词 实现拼写3抽取单词给出4个选项 要求选择V
0:错题记忆将之间出错的题在新的练习再重复出现刷题的规划15天一轮模式选择CET-4/6高考 中考 等
功能实现先从最简洁的界面开始大概界面预期效果如下可以看到这里我们需要创建JFrame窗口对象然后添加标签JLabel和按钮JButton组件为了方便区分我们把初始窗口写到showUI方法中由于后续点击按钮后要进行窗体刷新操作为了便于编写我们导入一个面板JPanel组件在面板上进行操作public void showUI() { //wl.setPanel(panel); wl.setWordsUI(this); JFrame jf new JFrame(背单词); jf.setTitle(背单词); jf.setSize(500,
; jf.setLocationRelativeTo(null);//窗体居中显示到屏幕正中间 jf.setDefaultCloseOperation(
; //jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); panel.setLayout(null);//没有布局所有的组件需要自己设置位置和大小 JLabel jl new JLabel(请选择题库); JButton jbu new JButton(CET-
; JButton jbu2 new JButton(CET-
; Font font new Font(微软雅黑, Font.BOLD,
;//设置字体 jl.setFont(font); jbu.setFont(font); jbu
setFont(font); panel.add(jl);//添加组件 panel.add(jbu); panel.add(jbu
; jl.setBounds(150, 100, 200,
;//调整位置 jbu.setBounds(150, 150, 200,
; jbu
setBounds(150, 200, 200,
; jbu.addActionListener(wl); jbu
addActionListener(wl); jf.add(panel);//添加面板 jf.setVisible(true);//可见 }初始界面设置完成后需要编写对应的响应操作我们可以创建一个WordListener监听类来编写对应的响应操作JButton组件对应的监听器为动作监听器ActionListener注意需要引用接口当我们点击按钮时触发以下判断注意这里的文件在项目同级文件夹下这里我们读取文件的方式为行读取先字符读取自动补全后将行读取操作放到字符读取第一个while循环内并将字符串根据#拆分成两部分分别存入engList数组和chnList数组内if(s.equals(CET-
){ //加载四级词库 File file new File(words/CET-
txt); //文件读取 //单个字节 FileReader fr null; try { fr new FileReader(file); //读取一行 BufferedReader br new BufferedReader(fr); while(true){ String line br.readLine(); if(linenull){ break; } //拆分字符串 String[] eng_chn line.split(#); engList.add(eng_chn[0]); chnList.add(eng_chn[1]); } } catch (FileNotFoundException ex) { throw new RuntimeException(ex); } catch (IOException ex) { throw new RuntimeException(ex); } //刷新界面 panel.removeAll();//移除 String wordgetWord(); UI.showUI2(word); Font font new Font(微软雅黑, Font.BOLD,
; /* JButton jbu new JButton(hello); jbu.setBounds(150,170,200,
; jbu.setFont(font); panel.add(jbu); */ //刷新 组件 panel.repaint(); panel.revalidate(); //出题 }getword函数作用为获取随机单词并挖空内容如下public String getWord(){ int sizeengList.size(); wordIndexran.nextInt(size); String wordengList.get(wordIndex); int word_lenword.length(); int indexran.nextInt(word_len); cword.charAt(index); String vwordword.substring(0,index)_word.substring(index1,word_len); return vword; }showUI2函数作用为显示新的标签挖空单词、输入框和按钮代码如下public void showUI2(String vword) { JLabel jlanew JLabel(请猜出单词缺失的字母); JLabel jl new JLabel(vword); JTextField jtf new JTextField(
; JButton jbu new JButton(提交); JButton jbu3 new JButton(下一个); Font font new Font(微软雅黑, Font.BOLD,
; jl.setFont(font); jtf.setFont(font); jbu.setFont(font); jbu
setFont(font); jla.setFont(font); jla.setBounds(150,0,300,
; jl.setBounds(150,50,300,
; jtf.setBounds(150,100,200,
; jbu.setBounds(150,200,200,
; jbu
setBounds(150,150,200,
; panel.add(jla); panel.add(jl); panel.add(jtf); panel.add(jbu); panel.add(jbu
; jbu
addActionListener(wl); jbu.addActionListener(wl); //将界面的组件对象的地址 传一份给监听器中声明的组件变量名 使得我们点击按钮时可以调用这些组件 设置文本 获取文本 wl.setWordsJla(jl); wl.setChJtf(jtf); }tips.由于showUI这里的标签、输入框和按钮需要重复使用所以需要传到监听类中方便后续使用、刷新和读取其他情况判断如下else if(s.equals(提交)){ String chchJtf.getText(); if (ch.length()
{ JOptionPane.showMessageDialog(panel,请输入答案); return; } char ncch.charAt(
; String wordengList.get(wordIndex); String chnchnList.get(wordIndex); if(cnc){ JOptionPane.showMessageDialog(panel,恭喜你回答正确 word chn); }else{ JOptionPane.showMessageDialog(panel,很抱歉回答错误 word chn); } }else if(s.equals(下一个)){ //下一题 String wordSgetWord(); wordJla.setText(wordS);//显示 chJtf.setText();//清空 }
完整代码添加了两种模式package HolidayMainPackage.day0125; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.*; import java.util.ArrayList; import java.util.Random; //退出 保存功能每过五秒自动保存一次 //优化 public class WordsListener implements ActionListener { //绝对路径 //相对路径 ArrayListString engList new ArrayList(); ArrayListString chnList new ArrayList(); ArrayListString transList new ArrayList();//我自己的单词历史记录 //编号 猜对的次数 单词 中文(写一个单词类把这些属性存入类似于c语言结构体和结构体数组) JPanel panel; mainV1 UI; JLabel wordJla; JTextField chJtf; Random rannew Random(); char c; int wordIndex; int pattern; public void setWordsUI(mainV1 ui){ this.UI ui; this.panel ui.panel; } public void setWordsJla(JLabel jl) { this.wordJla jl; } public void setChJtf(JTextField jtf) { this.chJtf jtf; } Override public void actionPerformed(ActionEvent e) { String s e.getActionCommand(); if(s.equals(CET-
){ //加载四级词库 File file new File(words/CET-
txt); //文件读取 //单个字节 FileReader fr null; try { fr new FileReader(file); //读取一行 BufferedReader br new BufferedReader(fr); while(true){ String line br.readLine(); if(linenull){ break; } //拆分字符串 String[] eng_chn line.split(#); engList.add(eng_chn[0]); chnList.add(eng_chn[1]); } } catch (FileNotFoundException ex) { throw new RuntimeException(ex); } catch (IOException ex) { throw new RuntimeException(ex); } //刷新界面 panel.removeAll();//移除 String wordgetWord(); UI.showUI2(word); Font font new Font(微软雅黑, Font.BOLD,
; /* JButton jbu new JButton(hello); jbu.setBounds(150,170,200,
; jbu.setFont(font); panel.add(jbu); */ //刷新 组件 panel.repaint(); panel.revalidate(); //出题 }else if(s.equals(提交)){ String chchJtf.getText(); if (ch.length()
{ JOptionPane.showMessageDialog(panel,请输入答案); return; } if(pattern
{ pattern1(ch); }else if(pattern
{ pattern2(ch); }else{ JOptionPane.showMessageDialog(panel,请选择题库); } }else if(s.equals(下一个)){ //下一题 pattern ran.nextInt(
; System.out.println(pattern); if(pattern
{ panel.removeAll();//移除 String wordgetWord(); UI.showUI2(word); }else if(pattern
{ panel.removeAll();//移除 String wordgetChinese(); UI.showUI2(word); System.out.println(pattern); }else{ JOptionPane.showMessageDialog(panel,请选择题库); } /*String wordSgetWord(); wordJla.setText(wordS);//显示 chJtf.setText();//清空 */ // 缺少这两行 panel.revalidate(); panel.repaint(); } } public String getWord(){ int sizeengList.size(); wordIndexran.nextInt(size); String wordengList.get(wordIndex); int word_lenword.length(); int indexran.nextInt(word_len); cword.charAt(index); return word.substring(0,index)_word.substring(index1,word_len); } public String getChinese(){ int sizechnList.size(); wordIndexran.nextInt(size); return chnList.get(wordIndex); } //字母填空 public void pattern1(String ch){ char ncch.charAt(
; String wordengList.get(wordIndex); String chnchnList.get(wordIndex); if(cnc){ JOptionPane.showMessageDialog(panel,恭喜你回答正确\n word chn); }else{ JOptionPane.showMessageDialog(panel,很抱歉回答错误\n word chn); } } public void pattern2(String ch){ String ncengList.get(wordIndex); String wordengList.get(wordIndex); String chnchnList.get(wordIndex); if(ch.equals(nc)){ JOptionPane.showMessageDialog(panel,恭喜你回答正确\n word chn); }else{ JOptionPane.showMessageDialog(panel,很抱歉回答错误\n word chn); } } }package HolidayMainPackage.day0125; import javax.swing.*; import java.awt.*; import java.util.Random; public class mainV1 { JPanel panel new JPanel(); WordsListener wl new WordsListener(); public void showUI() { //wl.setPanel(panel); wl.setWordsUI(this); JFrame jf new JFrame(背单词); jf.setTitle(背单词); jf.setSize(500,
; jf.setLocationRelativeTo(null);//窗体居中显示到屏幕正中间 jf.setDefaultCloseOperation(
; //jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); panel.setLayout(null);//没有布局所有的组件需要自己设置位置和大小 JLabel jl new JLabel(请选择题库); JButton jbu new JButton(CET-
; JButton jbu2 new JButton(CET-
; Font font new Font(微软雅黑, Font.BOLD,
; jl.setFont(font); jbu.setFont(font); jbu
setFont(font); panel.add(jl); panel.add(jbu); panel.add(jbu
; jl.setBounds(150, 100, 200,
; jbu.setBounds(150, 150, 200,
; jbu
setBounds(150, 200, 200,
; jbu.addActionListener(wl); jbu
addActionListener(wl); jf.add(panel); jf.setVisible(true); } public void showUI2(String vword) { JLabel jlanew JLabel(请猜出单词缺失的字母); JLabel jl new JLabel(vword); JTextField jtf new JTextField(
; JButton jbu new JButton(提交); JButton jbu3 new JButton(下一个); Font font new Font(微软雅黑, Font.BOLD,
; jl.setFont(font); jtf.setFont(font); jbu.setFont(font); jbu
setFont(font); jla.setFont(font); jla.setBounds(150,0,300,
; jl.setBounds(150,50,300,
; jtf.setBounds(150,100,200,
; jbu.setBounds(150,200,200,
; jbu
setBounds(150,150,200,
; panel.add(jla); panel.add(jl); panel.add(jtf); panel.add(jbu); panel.add(jbu
; jbu
addActionListener(wl); jbu.addActionListener(wl); //将界面的组件对象的地址 传一份给监听器中声明的组件变量名 使得我们点击按钮时可以调用这些组件 设置文本 获取文本 wl.setWordsJla(jl); wl.setChJtf(jtf); } public static void main(String[] args) { mainV1 main new mainV1(); main.showUI(); } }未完后续会更新V
0的选择模式和V
0模式相关记忆功能
污污视频2025-污污视频应用
相关标签
Debian新手避坑指南:从安装到日常使用的10个实用技巧
Blender几何接近节点实战:从原理到应用场景解析
从AOSP源码看Android14最近任务实现:手把手教你定制自己的RecentsView
AI艺术革命:圣光艺苑生成惊艳画作全攻略
Youtu-Parsing集成Java SpringBoot:构建企业级文档智能处理微服务
7大文档转换难题一键解决:FlashAI Convert Lite 离线效率革命指南
避坑指南:AI论文工具 千笔·专业论文写作工具 VS WPS AI,本科生必备神器!
利用VMware虚拟机搭建AgentCPM本地测试与开发环境
InstructPix2Pix创意玩法:让老照片焕发新生
YOLO12在工业质检中的应用:缺陷检测系统
�工具��】国家跨境电商综�试验区DID-�/市/上市公�(2000-2025年)
Java应用启动加速工具:Spring Startup Analyzer技术侦探指南
LFTP高级技巧:如何用镜像功能快速同步本地与远程文件
Xiaomusic故障排除宝典:从错误码解析到系统优化的全方位解决方案
🔍
📑
文章目录
二、东京热456大交乱高清视频震撼上线,颠覆你的视觉感官!
三、《陈情令》幕后:当“小小水蜜桃”遇上“忘羡”的夏天
四、含羞草传媒:捕捉生活瞬间,绽放情感光芒
五、《集体“emo”的背后:当代男女通用的“愁”学报告》
🔥
热门优化文章
一键暂停更新,轻松掌控电脑节奏
2026-05-16 23:19:13
Python从0到100完整学习指南(必看导航)
2026-05-16 23:19:13
🛠️
实用工具推荐
伽罗:脸红、流口水、流眼泪,那一刻的极致沦陷
永久免费的黄冈网站建设源码:开启您的在线业务新篇章
相关优化文章 推荐
跨越次元的视觉盛宴:欧美精产与国品一二三产品动漫力作深度推荐
2026-06-12 13:57:26 10分钟阅读
樱色泪痕:当八重神子落泪,谁能读懂她眼中的万千星辰?
2026-06-12 13:57:26 8分钟阅读
17.c·moc-起草:揭秘创意与艺术的绝妙结合
2026-06-12 13:57:26 7分钟阅读
↑
百度百家号客服电话人工服务
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3