老熟女激烈的高潮_日韩一级黄色录像_亚洲1区2区3区视频_精品少妇一区二区三区在线播放_国产欧美日产久久_午夜福利精品导航凹凸

重慶分公司,新征程啟航

為企業提供網站建設、域名注冊、服務器等服務

系統設計代碼java 系統設計代碼設計

java通訊錄管理系統設計代碼怎么編譯

java編寫這個通訊錄管理系統

作為一家“創意+整合+營銷”的成都網站建設機構,我們在業內良好的客戶口碑。創新互聯公司提供從前期的網站品牌分析策劃、網站設計、成都做網站、網站設計、創意表現、網頁制作、系統開發以及后續網站營銷運營等一系列服務,幫助企業打造創新的互聯網品牌經營模式與有效的網絡營銷方法,創造更大的價值。

java編寫這個通訊錄管理系統_Java如何實現通訊錄管理系統

咕嚕嚕在芬蘭

原創

關注

3點贊·2305人閱讀

Java如何實現通訊錄管理系統

發布時間:2020-07-28 09:39:42

來源:億速云

閱讀:65

作者:Leah

這篇文章將為大家詳細講解有關Java如何實現通訊錄管理系統,文章內容質量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關知識有一定的了解。

本文實例為大家分享了java實現通訊錄管理系統的具體代碼,供大家參考,具體內容如下

完成項目的流程:

1.根據需求,確定大體方向

2.功能模塊分析

3.界面實現

4.功能模塊設計

5.coding

6.代碼測試

下面是源代碼:import java.awt.Container;

import java.awt.GridLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.io.BufferedReader;

import java.io.FileNotFoundException;

import java.io.FileReader;

import java.io.FileWriter;

import java.io.IOException;

import java.util.ArrayList;

import java.util.Scanner;

import java.util.concurrent.SynchronousQueue;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JPanel;

import javax.swing.WindowConstants;

import javax.swing.text.html.HTMLDocument.Iterator;

class Infro{

public String id;

public String name;

public String sex;

public String address;

public String e_mail;

public String phoneNumber;

static int index = 0;

static ArrayList list = new ArrayList();

static int len = list.size();

//構造函數

public Infro(String id,String name,String sex,String address,String e_mail,String phoneNumber){

this.id = id;

this.name = name;

this.sex = sex;

this.address = address;

this.e_mail = e_mail;

this.phoneNumber = phoneNumber;

}

public String toString(){

return "編號:"+id+" 姓名:"+name+" 性別:"+sex+" 通訊地址:"+address+" 郵箱地址:"+e_mail+" 電話:"+phoneNumber;

}

/**

* 添加功能

**/

public static void addFunction(){//添加功能

Infro infro = new Infro("","","","","","");

System.out.println("請輸入添加的數據:");

Scanner in = new Scanner(System.in);

System.out.println("輸入編號:");

infro.id = in.next();

System.out.println("輸入姓名:");

infro.name = in.next();

System.out.println("輸入性別:");

infro.sex = in.next();

System.out.println("輸入通訊地址:");

infro.address = in.next();

System.

out.println("輸入郵箱地址:");

infro.e_mail = in.next();

System.out.println("輸入電話:");

infro.phoneNumber = in.next();

list.add(index,infro);

index++;

if(list.isEmpty()){

System.out.println("數據添加失敗啦");

}else{

System.out.println("數據添加成功啦");

len++;//list集合長度加一

// System.out.println(list.get(0).toString());

}

}

// public static void deleteFunction(){//刪除功能

// System.out.println("輸入要刪除的聯系人的編號");

// Scanner in_2 = new Scanner(System.in);

// String d1 = in_2.nextLine();

// for(int a= 0; a

// if(d1.equals(list.get(a).id)){

// list.remove(list.get(a));

// len --;

// }

// }

// }

/**

* 刪除功能

**/

public static void deleteFunction(){

System.out.println("輸入要刪除的聯系人的編號");

Scanner in_2 = new Scanner(System.in);

String d1 = in_2.nextLine();

java.util.Iterator it = list.iterator();

while (it.hasNext()){

Infro infro = it.next();

if (infro.id.equals(d1)){

it.remove();

--index;//一定要加這個,否則當做了刪除操作再做添加操作的時候會出現異常(類似于指針,棧)

System.out.println("刪除完畢"+"此時通訊錄記錄條數為:" + --len);

}

}

}

/**

* 修改功能

**/

public static void reditFunction(){

System.out.println("輸入要修改的通訊錄的Id");

Scanner in_r = new Scanner(System.in);

String r1 = in_r.nextLine();

for(int a = 0; a len;a++){

if(r1.equals(list.get(a).id)){

System.out.println("輸入修改后的姓名:");

String name_1 = in_r.next();

list.get(a).name = name_1;

System.out.println("輸入修改后的性別:");

String sex_1 = in_r.next();

list.get(a).sex = sex_1;

System.out.println("輸入修改后的通訊地址:");

String address_1 = in_r.next();

list.get(a).address = address_1;

System.out.println("輸入修改后的郵箱地址:");

String e_mail_1 = in_r.next();

list.get(a).e_mail = e_mail_1;

System.out.println("輸入修改后的電話:");

String phoneNumber_1 = in_r.next();

list.get(a).phoneNumber = phoneNumber_1;

System.out.println("數據修改完畢");

}

}

}

/**

* 查詢功能

**/

public static void searchFunction() throws Exception{//查詢功能

System.out.println("請輸入要查詢的姓名:");

Scanner in_1 = new Scanner(System.in);

String s1=in_1.nextLine();

for(int a= 0; a

if(s1.equals(list.get(a).name)){

System.out.println(list.get(a).toString());

}

}

}

/**

* 顯示功能

**/

public static void showFunction(){

for(int i = 0 ;i

System.out.println(list.get(i).toString());

}

}

/**

* 保存功能

**/

public static void writeFunction() throws IOException{

FileWriter writer = new FileWriter("通訊錄管理.txt");

for(int i = 0 ;i

String []strwriter = new String[len];

strwriter[i]=list.get(i).toString();

writer.write(strwriter[i]);

writer.write("\r\n");

System.out.println("成功寫入一行數據到 通訊錄管理.txt 中");

}

writer.close();//關閉寫入流,釋放資源

}

/**

* 讀取功能

**/

public static void readFunction() throws IOException{

FileReader reader = new FileReader("通訊錄管理.txt");

BufferedReader br = new BufferedReader(reader);

String str;

while((str = br.readLine()) != null){//每次讀取一行文本,判斷是否到達文件尾

System.out.println(str);

}

br.close();

}

}

public class Demo extends JFrame {

/**

* 界面設計

**/

public Demo(){

Container c = getContentPane(); //定義一個頂級容器c

JPanel jp = new JPanel(); //新建JPanel面板--jp

JButton button1 = new JButton("新建聯系人");

JButton button2 = new JButton("刪除聯系人");

JButton button3 = new JButton("編輯聯系人");

JButton button4 = new JButton("查找聯系人");

JButton button5 = new JButton("顯示所有聯系人");

JButton button6 = new JButton("保存聯系人到本地");

JButton button7 = new JButton("讀取本地聯系人");

jp.setLayout(new GridLayout(2,4,5,5));//新建網格布局管理器(行數,列數,組件間的水平垂直間距)

jp.add(button1);

jp.add(button2);

jp.add(button3);

jp.add(button4);

jp.add(button5);

jp.add(button6);

jp.add(button7);

c.add(jp);//將JPanel面板jp添加到頂級容器c中

setSize(600,500);

setTitle("*通 訊 錄 管 理 系 統*");

setVisible(true);

setResizable(false);//窗體大小由程序員決定,用戶不能自由改變大小

setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

/**

*按鍵響應

*

**/

button1.addActionListener(new ActionListener(){//添加功能實現

public void actionPerformed(ActionEvent arg0){

Infro.addFunction();

}

});

button2.addActionListener(new ActionListener(){//刪除功能實現

public void actionPerformed(ActionEvent arg0){

Infro.deleteFunction();

}

});

button3.addActionListener(new ActionListener(){//修改功能實現

public void actionPerformed(ActionEvent arg0){

Infro.reditFunction();

}

});

button4.addActionListener(new ActionListener(){//查詢功能實現

public void actionPerformed(ActionEvent arg0){

try {

Infro.searchFunction();

} catch (Exception e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

});

button5.addActionListener(new ActionListener(){//顯示功能實現

public void actionPerformed(ActionEvent arg0){

Infro.showFunction();

}

});

button6.addActionListener(new ActionListener(){//保存功能實現

public void actionPerformed(ActionEvent arg0){

try {

Infro.writeFunction();

} catch (IOException e) {

e.printStackTrace();

}

}

});

button7.addActionListener(new ActionListener(){//讀取功能實現

public void actionPerformed(ActionEvent arg0){

try {

Infro.readFunction();

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

});

}

public static void main(String[] args) {

// TODO Auto-generated method stub

new Demo();

Infro a = new Infro("", "", "", "", "", "");

}

}

關于Java如何實現通訊錄管理系統就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。

用java編寫的商品庫存管理系統的設計思路以及源代碼是什么?

既然是商品庫存系統,那么最少有各種商品的單件信息,1:需要有商品的進貨價格,賣出價格,剩余數量,每月的銷售數量,進貨時間等,在對應的數據庫表創建相應的字段。2:商品管理就是對多種商品的管理,所以還要有各種商品的分類,比如煙酒類,飲料類,小吃類,將其分類好管理,同樣數據庫里面建立相對的數據表。具體需要根據自己需求來編寫。3:界面的設計,這里可分為登陸界面,其中一個是用戶登陸后查看的界面,和管理員登陸后查看的界面,用戶登錄只能查看對應的商店的物品管理,并且能進行修改自家商品。管理員登陸可查看所有的用戶的商店物品,及修改物品信息。而物品分類欄就可以用jQuery來實現局部的刷新界面。左邊為物品分類欄,右邊為選中物品類的信息。點擊右邊分類物品的某件物品,可跳轉到該類物品的單個信息,如第1點提到的。

java設計個小系統

100來行就能實現個系統?樓主想簡單了。不過你可以參考我的這個:

import javax.swing.JTable;

import javax.swing.table.AbstractTableModel;

import javax.swing.JScrollPane;

import javax.swing.JFrame;

import javax.swing.SwingUtilities;

import javax.swing.JOptionPane;

import java.awt.*;

import java.awt.event.*;

public class TableDemo extends JFrame

{

private boolean DEBUG = true;

public TableDemo()

{ //實現構造方法

super("RecorderOfWorkers"); //首先調用父類JFrame的構造方法生成一個窗口

MyTableModel myModel = new MyTableModel();//myModel存放表格的數據

JTable table = new JTable(myModel);//表格對象table的數據來源是myModel對象

table.setPreferredScrollableViewportSize(new Dimension(500, 70));//表格的顯示尺寸

//產生一個帶滾動條的面板

JScrollPane scrollPane = new JScrollPane(table);

//將帶滾動條的面板添加入窗口中

getContentPane().add(scrollPane, BorderLayout.CENTER);

addWindowListener(new WindowAdapter() {//注冊窗口監聽器

public void windowClosing(WindowEvent e) {

System.exit(0);

}

});

}

//把要顯示在表格中的數據存入字符串數組和Object數組中

class MyTableModel extends AbstractTableModel {

//表格中第一行所要顯示的內容存放在字符串數組columnNames中

final String[] columnNames = {"First Name",

"Position",

"Telephone",

"MonthlyPay",

"Married"};

//表格中各行的內容保存在二維數組data中

final Object[][] data = {

{"Wang Yi", "Executive",

"01068790231", new Integer(5000), new Boolean(false)},

{"Li Si", "Secretary",

"01069785321", new Integer(3500), new Boolean(true)},

{"Li Wu", "Manager",

"01065498732", new Integer(4500), new Boolean(false)},

{"Zhao Liu", "Safeguard",

"01062796879", new Integer(2000), new Boolean(true)},

{"Chen Qi", "Salesman",

"01063541298", new Integer(4000), new Boolean(false)}

};

//下述方法是重寫AbstractTableModel中的方法,其主要用途是被JTable對象調用,///以便在表格中正確的顯示出來。程序員必須根據采用的數據類型加以恰當實現。

//獲得列的數目

public int getColumnCount() {

return columnNames.length;

}

//獲得行的數目

public int getRowCount() {

return data.length;

}

//獲得某列的名字,而目前各列的名字保存在字符串數組columnNames中

public String getColumnName(int col) {

return columnNames[col];

}

//獲得某行某列的數據,而數據保存在對象數組data中

public Object getValueAt(int row, int col) {

return data[row][col];

}

//判斷每個單元格的類型

public Class getColumnClass(int c) {

return getValueAt(0, c).getClass();

}

//將表格聲明為可編輯的

public boolean isCellEditable(int row, int col) {

if (col 2) {

return false;

} else {

return true;

}

}

//改變某個數據的值

public void setValueAt(Object value, int row, int col) {

if (DEBUG) {

System.out.println("Setting value at " + row + "," + col

+ " to " + value

+ " (an instance of "

+ value.getClass() + ")");

}

if (data[0][col] instanceof Integer

!(value instanceof Integer)) {

try {

data[row][col] = new Integer(value.toString());

fireTableCellUpdated(row, col);

} catch (NumberFormatException e) {

JOptionPane.showMessageDialog(TableDemo.this,"The " + getColumnName(col)

+ " column accepts only integer values.");

}

} else {

data[row][col] = value;

fireTableCellUpdated(row, col);

}

if (DEBUG) {

System.out.println("New value of data:");

printDebugData();

}

}

private void printDebugData() {

int numRows = getRowCount();

int numCols = getColumnCount();

for (int i=0; i numRows; i++) {

System.out.print(" row " + i + ":");

for (int j=0; j numCols; j++) {

System.out.print(" " + data[i][j]);

}

System.out.println();

}

System.out.println("--------------------------");

}

}

public static void main(String[] args) {

TableDemo frame = new TableDemo();

frame.pack();

frame.setVisible(true);

}

}

求JAVA編程,做一個用戶登錄系統的設計!

import java.awt.HeadlessException;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.ImageIcon;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JPasswordField;import javax.swing.JTextField;@SuppressWarnings("serial")public class MainFrame extends JFrame { JLabel lbl1 = new JLabel("用戶名:"); JLabel lbl2 = new JLabel("密 碼:"); JTextField txt = new JTextField("admin",20); JPasswordField pwd = new JPasswordField(20); JButton btn = new JButton("登錄"); JPanel pnl = new JPanel(); private int error = 0; public MainFrame(String title) throws HeadlessException { super(title); init(); } private void init() { this.setResizable(false); pwd.setEchoChar('*'); pnl.add(lbl1); pnl.add(txt); pnl.add(lbl2); pnl.add(pwd); pnl.add(btn); this.getContentPane().add(pnl); btn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if ("admin".equals(new String(pwd.getPassword()))){ pnl.removeAll(); JLabel lbl3 = new JLabel(); ImageIcon icon = new ImageIcon(this.getClass().getResource("pic.jpg")); lbl3.setIcon(icon); pnl.add(lbl3); } else{ if(error 3){ JOptionPane.showMessageDialog(null,"密碼輸入錯誤,請再試一次"); error++; } else{ JOptionPane.showMessageDialog(null,"對不起,您不是合法用戶"); txt.setEnabled(false); pwd.setEnabled(false); btn.setEnabled(false); } } } }); } public static void main(String[] args) { MainFrame frm = new MainFrame("測試"); frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frm.setBounds(100, 100, 300, 120); frm.setVisible(true); }}


本文名稱:系統設計代碼java 系統設計代碼設計
轉載來于:http://www.xueling.net.cn/article/doocjeh.html

其他資訊

在線咨詢
服務熱線
服務熱線:028-86922220
TOP
主站蜘蛛池模板: 2021国产精品自在自线 | 亚洲欧洲日韩在线 | 少妇又紧又粗又爽的视频 | 欧美福利在线 | 欧美1区视频 | 亚洲午夜久久久久久久久久 | 性爱在线免费视频 | 亚洲第十页 | 人妖一区二区三区 | 中文字幕亚洲码在线观看 | 有码中文 | 乱一色一乱一性一视频 | 夜夜爱夜夜操 | 午夜香蕉成视频人网站 | 懂色av一区二区三区 | 日本一二三区在线 | 国产美女黄色 | 就要干就要操就要日 | 美美女高清毛片视频免费观看 | 中国性猛交xxxx乱大交3 | 国产精品露脸国语对白 | 狠狠躁夜夜躁人人爽天天30人 | 中文字幕亚洲精品在线观看 | 天美av一区二区三区久久 | 日韩欧美精 | 卡通动漫av| 国产精品久久久久影院色老大 | 国产美女视频黄a片免费观看软件 | 欧美一级淫片免费视频欧美辣图 | 粗大猛烈进出高潮视频大全 | 国产色婷婷久久99精品91 | 两个人看的www在线观看视频 | 美女裸体十八禁免费网站 | h肉动漫在线观看免费资源 久久精品视频99 | 完美世界免费完整观看 | 国变精品美女久久久久av爽 | 日韩高清中文字幕 | 91热爆在线?看 | 四虎国产成人永久精品免费 | 精品熟女日韩中文十区 | 欧美一级一级 |