java 页面查询_关于一个查询的JAVA界面,希望对你有启发

package work2;

import java.awt.BorderLayout;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JPanel;

import javax.swing.JTextArea;

import javax.swing.JTextField;

import javax.swing.WindowConstants;classMyJframe extends JFrame{

JPanel Panel;

JLabel ID,Name,Price,Birth;

JTextField J1;

JTextArea J2,J3,J4;

JButton button1,button2;publicMyJframe (){

setLayout(newBorderLayout());

init();

setTitle("查询窗口");

setBounds(700,400,600,350);

setVisible(true);

setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

}public voidinit(){

Panel=newJPanel();

Panel.setLayout(null);//把面板布局设置为空//商品编号及文本框

ID=new JLabel("商品编号:");

ID.setBounds(120,30,150,50);

J1=new JTextField(16);

J1.setBounds(200, 45, 250, 20);

Panel.add(ID);

Panel.add(J1);//查询按钮

button1=new JButton("查询");

button1.setBounds(130,80,90,20);

Panel.add(button1);//清除按钮

button2=new JButton("清除界面字符");

button2.setBounds(320,80,120,20);

Panel.add(button2);//添加商品名称

Name=new JLabel("商品名称:");

Name.setBounds(120,115,120,30);

J2=newJTextArea();

J2.setBounds(200,120,250,20);

Panel.add(Name);

Panel.add(J2);//添加价格信息

Price=new JLabel("价 格:");

Price.setBounds(120,156,120,30);

J3=newJTextArea();

J3.setBounds(200,160,250,20);

Panel.add(Price);

Panel.add(J3);//添加出厂日期

Birth=new JLabel("出厂日期:");

Birth.setBounds(120,192,120,30);

J4=newJTextArea();

J4.setBounds(200,195,250,20);

Panel.add(Birth);

Panel.add(J4);

add(Panel);

}

}public classInterface{public static voidmain(String[] args){newMyJframe();

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值