importjava.awt.*;importjava.awt.event.*;importjavax.swing.*;importjava.sql.*;publicclasssystemextendsJFrame{ JDesktopPanedeskpane=newJDesktopPane();//在窗体里建立虚拟桌 JPanelp=newJPanel();//创建一个面板并实例化 publicsystem(){//构造函数 setTitle("订单管理系统");//设置窗体标题 Containercon=getContentPane(); con.setLayout(newBorderLayout());//创建一个布局 con.add(deskpane,BorderLayout.CENTER);//实例虚拟桌面的布局 Fontf=newFont("新宋体",Font.PLAIN,12); JMenuBarmb=newJMenuBar();//实例化菜单栏 mb.setOpaque(true); setJMenuBar(mb); mb.setOpaque(true); setJMenuBar(mb); JMenusystemM=newJMenu("系统管理"); systemM.setFont(f); mb.add(systemM); JMenuItemland=newJMenuItem("重新登陆"); land.setFont(f); JMenuItemexit=newJMenuItem("退出系统"); exit.setFont(f); systemM.add(land); systemM.add(exit); JMenuuserM=newJMenu("用户管理"); userM.setFont(f); mb.add(userM); JMenuItempassword=newJMenuItem("密码修改"); password.setFont(f); JMenuItemaddDelete=newJMenuItem("添加/删除用户"); addDelete.setFont(f); userM.add(password); userM.add(addDelete); JMenumesM=newJMenu("信息管理"); mesM.setFont(f); mb.add(mesM); JMenuaddM=newJMenu("添加信息"); addM.setFont(f); JMenuviewM=newJMenu("查看信息"); viewM.setFont(f); JMenumodifM=newJMenu("修改信息"); modifM.setFont(f); JMenudeleteM=newJMenu("删除信息"); deleteM.setFont(f); mesM.add(addM); mesM.add(viewM); mesM.add(modifM); mesM.add(deleteM); JMenuItemaddgoods=newJMenuItem("添加商品信息"); addgoods.setFont(f); addM.add(addgoods); JMenuItemaddclient=newJMenuItem("添加客户信息"); addclient.setFont(f); addM.add(addclient); JMenuItemviewgoods=newJMenuItem("查看商品信息"); viewgoods.setFont(f); viewM.add(viewgoods); JMenuItemviewclient=newJMenuItem("查看客户信息"); viewclient.setFont(f); viewM.add(viewclient); JMenuItemmodifgoods=newJMenuItem("修改商品信息"); modifgoods.setFont(f); modifM.add(modifgoods); JMenuItemmodifclie
2024/9/13 6:09:25 163KB 需求分析 代码 数据源
1
java项目packageproject.action.dialogAction;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjavax.swing.JOptionPane;importproject.dao.common.DbException;importproject.dao.dataDao.LoginInfoDao;importproject.dao.dataDaoImpl.LoginInfoDaoImpl;importproject.view.dialog.AddLoginInfoDialog;importproject.vo.LoginInfoVo;/***添加登录账号action**@authorAdministrator**/publicclassAddLoginInfoActionimplementsActionListener{privateAddLoginInfoDialogdialog;publicAddLoginInfoAction(AddLoginInfoDialogdialog){this.dialog=dialog;}publicvoidactionPerformed(ActionEvente){Stringname=e.getActionCommand();if(name.equals("确定")){//检验输入是否正确if(dialog.checkInputValue()){LoginInfoDaodao=null;LoginInfoVovo=null;try{//获得界面输入信息vo=dialog.getInputInfo();Stringconfirm=dialog.getConfirm();if(vo.getLog_pwd().equals(confirm)){dao=newLoginInfoDaoImpl();if(dao.insertLoginInfo(vo)){//打印提示信息JOptionPane.showMessageDialog(null,"添加登录人员成功","提示信息",JOptionPane.YES_OPTION);dialog.dispose();}else{//打印提示信息JOptionPane.showMessageDialog(null,"添加登录人员失败","提示信息",JOptionPane.YES_OPTION);}}else{//如果密码确认输入错误,打印提示信息JOptionPane.showMessageDialog(null,"密码确认错误,请重新输入","提示信息",JOptionPane.YES_OPTION);}}catch(DbExceptionex){JOptionPane.showMessageDialog(null,ex.getMessage(),"提示信息",JOptionPane.YES_OPTION);}}else{JOptionPane.showMessageDialog(null,"请确认输入是否完整正确","提示信息",JOptionPane.YES_OPTION);}}elseif(name.equals("取消")){dialog.dispose();}}}
2024/9/12 19:34:35 4.13MB java项目 餐饮管理系统
1
Java练习,制作了一个简单的数字时钟,用到了Java的线程、AWT绘图、Swing等知识点。
2024/9/12 10:24:55 5KB Java Java源码 时钟 Java线程
1
importjava.applet.Applet;importjava.awt.*;importcom.sun.j3d.utils.applet.MainFrame;importjava.awt.BorderLayout;importcom.sun.j3d.utils.universe.SimpleUniverse;importjavax.media.j3d.*;importjavax.vecmath.*;importcom.sun.j3d.utils.behaviors.mouse.*;importcom.sun.j3d.utils.behaviors.keyboard.*;importcom.sun.j3d.utils.picking.behaviors.*;importcom.sun.j3d.utils.geometry.*;importcom.sun.j3d.utils.image.TextureLoader;importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;importjavax.swing.JFrame.*;importjavax.swing.*;
2024/8/28 14:15:17 15KB JAVA 3D 魔方源代码
1
使用AbstractTableModel构建Table在表格中添加JButton按钮,之前在网上找了2天没有找到好用的程序,最终终于找到一个好用的例子。
不要使,我退你们分。

singtheSwingJTableclasscanquicklybecomeastickybusinesswhenyouwanttocustomizeittoyourspecificneeds.FirstyoumustbecomefamiliarwithhowtheJTableclassisorganized.IndividualcellsarerenderedbyTableCellRendererimplementations.ThetablecontentsarerepresentedbyanimplementationoftheTableModelinterface.Bydefault,JTableusesDefaultTableCellRenderertodrawitscells.DefaultTableCellRendererrecognizesafewprimitivetypes,renderingthemasstrings,andcanevendisplayBooleantypesascheckboxes.ButitdefaultstodisplayingthevaluereturnedbytoString()fortypesitdoesnotspecificallyhandle.YouhavetoprovideyourownTableCellRendererimplementationifyouwanttodisplaybuttonsinaJTable.TheTableCellRendererinterfacecontainsonlyonemethod,getTableCellRendererComponent(...),whichreturnsajava.awt.Componentthatknowshowtodrawthecontentsofaspecificcell.Usually,getTableCellRendererComponent()willreturnthesamecomponentforeverycellofacolumn,toavoidtheunnecessaryuseofextramemory.Butwhenthecontentsofacellisitselfacomponent,itisallrighttoreturnthatcomponentastherenderer.Therefore,thefirststeptowardshavingJButtonsdisplaycorrectlyinaJTableistocreateaTableCellRendererimplementationthatreturnstheJButtoncontainedinthecellbeingrendered.Intheaccompanyingcodelisting,JTableButtonRendererdemonstrateshowtodothis.EvenaftercreatingacustomTableCellRenderer,you'restillnotdone.TheTableModelassociatedwithagivenJTabledoesnotonlykeeptrackofthecontentsofeachcell,butitalsokeepstrackoftheclassofdatastoredineachcolumn.DefaultTableModelisdesignedtoworkwithDefaultTableCellRendererandwillreturnjava.lang.String.classforcolumnscontainingdatatypesthatitdoesnotspecificallyhandle.Theexact
2024/6/23 0:29:22 4KB Table JButton 按钮
1
packageasc;importjava.awt.*;importjavax.swing.*;publicclasscsextendsJFrame{//定义组件JPaneljp1,jp2,jp3;//面板JLabeljlb1,jlb2;//标签JButtonjb1,jb2;//按钮JTextFieldjtf;//文本JPasswordFieldjpf;//密码publicstaticvoidmain(String[]args){cswin=newcs();}//构造函数publiccs(){//创建面板jp1=newJPanel();jp2=newJPanel();jp3=newJPanel();//创建标签jlb1=newJLabel("用户名");jlb2=newJLabel("密码");//创建按钮jb1=newJButton("登录");jb2=newJButton("重置");//创建文本框jtf=newJTextField(10);//创建密码框jpf=newJPasswordField(10);//设置布局管理this.setLayout(newGridLayout(3,1));//网格式布局//加入各个组件jp1.add(jlb1);jp1.add(jtf);jp2.add(jlb2);jp2.add(jpf);jp3.add(jb1);jp3.add(jb2);//加入到JFramethis.add(jp1);this.add(jp2);this.add(jp3);//设置窗体this.setTitle("用户登录");//窗体标签this.setSize(300,150);//窗体大小this.setLocationRelativeTo(null);//在屏幕中间显示(居中显示)this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//退出关闭JFramethis.setVisible(true);//显示窗体//锁定窗体this.setResizable(false);}}
2024/6/21 2:27:16 2KB ..
1
完整的课程设计包含文档(8000字+)和源码;
该系统采用三层体系结构;
主要使用Java语言的GUI和AWT编程。
开发环境是Eclipse。
数据库使用MySQL。
本系统可作为毕业设计或者课程设计,本系统是为了解决学生信息的管理问题,存储一定的用户信息和学生信息,方便有效地操作和管理相应的用户信息和学生信息,主要包括:用户可以修改自己的信息;
添加和修改用户的相关信息;
添加、修改、删除学生的相关信息;
对学生的相关信息的查询。
最终实现学生信息的网络化的查询与管理。
1
题目:java拼图游戏姓名学号指导教师(签名)二○一一年七月十四日java拼图游戏[摘要]• 进一步加深对Java语言的理解和掌握:将所学的JAVA知识运用于实践中。
• 课程设计将理论与实践相结合,提供了一个既动手又动脑,独立实践的机会,锻炼我们的分析解决实际问题的能力,提高学生适应实际,实践编程的能力;• 熟练掌握JAVA语言中图形用户界面程序的编写;大体了解怎样用JAVA来编写小游戏的,增强我们实践能力和创新精神的综合培养。
前言编程思路:本练习因为要制作拼图游戏,所以首先要实现图片的导入。
这是通过getImage()函数来实现的,该函数有两个参数,第一个参数指明图片的路径,第二个参数指明图片的名称。
然后,因为要实现图片摆放的随意性,所以要通过initgame()函数来实现。
Initgame()函数是自写函数,在函数体内,通过调用Math.random()函数产生随机数,用来达到图片位置摆放的随意性和随机性。
最后,因为要实现人机交互.,所以首先要通过一系列函数来实现对鼠标事件的监听和响应,这是通过函数addMouseListener(this)和addMouseMotionListener(this)来完成的。
这样程序会区分用户对鼠标不同的操作,正确执行相应的功能。
//首先是程序实现及注释importjava.awt.*;importjava.applet.*;importjava.awt.event.*;publicclasspintuextendsApplet implementsMouseListener,MouseMotionListener{ privateImagepicture; privateGraphicsbuffer; privateImagepic[]; privateImageoff_pic[]; privateGraphicsoff_buf[]; privateImageoff_screen; privateGraphicsoff_buffer; privateImageoff_drag; privateGraphicsoff_drag_buf; privateintmap[][]; privateintran[]; privateintwidth=0; privateintheight=0; privateintlastx; privateintlasty; privateintlast_downx; privateintlast_downy; privateintstepx; privateintstepy; privatebooleanchoose; privatebooleanclick[][]; privatebooleanm_down; privatebooleanm_drag; privatebooleannot_redraw; privatebooleanable; Fontfont1,font2; //程序的初始化 publicvoidinit() {
2024/3/20 15:44:49 799KB java j2ee 课程设计报告
1
实验七Java多线程一、实验目的:熟悉利用Thread类建立多线程方法。
熟悉利用Thread接口建立多线程方法。
二、实验内容:1.阅读下列程序,分析并上机检验其功能。
classDelayThreadexendsThread{privatestaticintcount=0;privateintno;privateintdelay;publicDelayThread(){count++;no=count;}publicvoidrun(){try{for(inti=0;i<10;i++){delay=(int)(Math.random()*5000);sleep(delay);System.out.println(“Thread”+no+”withadelay”+delay);}}catch(InterruptedExceptione){}}}publicclassMyThread{publicstaticvoidmain(Stringargs[]){DelayThreadthread1=newDelayThread();DelayThreadthread2=newDelayThread();thread1.start();thread2.start();try{Thread.sleep(1000);}catch(InterruptedExceptione){System.out.println(“Threadwrong”);}}}2.讲上列程序利用Runnable接口改写,并上机检验。
3.利用多线程编写一个模拟时钟(AWT程序、Runnable接口),有时/分/秒针编写一个应用程序,创建三个线程分别显示各自的时间。
三、实验要求:1.通过实验掌握Thread、Runnable使用方法;
2.程序必须能够实现多线程;
3.程序必须能够完成题目要求;
4.写出实验报告。
四、实验步骤:首先分析程序功能,再通过上机运行验证自己的分析,从而掌握通过Thread类建立多线程的方法。
通过将扩展Thread类建立多线程的方法改为利用Runnable接口的方法,掌握通过Runnable接口建立多线程的方法。
2024/2/26 3:55:02 2KB JAVA
1
JAVA中GUI编程,AWT窗体上绘图,利用双缓冲解决画面闪烁效果!
2023/11/20 2:09:28 15KB JAVA 双缓冲 绘图
1
共 29 条记录 首页 上一页 下一页 尾页
在日常工作中,钉钉打卡成了我生活中不可或缺的一部分。然而,有时候这个看似简单的任务却给我带来了不少烦恼。 每天早晚,我总是得牢记打开钉钉应用,点击"工作台",再找到"考勤打卡"进行签到。有时候因为工作忙碌,会忘记打卡,导致考勤异常,影响当月的工作评价。而且,由于我使用的是苹果手机,有时候系统更新后,钉钉的某些功能会出现异常,使得打卡变得更加麻烦。 另外,我的家人使用的是安卓手机,他们也经常抱怨钉钉打卡的繁琐。尤其是对于那些不太熟悉手机操作的长辈来说,每次打卡都是一次挑战。他们总是担心自己会操作失误,导致打卡失败。 为了解决这些烦恼,我开始思考是否可以通过编写一个全自动化脚本来实现钉钉打卡。经过一段时间的摸索和学习,我终于成功编写出了一个适用于苹果和安卓系统的钉钉打卡脚本。
2024-04-09 15:03 15KB 钉钉 钉钉打卡