Swing QQ2011


程序实现了UDP协议的局域网内聊天,QQ截图,皮肤设定,做的比较粗糙,数据库用的是smallsql,可以语言聊天,视频聊天。
资源截图
代码片段和文件信息
package org.fw;

import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.Jframe;
import javax.swing.JLabel;

import org.fw.cellrender.CanDeleteCellRenderer;
import org.fw.data.CanDeleteItem;

public class CanDeleteJComboBox extends JComboBox{

private static final long serialVersionUID = -5633769966703909074L;

private List itemList = new ArrayList();

private JLabel iconLabel nameLabel numberLabel;

private OpaquePanel contentPanel;// 状态面板


public CanDeleteJComboBox(){
this.setEditable(true);

initComponents();
}

private void initComponents() {

//设置单元格布局
contentPanel = new OpaquePanel();
contentPanel.setLayout(new GridBagLayout());
iconLabel = new JLabel();

nameLabel = new JLabel();

numberLabel = new JLabel();



//设置单元格渲染类
setRenderer(new CanDeleteCellRenderer(contentPaneliconLabelnameLabelnumberLabel));

//填充数据
setModelData();
}
/**
 * 添加数据内容
 * @param item 数据内容
 */
public void addCanDeleteItem(String iconString nameString number){
itemList.add(new CanDeleteItem(iconnamenumber));
setModelData();
}

/**
 * 设置数据模型
 *
 */
private void setModelData() {
this.setModel(new DefaultComboBoxModel());
DefaultComboBoxModel model = (DefaultComboBoxModel)this.getModel();
for(CanDeleteItem item : itemList){
model.addElement(item);
}
}

public static void main(String args[]){
final CanDeleteJComboBox list = new CanDeleteJComboBox();
list.addCanDeleteItem(“image/bg.jpg““逝水““786074249“);
list.addCanDeleteItem(“image/bgImage.jpg““逝水““123456799“);
list.addCanDeleteItem(“image/head.png““逝水““56464566“);
list.addCanDeleteItem(“image/leaf.jpg““逝水““94984656“);
list.addCanDeleteItem(“image/head.png““逝水““25564948“);
list.addCanDeleteItem(“image/head.png““逝水““15649462“);
list.addCanDeleteItem(“image/head.png““逝水““789456325“);
list.addCanDeleteItem(“image/head.png““逝水““895465498“);
list.addCanDeleteItem(“image/head.png““逝水““648991618“);
list.addActionListener(new ActionListener(){

public void actionPerformed(ActionEvent e) {
System.out.println(((CanDeleteItem)list.getSelectedItem()).getNumber());
}

});

Jframe frame = new Jframe(“StatusListJList“);
frame.getContentPane().add(list);
frame.pack();
frame.setVisible(true);
frame.setDefaultCloseOperation(3);
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3023  2013-07-28 07:38  QQ.classpath

     文件        505  2013-07-27 07:45  QQ.myhibernatedata

     文件        717  2013-07-27 07:45  QQ.project

     文件        459  2013-07-27 07:45  QQinfriend.hbm.xml

     文件       1208  2013-07-27 12:33  QQinhibernate.cfg.xml

     文件        585  2013-07-27 07:45  QQinlog4j.properties

     文件        997  2013-07-28 08:56  QQinorgfwCanDeleteJComboBox$1.class

     文件       3359  2013-07-28 08:56  QQinorgfwCanDeleteJComboBox.class

     文件       4002  2013-07-28 08:56  QQinorgfwCanDeleteJList.class

     文件       2761  2013-07-28 08:56  QQinorgfwcellrenderCanDeleteCellRenderer.class

     文件       6887  2013-07-28 08:56  QQinorgfwcellrenderFriendJTreeCellRenderer.class

     文件       2276  2013-07-28 08:56  QQinorgfwcellrenderImageIconCellRenderer.class

     文件        831  2013-07-28 08:56  QQinorgfwChangeBackgroundPanel$1.class

     文件       3646  2013-07-28 08:56  QQinorgfwChangeBackgroundPanel.class

     文件        901  2013-07-28 08:56  QQinorgfwColorSelectionPanel$1.class

     文件       2566  2013-07-28 08:56  QQinorgfwColorSelectionPanel.class

     文件       1101  2013-07-28 08:56  QQinorgfwdataCanDeleteItem.class

     文件       4422  2013-07-28 08:56  QQinorgfwdataFriendJTreeItem.class

     文件        810  2013-07-28 08:56  QQinorgfwdataImageIconItem.class

     文件        940  2013-07-28 08:56  QQinorgfwdbpojoFriend.class

     文件       1748  2013-07-28 08:56  QQinorgfwdbpojoUser.class

     文件       1966  2013-07-28 08:56  QQinorgfwdbpojoUserDAO.class

     文件       2327  2013-07-28 08:56  QQinorgfwdbpojoUserInfo.class

     文件       1442  2013-07-28 08:56  QQinorgfwDragAndDropJTree$RJLTransferable.class

     文件       5765  2013-07-28 08:56  QQinorgfwDragAndDropJTree.class

     文件        944  2013-07-28 08:56  QQinorgfwDropDownComponent$1$1.class

     文件       2278  2013-07-28 08:56  QQinorgfwDropDownComponent$1.class

     文件       3554  2013-07-28 08:56  QQinorgfwDropDownComponent.class

     文件       6293  2013-07-28 08:56  QQinorgfweventMoveMouseListener.class

     文件       1146  2013-07-28 08:56  QQinorgfwevent estTestMoveMouseListener.class

............此处省略440个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)