• 大小: 24.87MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-29
  • 语言: Java
  • 标签: java  

资源简介

java项目开发实战密码(代码)

资源截图

代码片段和文件信息

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.imageio.ImageIO;
import java.io.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;

public class Painter extends Jframe implements ActionListener {
private Container c = getContentPane();
private String menuBar[]={“文件(F)““编辑(E)““视图(V)““说明(H)“};
private String menuItem[][]={
{“新建(N)|78““打开(O)|79““保存(S)|83““另存为(A)““退出(X)|88“}
{“撤消(U)|90““重复(R)|89““剪切(T)|87““复制(C)|68““粘贴(P)|85“}
{“工具箱(T)|84““色块(C)|76““状态栏(S)““属性栏(M)“}
{“关于七喜猫猫画板(A)“}
};
private JMenuItem jMenuItem[][]=new JMenuItem[4][5];
private JMenu jMenu[];
private JCheckBoxMenuItem jCheckBoxMenuItem[] = new JCheckBoxMenuItem[4];
private String ButtonName[]={“直线““矩开““椭圆““圆角矩形““贝氏曲线““扇型““多边形““铅笔““橡皮擦““文字““选取“};
private JToggleButton jToggleButton[];
    private ButtonGroup buttonGroup;
private JPanel jPanel[]=new JPanel[5];//1绘图区2工具箱3色块4属性栏
private JLabel jLabel[]=new JLabel[1];//状态列
private String toolname[]= 
{“img/tool1.gif““img/tool2.gif““img/tool3.gif““img/tool4.gif““img/tool5.gif““img/tool8.gif““img/tool9.gif““img/tool7.gif““img/tool6.gif““img/tool10.gif““img/tool11.gif“};
private Icon tool[]=new ImageIcon[11];
private int ijshow_xshow_ydrawMethod=7draw_panel_width=700draw_panel_height=500;
private Paint color_bordercolor_inside;
private SetPanel setPanel;
private DrawPanel drawPanel;
private UnderDrawPanel underDrawPanel;
private ColorPanel colorPanel;
private Stroke stroke;
private Shape shape;
private String isFilled;


public Painter(){
//设定JMenuBar,并产生MenuItem、并设置快捷键
JMenuBar bar = new JMenuBar();
jMenu=new JMenu[menuBar.length];
for(i=0;i jMenu[i] = new JMenu(menuBar[i]);
jMenu[i].setMnemonic(menuBar[i].split(“\\(“)[1].charAt(0));
bar.add(jMenu[i]);
}

for(i=0;i for(j=0;j if(i==0 && j==4 || i==1 && j==2) jMenu[i].addSeparator();
if(i!=2){
jMenuItem[i][j] = new JMenuItem(menuItem[i][j].split(“\\|“)[0]);
if(menuItem[i][j].split(“\\|“).length!=1)
jMenuItem[i][j].setAccelerator(KeyStroke.getKeyStroke(Integer.parseInt(menuItem[i][j].split(“\\|“)[1])  
ActionEvent.CTRL_MASK) );
jMenuItem[i][j].addActionListener(this);
jMenuItem[i][j].setMnemonic(menuItem[i][j].split(“\\(“)[1].charAt(0));

jMenu[i].add(jMenuItem[i][j]);
}
else{
jCheckBoxMenuItem[j] = new JCheckBoxMenuItem(menuItem[i][j].split(“\\|“)[0]);
if(menuItem[i][j].split(“\\|“).length!=1)
jCheckBoxMenuItem[j].setAccelerator(KeyStroke.getKeyStroke(Integer.parseInt(menuItem[i][j].split(“\\|“)[1])  
ActionEvent.CTRL_MASK) );
jCheckBoxMenuItem[j].addActionListener(this);
jCheckBoxMenuItem[j].setMnemonic(menuItem[i][j].split(“\\(“)[1].charAt(0));
jCheckBoxMenuIt

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        232  2015-07-24 15:42  daima\num_01\001\.classpath

     文件        379  2015-07-24 15:42  daima\num_01\001\.project

     文件        190  2015-07-24 15:40  daima\num_01\001\bin\.classpath

     文件        391  2010-06-03 13:52  daima\num_01\001\bin\.project

     文件        836  2004-05-23 20:40  daima\num_01\001\bin\img\icon1.gif

     文件        868  2004-05-23 20:43  daima\num_01\001\bin\img\icon2.gif

     文件        948  2004-05-23 21:54  daima\num_01\001\bin\img\icon3.gif

     文件        835  2004-05-23 22:00  daima\num_01\001\bin\img\icon4.gif

     文件       1558  2004-06-02 01:42  daima\num_01\001\bin\img\paint.gif

     文件        120  2004-05-25 00:52  daima\num_01\001\bin\img\tool1.gif

     文件        130  2004-05-29 18:16  daima\num_01\001\bin\img\tool10.gif

     文件        127  2004-05-30 22:41  daima\num_01\001\bin\img\tool11.gif

     文件        138  2004-05-25 00:51  daima\num_01\001\bin\img\tool2.gif

     文件        138  2004-05-25 00:51  daima\num_01\001\bin\img\tool3.gif

     文件        140  2004-05-25 00:51  daima\num_01\001\bin\img\tool4.gif

     文件        123  2004-05-27 00:53  daima\num_01\001\bin\img\tool5.gif

     文件        893  2004-05-27 00:55  daima\num_01\001\bin\img\tool6.gif

     文件        890  2004-05-27 00:56  daima\num_01\001\bin\img\tool7.gif

     文件        134  2004-05-27 01:07  daima\num_01\001\bin\img\tool8.gif

     文件        140  2004-05-29 00:33  daima\num_01\001\bin\img\tool9.gif

     文件      10145  2015-07-24 15:54  daima\num_01\001\bin\Painter$ColorPanel.class

     文件      18652  2015-07-24 15:54  daima\num_01\001\bin\Painter$DrawPanel.class

     文件       1277  2015-07-24 15:54  daima\num_01\001\bin\Painter$Gradient.class

     文件       6556  2015-07-24 15:54  daima\num_01\001\bin\Painter$SetPanel.class

     文件       3855  2015-07-24 15:54  daima\num_01\001\bin\Painter$UnderDrawPanel.class

     文件      12804  2015-07-24 15:54  daima\num_01\001\bin\Painter.class

     文件        190  2015-07-24 15:40  daima\num_01\001\src\.classpath

     文件        391  2010-06-03 13:52  daima\num_01\001\src\.project

     文件        836  2004-05-23 20:40  daima\num_01\001\src\img\icon1.gif

     文件        868  2004-05-23 20:43  daima\num_01\001\src\img\icon2.gif

............此处省略2843个文件信息

评论

共有 条评论