中易网

用JAVA代码实现添加好友模版

答案:3  悬赏:60  
解决时间 2021-02-11 22:36
用JAVA代码实现添加好友模版
最佳答案
import javax.swing.*;
import javax.swing.text.JTextComponent;
import java.awt.*;
import java.awt.event.*;

public class ChatFrame extends JFrame implements ActionListener {
private JLabel id;
private JLabel group;
private JLabel allas;
public JTextField inputId;
public JTextField inputGroup;
public JTextField inputAllas;
private JButton submit;
private JPanel pane;

public ChatFrame(){
id = new JLabel("Id");
group = new JLabel("Group");
allas = new JLabel("Allas");
inputId = new JTextField();
inputGroup = new JTextField();
inputAllas = new JTextField();
submit = new JButton("确定");
pane=new JPanel();
pane.setLayout(null);
this.getContentPane().add(pane).setBackground(Color.white);
this.getContentPane().add(pane);
pane.add(id);
pane.add(group);
pane.add(allas);
pane.add(inputId);
pane.add(inputGroup);
pane.add(inputAllas);
pane.add(submit);
id.setBounds(5,5,50,30);
group.setBounds(5,35,50,30);
allas.setBounds(5,65,50,50);
inputId.setBounds(70,5,100,30);
inputGroup.setBounds(70,35,100,30);
inputAllas.setBounds(70,65,100,30);
submit.setBounds(150,100,60,30);
submit.addActionListener(this);
this.setSize(240,180);
this.setLocation(300,300);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.setVisible(true);
}
public void actionPerformed(ActionEvent e){
//按键监听,可添加连接数据库的操作
}

public static void main(String args[]){
new ChatFrame();
}
}
全部回答
不知道你说的web实现还是java自己写界面实现
学习一下swing.就可以实现..
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
墨语草堂我想知道这个在什么地方
现在出了学校,当初英语四级没有认真考,也没
我想问一下。音乐剧。歌词好像是爱情不过是一
比亚迪唐满电状态下混合动力行驶最大距离?
蜀苑路在哪里啊,我有事要去这个地方
在车展上购买的车,赠送的贴膜怎样
五行缺金属鸡的取名字可以用这个铭字吗
歇后语 是 王七的兄弟 还是 王七的弟弟?
疯狂躲猫猫怎么就捡不起箱子
请问现在第三套人民币升值空间大吗
创业农场地址有知道的么?有点事想过去
帝苑小雨跟帝苑小宇后面再加三个字的情侣网名
企业自建房已支出前期费用40多万,但后来房子
DNF百花的分身和幻影爆碎怎么不能同时用
婶是什么字?
推荐资讯
老四川火锅地址在哪,我要去那里办事
我国北方农业以旱地为主,是由于 A.热量
在qq上打不开空间怎么回事啊
dota游戏背景音乐
在杨寨陶瓷厂工作怎么样
年高德勋的勋是什么意思?
防紫外线眼镜蓝色
去广州长隆水上乐园男的要带泳裤吗
想买2017奇骏,2.0舒适版,这个车怎么样?适
我想包一些电焊的活不知道怎么包法,请内行朋
培养一名球员到底需要花费多少钱 俱乐部参差
魔秀网制作手机主题有酬劳么
手机登qq时,显示手机磁盘不足,清理后重新登
刺客的套装怎么选啊?