⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getrecfiles.java

📁 局域网聊天工具,学习java桌面应用程序的好例子,(代传)
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/* * GetRecFiles.java * * Created on 2008年10月28日, 下午5:13 */package ipmsg.gui;import ipmsg.etc.Command;import ipmsg.etc.FileLinkList;import ipmsg.etc.FileNode;import ipmsg.etc.GlobalConstant;import ipmsg.etc.GlobalVar;import ipmsg.etc.UtilityGlobal;import ipmsg.network.UtilityNet;/** * * @author  Noeru */public class GetRecFiles extends javax.swing.JFrame         implements InterfaceSetVisible_GetRecFiles{    private FileLinkList flist;    /** Creates new form GetRecFiles */    public GetRecFiles(FileLinkList flist) {        initComponents();        this.setTitle("收到文件");        this.flist=flist;        if(this.flist!=null){            this.guiFiles.setListData(flist.exportFileList());            this.jLabel10.setText(this.flist.getIp());            this.jLabel8.setText(GlobalVar.getUser(                    this.flist.getIp()).getName());            this.jLabel12.setText(flist.getFiles().size()+"");        }else this.dispose();            }    /** This method is called from within the constructor to     * initialize the form.     * WARNING: Do NOT modify this code. The content of this method is     * always regenerated by the Form Editor.     */    @SuppressWarnings("unchecked")    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents    private void initComponents() {        jPanel2 = new javax.swing.JPanel();        jScrollPane1 = new javax.swing.JScrollPane();        guiFiles = new javax.swing.JList();        jPanel1 = new javax.swing.JPanel();        guiChooseAll = new javax.swing.JCheckBox();        guiCoverExist = new javax.swing.JCheckBox();        jButton1 = new javax.swing.JButton();        jButton2 = new javax.swing.JButton();        jPanel3 = new javax.swing.JPanel();        jLabel1 = new javax.swing.JLabel();        jLabel2 = new javax.swing.JLabel();        jLabel3 = new javax.swing.JLabel();        jLabel4 = new javax.swing.JLabel();        jLabel5 = new javax.swing.JLabel();        jLabel6 = new javax.swing.JLabel();        jLabel7 = new javax.swing.JLabel();        jLabel8 = new javax.swing.JLabel();        jLabel9 = new javax.swing.JLabel();        jLabel10 = new javax.swing.JLabel();        jSeparator1 = new javax.swing.JSeparator();        jLabel11 = new javax.swing.JLabel();        jLabel12 = new javax.swing.JLabel();        jMenuBar1 = new javax.swing.JMenuBar();        jMenu1 = new javax.swing.JMenu();        jMenuItem3 = new javax.swing.JMenuItem();        jMenuItem1 = new javax.swing.JMenuItem();        jMenu2 = new javax.swing.JMenu();        jMenuItem2 = new javax.swing.JMenuItem();        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);        setMinimumSize(new java.awt.Dimension(509, 369));        addWindowListener(new java.awt.event.WindowAdapter() {            public void windowClosing(java.awt.event.WindowEvent evt) {                formWindowClosing(evt);            }        });        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "文件列表", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("宋体", 0, 10))); // NOI18N        jScrollPane1.setAutoscrolls(true);        guiFiles.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);        guiFiles.addListSelectionListener(new javax.swing.event.ListSelectionListener() {            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {                guiFilesValueChanged(evt);            }        });        jScrollPane1.setViewportView(guiFiles);        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);        jPanel2.setLayout(jPanel2Layout);        jPanel2Layout.setHorizontalGroup(            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 246, Short.MAX_VALUE)        );        jPanel2Layout.setVerticalGroup(            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE)        );        getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);        guiChooseAll.setText("全部接收");        guiCoverExist.setText("覆盖同名文件");        jButton1.setText("取消");        jButton1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton1ActionPerformed(evt);            }        });        jButton2.setText("接收");        jButton2.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton2ActionPerformed(evt);            }        });        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);        jPanel1.setLayout(jPanel1Layout);        jPanel1Layout.setHorizontalGroup(            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel1Layout.createSequentialGroup()                .addContainerGap()                .addComponent(guiChooseAll)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                .addComponent(guiCoverExist)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 120, Short.MAX_VALUE)                .addComponent(jButton1)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                .addComponent(jButton2)                .addContainerGap())        );        jPanel1Layout.setVerticalGroup(            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(guiChooseAll)                    .addComponent(guiCoverExist)                    .addComponent(jButton2)                    .addComponent(jButton1))                .addContainerGap())        );        getContentPane().add(jPanel1, java.awt.BorderLayout.SOUTH);        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "详细信息", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("宋体", 0, 10))); // NOI18N        jLabel1.setFont(new java.awt.Font("宋体", 1, 12));        jLabel1.setText("类型:");        jLabel2.setText(" ");        jLabel3.setFont(new java.awt.Font("宋体", 1, 12));        jLabel3.setText("大小:");        jLabel4.setText(" ");        jLabel5.setFont(new java.awt.Font("宋体", 1, 12));        jLabel5.setText("长度:");        jLabel6.setText(" ");        jLabel7.setFont(new java.awt.Font("宋体", 1, 12));        jLabel7.setText("发送者:");        jLabel8.setText("LanMsg");        jLabel9.setFont(new java.awt.Font("宋体", 1, 12));        jLabel9.setText("IP:");        jLabel10.setText("0.0.0.0");        jLabel11.setFont(new java.awt.Font("宋体", 1, 12));        jLabel11.setText("文件数:");        jLabel12.setText("0");        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);        jPanel3.setLayout(jPanel3Layout);        jPanel3Layout.setHorizontalGroup(            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel3Layout.createSequentialGroup()                .addContainerGap()                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                    .addGroup(jPanel3Layout.createSequentialGroup()                        .addComponent(jLabel11)                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                        .addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE))                    .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE)                    .addComponent(jLabel7)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -