按关键词阅读: 照片 可以 代码 界面 登陆 java
1、java 登陆界面代码 ( 可以用 , 界面带照片)import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
public class LoginIn extends JFrameJTextField f1;
JTextField f2;
JButton b1;
JButton b2;
String power;
/?ie ?e ?TString imgePath = e:/workspace/GUI/14.gif;
JPanel p5;
Image img = Toolkit.getD 。
【java|java登陆界面代码(可以用,界面带照片】2、efaultToolkit().createImage(imgePath);
LoginIn()Container cp=getContentPane();
Label I仁new Label( o ?o);
Label 12=new Label(? u ?o);
JPanel p1=new JPanel();
JPanel p2=new JPanel();
JPanel p3=new JPanel();
JPanel p4=new JPanel();
p5=new JPanel()protected void paintChildren(Graphics g) g.drawImage(img,0,0,thi 。
3、s);
super.paintChildren(g);
f1=new JTextField(15);
f2=new JPasswordField(15);
b1= new JButton(卩?); b2=new JButton(?);
p1.setBackground(Color.orange); p2.add(l1); p2.add(f1);p2.setBorder(new MatteBorder(0,0,0,0,Color.BLACK); p2.setBackground(Color.ORANGE);p3.add(l2);p3.add(f2); p3.setBackground(Color.OR 。
4、ANGE); p3.setBorder(new MatteBorder(0,0,0,0,Color.BLACK); p4.add(b1);p4.add(b2);p4.setBorder(new MatteBorder(-3,-3,-3,-3,Color.CYAN); p4.setBackground(Color.ORANGE);p5.setLayout(new FlowLayout(FlowLayout.CENTER,20,20); p5.add(p2);p5.add(p3);
p5.add(p4);
cp.add(p5,BorderLayout.CENTER);
b1.addActionListe 。
5、ner(new Enter();
b2.addActionListener(new ReWrite();
addWindowListener(new winClose();
public static void main(String args) LoginIn log=new LoginIn();
log.setTitle(?卩?);log.setSize(360,250);
log.setVisible(true);class Enter implements ActionListenerpublic void actionPerformed(ActionEvent e)if(f1.getText( 。
6、).equals(admin)&(f2.getText().equals(123)JOptionPane.showMessageDialog(null,卩?e ?6 ?e ?Te ?adimistrato广);power=adminstrator;elseif(f1.getText().equals(snake)&(f2.getText().equals(123456)JOptionPane.showMessageDialog(null,丄?e ?!【丄?e ?6 ?Q ?Te ?user); 卜人/ 卜人/ / II J、power=adminstrator;
else JOptionPane.showMessageDialog(null, class ReWrite implements ActionListener public void actionPerformed(ActionEvent e)f1.setText();
f2.setText();
f1.requestFocus();
class winClose extends WindowAdapterpublic void windowClosing(WindowEvent e)(e.getWindow().dispose();
System.exit(0 。
来源:(未知)
【学习资料】网址:/a/2021/0321/0021742154.html
标题:java|java登陆界面代码(可以用,界面带照片