资源简介
简易宠物商店的Java源代码,eclipse,有txt说明

代码片段和文件信息
package petShop3;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
class MyJframe extends MouseAdapter implements ActionListener{
Jframe main;
JPanel p1p2p3;
JList list;
JButton button1button2button3;
JTextField text1text2text3;
JRadioButton radio1radio2;
static String cat = “猫“;
static String dog = “狗“;
JLabel label1label2label3;
JTextArea textarea;
String[] pet;
String[] name;
String[] color;
int now=4;//纪录数组最大编号,已经有5个数据,本应该是从-1开始
MyJframe(){
main = new Jframe();
main.settitle(“宠物商店“);
Container content = main.getContentPane();
pet = new String[10];
name = new String[10];
color = new String[10];
for(int i=0;i<3;i++)
pet[i]=cat;
for(int i=3;i<5;i++)
pet[i]=dog;
name[0]=“阿瓜“; name[1]=“白猫“; name[2]=“黑色富丽雅“; name[3]=“青铜树“; name[4]=“阿黄“;
color[0]=“黑“; color[1]=“白“; color[2]=“棕“; color[3]=“黄“; color[4]=“黑“;
p1 = new JPanel();
p1.setBorder(BorderFactory.createtitledBorder(“宠物列表“));
p1.setBackground(Color.PINK);
list = new JList();
list.setVisibleRowCount(6);//列表显示行数
Font display = new Font(null Font.PLAIN 15);
list.setFont(display);
JScrollPane listPane = new JScrollPane(list);//滚动条
p1.add(listPane);
list.setListData(name);
list.setSelectedIndex(0);
list.addMouseListener(this);
p2 = new JPanel();
p2.setBorder(BorderFactory.createtitledBorder(“关键字查询“));
p2.setLayout(new BorderLayout());
JPanel tem1 =new JPanel();
button1 = new JButton(“查询“);
button1.addActionListener(this);
text1 = new JTextField(20);
tem1.add(text1);
tem1.add(button1);
JPanel tem2 =new JPanel();
textarea = new JTextArea();
textarea.setLineWrap(true);
Font f=new Font(null Font.CENTER_baseLINE 11);
textarea.setFont(f);
textarea.setRows(3);
JScrollPane jsp = new JScrollPane(textarea);
p2.add(tem1 BorderLayout.NORTH);
p2.add(jsp BorderLayout.CENTER);
p3 = new JPanel();
p3.setLayout(new BorderLayout());
radio1 = new JRadioButton(cat);
radio2 = new JRadioButton(dog);
ButtonGroup group = new ButtonGroup();
group.add(radio1);
group.add(radio2);
radio1.addActionListener(this);
radio2.addActionListener(this);
label1 = new JLabel(“名字“);
label2 = new JLabel(“颜色“);
label3 = new JLabel();
text2 = new JTextField(““);
text3 = new JTextField(““);
button2 = new JButton(“添加“);
button3 = new JButton(“删除“);
button2.addActionListener(this);
button3.addActionListener(this);
JPanel temp1 = new JPanel();
temp1.setLayout(new GridLayout(2 2));
temp1.setBackground(Color.PINK);
temp1.add(new JLabel());
temp1.add(new JLabel());
temp1.add(radio1);
temp1.add(radio2);
p3.add(temp1 BorderLayout.NORTH);
JPanel temp2 = new JPanel();
temp2.setLayout(new GridLayout(5 1));
temp2.setBackground(Color.PINK);
temp2.add(label1);
temp2.add(text2);
temp2.add(label2);
temp2.add(text3);
temp2.add(label3);
p3.add(te
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 301 2016-12-23 13:47 petShop3\.classpath
文件 384 2016-12-23 13:47 petShop3\.project
文件 598 2016-12-23 13:47 petShop3\.settings\org.eclipse.jdt.core.prefs
文件 7499 2016-12-25 16:21 petShop3\bin\petShop3\MyJfr
文件 432 2016-12-25 16:21 petShop3\bin\petShop3\PetShopDemo.class
文件 6220 2016-12-25 00:25 petShop3\src\petShop3\PetShopDemo.java
文件 480 2016-12-23 23:56 petShop3\宠物商店.txt
目录 0 2016-12-25 16:21 petShop3\bin\petShop3
目录 0 2016-12-23 13:48 petShop3\src\petShop3
目录 0 2016-12-23 13:47 petShop3\.settings
目录 0 2016-12-25 16:21 petShop3\bin
目录 0 2016-12-23 13:48 petShop3\src
目录 0 2016-12-24 00:05 petShop3
----------- --------- ---------- ----- ----
15914 13
- 上一篇:人力资源管理系统带数据库
- 下一篇:身高测算Android软件
相关资源
- 《程序员代码面试指南 》左神 高清
- 简易C语言编译器Java源代码
- 酒店管理系统JAVA源代码245552
- 飞机大战/雷霆战机 全部Java源代码,
- 图书馆管理系统java源代码
- 超市收银系统java源代码264295
- 仓库管理系统+JAVA源代码++设计说明
- java源代码 人事管理系统
- 超市管理系统——Java源代码
- java电子邮件收发系统 java源代码
- 空当接龙java源代码
- java源代码,java源代码
- 仓库管理系统JAVA源代码
- 学生信息管理系统含Java源代码 毕业论
- 5款新闻发布系统JSP+JAVA源代码
- 网上商城java源代码
- 航空售票管理信息系统内含数据库文
- 自己开发的消灭星星android-java源代码
- 上位机源代码java源代码
- KTV点歌系统(JAVA+MYSQL)
- java项目实-科研信息发布平台.zip
- 当当网网上书店java源代码
- 物流信息管理系统 java源代码
- 飞机大战java源代码
- java电子邮件收发系统 java源代码2.2版
- 人事管理系统java源代码和数据库SQL
- 一个家庭记账的java源代码
- 条件随机场(CRF)的Java源代码实现最
- 日记本java源代码
- 学生信息管理系统含Java源代码
评论
共有 条评论