uml建模技术-图书管理系统为例建模过程3.rtf

上传人:qwe****56 文档编号:74654426 上传时间:2023-02-27 格式:RTF 页数:6 大小:19.07KB
返回 下载 相关 举报
uml建模技术-图书管理系统为例建模过程3.rtf_第1页
第1页 / 共6页
uml建模技术-图书管理系统为例建模过程3.rtf_第2页
第2页 / 共6页
点击查看更多>>
资源描述

《uml建模技术-图书管理系统为例建模过程3.rtf》由会员分享,可在线阅读,更多相关《uml建模技术-图书管理系统为例建模过程3.rtf(6页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、22-1import java.applet.*;import java.awt.*;public class Example22_1 extends Applet Image img;public void start()img=getImage(getCodeBase(),vintdev.jpg);public void paint(Graphics g)g.drawImage(img,2,2,this);22-2import java.applet.*;import java.awt.*;public class Example22_2 extends Applet Image img;

2、int height,width;public void start()img=getImage(getCodeBase(),vintdev.jpg);height=img.getHeight(this);width=img.getWidth(this);public void paint(Graphics g)g.drawImage(img,22,72,width,height,this);g.drawImage(img,2+width,2+height,width,height,this);22-3import java.applet.*;import java.awt.*;public

3、class Wuqiong extends Applet static Image img;Canvas canvas;static int width,height;public void init()setLayout(new GridLayout(3,1);add(new Button();add(new Button();canvas=new Mycanvas();add(canvas);width=getSize().width;height=getSize().height;public void start()img=getImage(getCodeBase(),Tom1.jpg

4、);class Mycanvas extends Canvas public void paint(Graphics g)g.drawImage(Wuqiong.img,0,0,Wuqiong.width,(Wuqiong.height)/3,this);22-4import java.applet.*;import java.awt.*;import java.awt.event.*;public class Example22_4 extends Applet implements MouseListenerfinal int number=38;int count=0;Image car

5、d=new Imagenumber;public void init()addMouseListener(this);for(int i=0;inumber)count=0;repaint();public void mouseReleased(MouseEvent e)public void mouseEntered(MouseEvent e)public void mouseExited(MouseEvent e)public void mouseClicked(MouseEvent e)22-5import java.applet.*;import java.awt.*;import j

6、ava.awt.event.*;public class Example22_5 extends Applet implements Runnablefinal int number=59;int count=0;Thread mythread;Image pic=new Imagenumber;public void init()for(int i=0;i59)count=0;repaint();count+;trymythread.sleep(200);catch(InterruptedException e)public void paint(Graphics g)if(piccount

7、)!=null)g.drawImage(piccount,10,10,piccount.getWidth(this),piccount.getHeight(this),this);22-6import java.applet.*;import java.awt.*;import java.awt.event.*;class Imagecanvas extends Canvas Toolkit tool;Image myimage;Imagecanvas()getSize();tool=getToolkit();/Toolkit myimage=tool.getImage(apple.jpg);

8、/tool public void paint(Graphics g)g.drawImage(myimage,10,10,myimage.getWidth(this),myimage.getHeight(this),this);public Dimension getPreferredSize()return new Dimension(160,100);public class Example22_6 public static void main(String args)Imagecanvas canvas=new Imagecanvas();Frame frame=new Frame()

9、;frame.setLayout(new BorderLayout();frame.add(canvas,Center);frame.add(South,new Label();frame.add(West,new Label();frame.add(North,new Label();frame.setSize(400,300);frame.setVisible(true);frame.pack();frame.addWindowListener(new WindowAdapter()public void windowClosing(WindowEvent e)System.exit(0)

10、;);22-7import java.applet.*;import java.awt.*;import java.awt.event.*;class Imagecanvas extends Canvas implements MouseListenerfinal int number=59;int count=0;Toolkit tool;Image card=new Imagenumber;Imagecanvas()getSize();tool=getToolkit();addMouseListener(this);for(int i=0;inumber-1)count=0;repaint

11、();public void mouseReleased(MouseEvent e)public void mouseEntered(MouseEvent e)public void mouseExited(MouseEvent e)public void mouseClicked(MouseEvent e)public class Example226 public static void main(String args)Imagecanvas canvas=new Imagecanvas();Frame frame=new Frame();frame.setLayout(new Bord

12、erLayout();frame.add(canvas,Center);frame.add(South,new Label();frame.add(West,new Label();frame.add(North,new Label();frame.setSize(400,300);frame.setVisible(true);frame.pack();frame.addWindowListener(new WindowAdapter()public void windowClosing(WindowEvent e)System.exit(0););22-8import java.awt.*;

13、import java.awt.event.*;public class Frame_Icon public static void main(String args)Frame frame=new Frame();Toolkit tool=frame.getToolkit();/Toolkit Image myimage=tool.getImage(apple.jpg);/tool /myimageapple.jpg frame.setIconImage(myimage);frame.setSize(400,300);frame.setVisible(true);frame.addWindowListener(new WindowAdapter()public void windowClosing(WindowEvent e)System.exit(0););

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 技术资料 > 其他杂项

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁