资源简介
动物识别专家系统,可以添加知识库并查找,有界面,包含源代码和jar文件
代码片段和文件信息
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.Jframe;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.UIManager;
@SuppressWarnings(“unchecked“)
public class zooKnow extends Jframe {
private static final long serialVersionUID = -5338362310060106193L;
private JPanel contentPane;
private JPanel panelpanel1panel2panel3panel4panel5;
private JButton but1but2addAnimaladdFeaturebutton1button2button3;
private JLabel lablabel1label2label3;
CardLayout card;
private JTextField field1field2field3;
private int featureNum;
String chooseNum[]=new String[10]; //存放选取的条件
String animal[]=new String[10]; //存放添加的动物,与上面条件对应
String features=““selected=““; //存放一次添加的条件存放选取的条件
private int j=0; //记录添加的动物号
private int length1=0;
// 创建控件文本数组
private String[] labels = new String[]{ “有毛发““有奶““有羽毛““会飞““吃肉“ //0-4
“有犬齿““有爪““眼盯前方““哺乳动物““有蹄“ //5-9
“反刍““食肉动物““黄褐色““有暗斑点““黑色条纹“ //10-14
“有蹄类动物““有长脖子““有长腿““不会飞““有黑白二色“ //15-19
“会游泳““是鸟““产蛋““善飞“ }; //20-23
private ArrayList list1=new ArrayList();
private JCheckBox[] boxs;// 创建控件数组
public static void main(String[] args) {
try {
UIManager
.setLookAndFeel(“com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel“);
} catch (Throwable e) {
e.printStackTrace();
}
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
zooKnow frame = new zooKnow();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
//******************************************布局文件***************************************************8
public zooKnow() {
for(int i=0;i<10;i++)
{
chooseNum[i]=““;
}
for(String a: labels)
{
list1.add(a);
}
boxs= new JCheckBox[list1.size()];
// System.out.println(boxs.length);
settitle(“动物识别系统“);
setDefaultCloseOperation(Jframe.EXIT_ON_CLOSE);
setBounds(100 100 409 331);
// Container con=new Container();
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5 5 5 5));
contentPane.setLayout(new BorderLayout(0 0));
contentPane.setBackground(Color.green);
setContentPane(contentPane);
l
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 10408 2015-05-14 13:58 zooKnow.java
文件 109640 2015-05-17 09:07 动物识别.jar
----------- --------- ---------- ----- ----
120048 2
- 上一篇:Java实现野人过河问题含界面
- 下一篇:XSS检测原型系统
评论
共有 条评论