java编写网络账号管理系统源码文档格式.docx

上传人:b****6 文档编号:19078611 上传时间:2023-01-03 格式:DOCX 页数:44 大小:903.45KB
下载 相关 举报
java编写网络账号管理系统源码文档格式.docx_第1页
第1页 / 共44页
java编写网络账号管理系统源码文档格式.docx_第2页
第2页 / 共44页
java编写网络账号管理系统源码文档格式.docx_第3页
第3页 / 共44页
java编写网络账号管理系统源码文档格式.docx_第4页
第4页 / 共44页
java编写网络账号管理系统源码文档格式.docx_第5页
第5页 / 共44页
点击查看更多>>
下载资源
资源描述

java编写网络账号管理系统源码文档格式.docx

《java编写网络账号管理系统源码文档格式.docx》由会员分享,可在线阅读,更多相关《java编写网络账号管理系统源码文档格式.docx(44页珍藏版)》请在冰豆网上搜索。

java编写网络账号管理系统源码文档格式.docx

publicstaticvoidCenter(JFrameframe){

DimensionscreenSize=Toolkit.getDefaultToolkit().getScreenSize();

DimensionframeSize=frame.getSize();

if(frameSize.height>

screenSize.height){

frameSize.height=screenSize.height;

if(frameSize.width>

screenSize.width){

frameSize.width=screenSize.width;

frame.setLocation((screenSize.width-frameSize.width)/2,

(screenSize.height-frameSize.height)/2);

frame.show();

}

importh2.alterpass;

importjava.awt.Color;

importjava.awt.Font;

importjava.awt.Graphics;

importjava.awt.Image;

importjavax.swing.JFrame;

importjavax.swing.JPanel;

importjava.awt.BorderLayout;

importjavax.swing.BoxLayout;

importjavax.swing.JButton;

importjava.awt.event.ActionListener;

importjava.awt.event.ActionEvent;

importjava.awt.CardLayout;

importjavax.swing.JSplitPane;

importjavax.swing.BorderFactory;

importjavax.swing.Box;

importjavax.swing.ImageIcon;

importjavax.swing.JLabel;

importjavax.swing.JOptionPane;

importjavax.swing.JTable;

importjavax.swing.JTextField;

importjavax.swing.JPasswordField;

importjavax.swing.SwingConstants;

importjavax.swing.JScrollPane;

importUser.*;

importh2.AddResource;

@SuppressWarnings("

serial"

publicclassWindowextendsJFrame{

privateJPanelpanelMain,panelFirst,panelAdd;

privateJButtonbtnMain,btnNet,btnAccount,btnAdd,btnExit;

privateCardLayoutcard,card1,card2;

privateJLabellbChange;

privateJTabletable1;

privateJTabletable2;

privateJTextFieldtextField;

privatestaticStringusertemp="

"

;

/**

*Createtheapplication.

*/

publicWindow(){

initWin();

initListener();

*InitiWinthecontentsoftheframe.

///============================我是华丽的分割线(>

^ω^<

)喵=====窗口实现==========================================//

publicvoidinitWin(){

this.setTitle("

网络账号管理系统"

);

this.setBounds(100,100,600,400);

this.setResizable(false);

this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JPanelpanel=newJPanel(newBorderLayout())

{

@Override

protectedvoidpaintComponent(Graphicsg){

ImageIconicon=newImageIcon(this.getClass().getResource("

res/test.jpg"

));

Imageimg=icon.getImage();

g.drawImage(img,0,0,icon.getIconWidth(),icon.getIconHeight(),icon.getImageObserver());

}

};

getContentPane().add(panel);

//=================我是华丽的分割线(>

)喵============标签栏=======================================

JPanelpanelBar=newJPanel(){

@Override

protectedvoidpaintComponent(Graphicsg){

ImageIconicon=newImageIcon(this.getClass().getResource("

Imageimg=icon.getImage();

g.drawImage(img,0,0,icon.getIconWidth(),icon.getIconHeight(),icon.getImageObserver());

};

panel.add(panelBar,BorderLayout.NORTH);

panelBar.setLayout(newBoxLayout(panelBar,BoxLayout.X_AXIS));

//IconbtnMain_icon=newImageIcon("

\btn_main.png"

);

btnMain=newJButton("

首页"

btnMain.setContentAreaFilled(false);

btnMain.setForeground(Color.white);

//btnMain.setBorder(BorderFactory.createLineBorder(Color.blue,1));

btnMain.setFont(newFont("

楷体"

Font.BOLD|Font.ITALIC,14));

//btnMain.setSize(60,27);

panelBar.add(btnMain);

btnNet=newJButton("

按网站查询"

btnNet.setContentAreaFilled(false);

btnNet.setForeground(Color.white);

btnNet.setEnabled(false);

panelBar.add(btnNet);

btnNet.setFont(newFont("

btnAccount=newJButton("

按账号查询"

btnAccount.setContentAreaFilled(false);

btnAccount.setForeground(Color.white);

btnAccount.setEnabled(false);

btnAccount.setFont(newFont("

panelBar.add(btnAccount);

btnAdd=newJButton("

添加账号"

btnAdd.setContentAreaFilled(false);

btnAdd.setEnabled(false);

btnAdd.setForeground(Color.white);

btnAdd.setFont(newFont("

panelBar.add(btnAdd);

JLabellbSpace=newJLabel("

"

panelBar.add(lbSpace);

btnExit=newJButton("

注销"

btnExit.setContentAreaFilled(false);

btnExit.setEnabled(false);

btnExit.setForeground(Color.white);

btnExit.setFont(newFont("

panelBar.add(btnExit);

//=========================我是华丽的分割线(>

)喵====主面板=====================================//

panelMain=newJPanel();

panel.add(panelMain,BorderLayout.CENTER);

card=newCardLayout();

panelMain.setLayout(card);

)喵====首页=====================================//

panelFirst=newJPanel();

card1=newCardLayout();

panelFirst.setLayout(card1);

finalJPanelLogin=newJPanel()

finalJPanelRegister=newJPanel()

finalJPanelpl3=newJPanel();

card2=newCardLayout();

///////////////////////////////////////登陆页////////////////////////////////////////////////////////////////////

Boxhbox1=Box.createHorizontalBox();

Boxhbox2=Box.createHorizontalBox();

Boxhbox3=Box.createHorizontalBox();

Boxhbox4=Box.createHorizontalBox();

Boxvbox1=Box.createVerticalBox();

JLabellbLogin=newJLabel("

用户登录"

lbLogin.setFont(newFont("

Font.BOLD,18));

lbLogin.setForeground(Color.red);

JLabellbUser=newJLabel("

用户名"

lbUser.setFont(newFont("

Font.BOLD,14));

JLabellbPwd=newJLabel("

密码"

lbPwd.setFont(newFont("

finalJTextFieldtextUser=newJTextField(20);

finalJPasswordFieldtextPwd=newJPasswordField(20);

JButtonbtnLogin=newJButton("

登录"

btnLogin.setFont(newFont("

btnLogin.addActionListener(newActionListener(){

@Override

publicvoidactionPerformed(ActionEventarg0){

//TODOAuto-generatedmethodstub

//获得输入的用户名和密码

Stringusername=textUser.getText();

charpass[]=textPwd.getPassword();

StringBuffersb=newStringBuffer();

for(inti=0;

i<

pass.length;

i++){

sb.append(pass[i]);

}

Stringpassword=sb.toString();

//判断登陆

loginlog=newlogin();

if(log.log(username,password)){

usertemp=username;

card1.show(panelFirst,"

3"

textField.setText(usertemp);

btnNet.setEnabled(true);

btnAccount.setEnabled(true);

btnAdd.setEnabled(true);

btnExit.setEnabled(true);

}

});

JButtonbtnReg=newJButton("

注册"

btnReg.setFont(newFont("

btnReg.addActionListener(newActionListener(){

publicvoidactionPerformed(ActionEvente){

card1.show(panelFirst,"

2"

hbox1.add(lbLogin);

hbox2.add(lbUser);

hbox2.add(textUser);

hbox3.add(lbPwd);

hbox3.add(textPwd);

hbox4.add(btnLogin);

hbox4.add(Box.createHorizontalStrut(20));

hbox4.add(btnReg);

vbox1.add(Box.createVerticalStrut(30));

vbox1.add(hbox1);

vbox1.add(Box.createVerticalStrut(20));

vbox1.add(hbox2);

vbox1.add(hbox3);

vbox1.add(hbox4);

Login.add(vbox1);

finalJPanelpr3=newJPanel(card2);

JSplitPaneSetting=newJSplitPane(JSplitPane.HORIZONTAL_SPLIT,pl3,pr3);

pl3.setLayout(null);

JLabellabel=newJLabel("

label.setFont(newFont("

Font.BOLD,12));

label.setBounds(5,50,50,25);

pl3.add(label);

textField=newJTextField(usertemp);

textField.setEditable(false);

textField.setBounds(45,50,100,25);

pl3.add(textField);

JLabellabel_2=newJLabel("

当前用户"

label_2.setFont(newFont("

label_2.setBounds(40,10,70,30);

pl3.add(label_2);

JButtonbutton_1=newJButton("

修改密码"

button_1.setFont(newFont("

Font.BOLD,10));

button_1.setBounds(65,90,80,25);

button_1.addActionListener(newActionListener(){

card2.show(pr3,"

1"

pl3.add(button_1);

Setting.setDividerLocation(150);

Setting.setDividerSize

(1);

Setting.setResizeWeight

(1);

////////////////////////////////////////////////////注册页面///////////////////////////////////////////////////////////////////

Boxhbox10=Box.createHorizontalBox();

Boxhbox20=Box.createHorizontalBox();

Boxhbox30=Box.createHorizontalBox();

Boxhbox40=Box.createHorizontalBox();

Boxhbox50=Box.createHorizontalBox();

Boxvbox20=Box.createVerticalBox();

JLabellbRegister=newJLabel("

用户注册"

lbRegister.setFont(newFont("

//lbRegister.setForeground(newColor(180,50,200));

lbRegister.setForegroun

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高中教育 > 数学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1