全文预览

画图应用程序(java)

上传者:hnxzy51 |  格式:doc  |  页数:17 |  大小:939KB

文档介绍
t(jp,BoxLayout.Y_AXIS)); //加入工具栏的组件 lcolor=newJLabel("■■■■■■");?anj0=newJButton("画笔");?anj1=newJButton("矩形");?anj2=newJButton("椭圆");?anj3=newJButton("直线"); anj4=newJButton("曲线"); anj5=newJButton("保存");?anj6=newJButton("打开"); anj7=newJButton("清空");?anj8=newJButton("选择颜色");//工具栏顺序 jp.add(anj0); jp.add(anj3); jp.add(anj4); jp.add(anj1); jp.add(anj2); jp.add(anj8); jp.add(lcolor); jp.add(anj7); jp.add(anj5); jp.add(anj6); anj0.addActionListener(this);?anj1.addActionListener(this); anj2.addActionListener(this); anj3.addActionListener(this); anj4.addActionListener(this);anj5.addActionListener(this); anj6.addActionListener(this); anj7.addActionListener(this); anj8.addActionListener(this); addMouseListener(this); addMouseMotionListener(this);?}?//记录鼠标选择的功能?publicvoidactionPerformed(ActionEvente)?{

收藏

分享

举报
下载此文档