java 需要返回类型_java中方法声明无效,需要返回类型

packagechapter1;importjavax.swing.*;importjavax.swing.table.*;importjavax.swing.event.*;importjava.awt.*;importjava.awt.event.*;publicclassCustomextendsJFrame{JLableHeadi...

package chapter1;

import javax.swing.*;

import javax.swing.table.*;

import javax.swing.event.*;

import java.awt.*;

import java.awt.event.*;

public class Custom extends JFrame

{

JLable Heading;

JLable labelCustNo;

JLable labelCustName;

JLable labelCustSex;

JLable labelCustAge;

JTextFiled textCustNO;

JTextFiled textCustName;

JComboBox comboCustSex;

JTextField textCustAge;

Customer(){

super("顾客情况");

container con;

con=this.getContentPane();

con.setLayout (new FlowLayout());

labelCustNo=new JLabel("顾客编号");

labelCustName=new JLabel("顾客姓名");

labelCustSex=new JLabel("顾客性别");

labelCustAge=new JLabel("顾客年龄");

textCustNo=new JTextField(20);

textCustName=new JTextField(20);

textCustAge=new JTextField(2);

String Sex[]={"男","女"};

comboCustSex=new JComboBox (Sex);

con.add(labelCustNo);

con.add(textCustNo);

con.add(labelCustName);

con.add(textCustName);

con.add(labelCustSex);

con.add(comboCustSex);

con.add(labelCustAge);

con.add(textCustAge);

setDefaultCloseoperation(EXIT_ON_CLOSE);

setSize(350,250);

this.show();

}

public static void main(String[] args){

class Customer{

Customer cust=new Customer();}

}

}

Custom.java:18:方法声明无效;需要返回类型

Customer(){

展开

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值