java代码没错 报错_Java 程序代码没有提示错误,但是无法显示运行结果

importjavax.swing.*;importjavax.swing.JFrame;importjavax.swing.JLabel;importjavax.swing.JPanel;importjavax.swing.JPasswordField;importjavax.swing.JTextField;publicclassUs...

import javax.swing.*;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JPanel;

import javax.swing.JPasswordField;

import javax.swing.JTextField;

public class User extends JFrame {

public JPanel useJPanel;

public JButton btn1;

public JButton btn2;

public JTextField text1;

public JPasswordField pdwField;

public JLabel userlog;

public JLabel username;

public JLabel userpdw;

public void Userlog(){

useJPanel =new JPanel();

userlog = new JLabel("用户登录");

username = new JLabel("用户名:");

userpdw = new JLabel("密 码:");

text1 =new JTextField();

pdwField = new JPasswordField();

btn1 =new JButton("登录");

btn2 =new JButton("取消");

usermain();

}

public void usermain(){

this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

this.setResizable(false);

this.setSize(300,200);

this.useJPanel.setLayout(null);

this.userlog.setBounds(120,15,60,20);

this.username.setBounds(50,55,60,20);

this.userpdw.setBounds(50,85,60,25);

this.text1.setBounds(110,55,120,20);

this.pdwField.setBounds(110,85,120,20);

this.btn1.setBounds(85,120,60,20);

this.btn2.setBounds(155,120,60,20);

this.useJPanel.add(userlog);

this.useJPanel.add(username);

this.useJPanel.add(userpdw);

this.useJPanel.add(text1);

this.useJPanel.add(pdwField);

this.useJPanel.add(btn1);

this.useJPanel.add(btn2);

this.add(useJPanel);

this.setVisible(true);

}

public static void main(String []args){

new User();

}

}

知道问题所在了……看看各位能不能细心点喽!嘿嘿,回答出来就给分!不是故意卖弄的 ,这分不能不给,但是我挣分也不容易的哦

展开

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值