猿问

界面插件显示不出来

package Interface;


import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;


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;


//import com.lhl.score.GUI.login.loginEvent;


public class login extends JFrame {

private JPanel pane1;

private JLabel usernameJL;

private JLabel paswordJL;

private JButton enter;

private JButton cancel;

JTextField usernameJT;

JPasswordField passworkJT;

public login(){

getContentPane().setLayout(null);

setTitle("运动会管理系统");

pane1=new JPanel();

enter=new JButton("登录");

enter.addActionListener(null);


cancel=new JButton("取消");

cancel.addActionListener(null);


usernameJL=new JLabel("用户名");

usernameJT=new JTextField(20);

paswordJL=new JLabel("密码");

passworkJT=new JPasswordField("20");

pane1.setLayout(null);

enter.setBounds(50, 170, 25, 20);

cancel.setBounds(50, 170, 25, 20);

usernameJL.setBounds(20, 20, 30, 20);

paswordJL.setBounds(20, 60, 30, 20);

usernameJT.setBounds(60, 100, 70, 20);

passworkJT.setBounds(60, 140, 70, 20);

pane1.add(enter);

pane1.add(cancel);

pane1.add(usernameJL);

pane1.add(paswordJL);

pane1.add(usernameJT);

pane1.add(passworkJT);

setBounds(100, 100, 200, 160);

getContentPane().add(pane1);

validate();

setVisible(true);

}

public static void main(String[] args){

login login1=new login();

  }

}


不凡的蚂蚁
浏览 1539回答 0
0回答
随时随地看视频慕课网APP

相关分类

Java
我要回答