91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 8KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-04
  • 語言: Java
  • 標(biāo)簽:

資源簡介

簡易寵物商店的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;//紀(jì)錄數(shù)組最大編號,已經(jīng)有5個數(shù)據(jù),本應(yīng)該是從-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);//列表顯示行數(shù)
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(“關(guān)鍵字查詢“));
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\MyJframe.class

?????文件????????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


評論

共有 條評論