bl双性强迫侵犯h_国产在线观看人成激情视频_蜜芽188_被诱拐的少孩全彩啪啪漫画

退出登錄用java代碼,java用戶登錄代碼

實(shí)現(xiàn) 界面登陸 退出 功能的java代碼雜寫

CS結(jié)構(gòu)系統(tǒng)的退出如下:public void init() {

10多年的策勒網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。營銷型網(wǎng)站建設(shè)的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整策勒建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。成都創(chuàng)新互聯(lián)從事“策勒網(wǎng)站設(shè)計(jì)”,“策勒網(wǎng)站推廣”以來,每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。

this.setTitle("用戶登錄界面");

this.add(createCenterPane());

this.setDefaultCloseOperation(this.DO_NOTHING_ON_CLOSE);

this.setSize(new Dimension(450, 335));

this.setLocationRelativeTo(null);

// this.setVisible(true);

this.addWindowListener(new WindowAdapter() {

public void windowClosing(WindowEvent e) {

int choose = JOptionPane.showConfirmDialog(null, "是否要退出登錄界面?",

"系統(tǒng)提示:", JOptionPane.YES_NO_OPTION);

if (choose == JOptionPane.YES_OPTION) {

System.exit(1);

}

}

});

}其中this為JFrame對(duì)象。BS結(jié)構(gòu)的退出直接用windows.close()方法就行了!

java登錄頁面,當(dāng)?shù)卿浭〕^3次程序退出

你那代碼也太難看了,以前寫的簡單供你參考

import java.awt.BorderLayout;

import java.awt.GridLayout;

import java.awt.event.MouseEvent;

import java.awt.event.MouseListener;

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;

public class Logon {

private JFrame f = new JFrame("Logon");

private JTextField username = new JTextField(10);

private JPasswordField password = new JPasswordField(10);

private JLabel user = new JLabel("User");

private JLabel pwd = new JLabel("Password");

private JButton logon = new JButton("Logon on");

private int count = 0;

public Logon(){

JPanel p = new JPanel();

p.setLayout(new GridLayout(2, 2));

p.add(user);

p.add(username);

p.add(pwd);

p.add(password);

f.add(p, BorderLayout.NORTH);

f.add(logon, BorderLayout.SOUTH);

logon.addMouseListener(new MouseListener(){

public void mouseClicked(MouseEvent e) {

if(count 3){

if(username.getText().trim().equals("") || password.getText().trim().equals("")){

JOptionPane.showMessageDialog(null, "Password/Username is blank. Please input!");

return;

}

if(username.getText().equals("admin") password.getText().equals("abc123")){

JOptionPane.showMessageDialog(null, "Logon on success");

}else{

username.setText("");

password.setText("");

JOptionPane.showMessageDialog(null, "Username/password incorrect. Please try again");

count++;

}

}else{

JOptionPane.showMessageDialog(null, "You have tried 3 times. Program exit!");

System.exit(0);

}

}

public void mouseEntered(MouseEvent e) {}

public void mouseExited(MouseEvent e) {}

public void mousePressed(MouseEvent e) {}

public void mouseReleased(MouseEvent e) {}

});

f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

f.setVisible(true);

f.setBounds(200, 200, 400, 400);

f.pack();

}

public static void main(String[] args) {

new Logon();

}

}

java 中 有1.注冊 2.登錄 3.退出功能 我輸入一 就實(shí)現(xiàn)注冊然后返回 選擇2就能登錄 提供以下代碼

不要復(fù)雜化,代碼要簡單化,需求是什么就寫什么。參考如下:

//用于保存用戶帳戶信息的數(shù)組

Scanner?scanner?=?new?Scanner(System.in);

String[]?user?=?new?String[2];?

while?(true)?{

//銀行主界面

System.out.println("------------------------------歡迎來到銀行------------------------------");

System.out.println("請選擇編號(hào):\n1:注冊\n2:登錄\n3退出");

int?num?=?scanner.nextInt();

switch?(num)?{

case?1:

//注冊

System.out.println("請輸入您的賬戶名:");

String?name?=?scanner.next();

user[0]?=?name;

System.out.println("請輸入您的密碼:");

String?password?=?scanner.next();

user[1]?=?password;

System.out.println("注冊成功!");

//返回主界面

break;

case?2:

while?(true)?{

//登錄

System.out.println("請輸入您的帳戶名:");

String?userName?=?scanner.next();

System.out.println("請輸入您的密碼:");

String?userPwd?=?scanner.next();

//判斷輸入的用戶名是否在數(shù)組中存在(判斷該用戶是否注冊)

if(user[0].equals(userName)user[1].equals(userPwd)){

System.out.println("-----------登錄成功,請選擇您要辦理的業(yè)務(wù)------------");

break;

}else{

System.out.println("-----------用戶名或密碼錯(cuò)誤,請重新輸入------------");//返回到登錄界面

continue;

}

}

break;

case?3:

//退出系統(tǒng)?程序結(jié)束

System.out.println("退出成功,歡迎再次使用");

System.exit(0);

break;

default:

break;

}

}

實(shí)現(xiàn)界面登陸,退出功能的java代碼怎么寫?

CS結(jié)構(gòu)系統(tǒng)的退出如下:public void init() {

this.setTitle("用戶登錄界面");

this.add(createCenterPane());

this.setDefaultCloseOperation(this.DO_NOTHING_ON_CLOSE);

this.setSize(new Dimension(450, 335));

this.setLocationRelativeTo(null);

// this.setVisible(true);

this.addWindowListener(new WindowAdapter() {

public void windowClosing(WindowEvent e) {

int choose = JOptionPane.showConfirmDialog(null, "是否要退出登錄界面?",

"系統(tǒng)提示:", JOptionPane.YES_NO_OPTION);

if (choose == JOptionPane.YES_OPTION) {

System.exit(1);

}

}

});

}其中this為JFrame對(duì)象。BS結(jié)構(gòu)的退出直接用windows.close()方法就行了!

java語言如何實(shí)現(xiàn) 登陸 退出 功能

在一個(gè)純java項(xiàng)目中,登錄就是你從客戶端收受賬戶和密碼,和數(shù)據(jù)庫中已有的鍵值對(duì)進(jìn)行匹配,如果匹配順利,就顯示登錄成功。接著后臺(tái)向前臺(tái)返回?cái)?shù)據(jù),跳轉(zhuǎn)到相應(yīng)的頁面。匹配程序可以單獨(dú)寫一個(gè)類,或者在工具類中封裝一個(gè)方法,傳入前臺(tái)發(fā)過來的數(shù)據(jù),最后返回一個(gè)布爾值。

退出功能的實(shí)現(xiàn),就是后臺(tái)發(fā)送數(shù)據(jù),直接退出當(dāng)前賬戶。或者關(guān)閉客戶端。

本文題目:退出登錄用java代碼,java用戶登錄代碼
文章出自:http://vcdvsql.cn/article36/heojsg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動(dòng)網(wǎng)站建設(shè)定制網(wǎng)站動(dòng)態(tài)網(wǎng)站靜態(tài)網(wǎng)站網(wǎng)站改版關(guān)鍵詞優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

微信小程序開發(fā)