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

📄 sendfiles.java

📁 局域网聊天工具,学习java桌面应用程序的好例子,(代传)
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/* * SendFiles.java * * Created on 2008年10月30日, 下午7:50 */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.network.UtilityNet;import java.io.File;import javax.swing.DefaultListModel;/** * * @author  Noeru */public class SendFiles extends javax.swing.JFrame {        private String desIp;    private String note=null;    /** Creates new form SendFiles */    public SendFiles(String desIp) {        this.init(desIp);    }        public SendFiles(String remoteIP,File[]files){        this.init(remoteIP);        this.addFiles(files);    }    /** 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() {        jPanel1 = new javax.swing.JPanel();        guiSend = new javax.swing.JButton();        guiCancel = new javax.swing.JButton();        guiAdd = new javax.swing.JButton();        guiDel = new javax.swing.JButton();        guiSelectALL = new javax.swing.JCheckBox();        jButton1 = new javax.swing.JButton();        jPanel2 = new javax.swing.JPanel();        jScrollPane1 = new javax.swing.JScrollPane();        guiAllFiles = new javax.swing.JList();        jMenuBar1 = new javax.swing.JMenuBar();        jMenu1 = new javax.swing.JMenu();        jMenuItem1 = new javax.swing.JMenuItem();        jMenuItem2 = new javax.swing.JMenuItem();        jMenuItem3 = new javax.swing.JMenuItem();        jSeparator1 = new javax.swing.JSeparator();        jMenuItem5 = new javax.swing.JMenuItem();        jMenuItem4 = new javax.swing.JMenuItem();        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);        guiSend.setText("发送");        guiSend.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                guiSendActionPerformed(evt);            }        });        guiCancel.setText("退出");        guiCancel.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                guiCancelActionPerformed(evt);            }        });        guiAdd.setText("添加");        guiAdd.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                guiAddActionPerformed(evt);            }        });        guiDel.setText("删除");        guiDel.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                guiDelActionPerformed(evt);            }        });        guiSelectALL.setText("全选");        guiSelectALL.addItemListener(new java.awt.event.ItemListener() {            public void itemStateChanged(java.awt.event.ItemEvent evt) {                guiSelectALLItemStateChanged(evt);            }        });        jButton1.setText("添加说明");        jButton1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton1ActionPerformed(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(guiSelectALL)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                .addComponent(guiAdd)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                .addComponent(guiDel)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE)                .addComponent(jButton1)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                .addComponent(guiCancel)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                .addComponent(guiSend)                .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(guiAdd)                    .addComponent(guiDel)                    .addComponent(guiSelectALL)                    .addComponent(guiSend)                    .addComponent(guiCancel)                    .addComponent(jButton1))                .addContainerGap())        );        getContentPane().add(jPanel1, java.awt.BorderLayout.SOUTH);        guiAllFiles.addListSelectionListener(new javax.swing.event.ListSelectionListener() {            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {                guiAllFilesValueChanged(evt);            }        });        jScrollPane1.setViewportView(guiAllFiles);        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, 427, Short.MAX_VALUE)        );        jPanel2Layout.setVerticalGroup(            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE)        );        getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);        jMenu1.setText("文件");        jMenuItem1.setText("添加文件");        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jMenuItem1ActionPerformed(evt);            }        });        jMenu1.add(jMenuItem1);        jMenuItem2.setText("删除文件");        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jMenuItem2ActionPerformed(evt);            }        });        jMenu1.add(jMenuItem2);        jMenuItem3.setText("清空列表");        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jMenuItem3ActionPerformed(evt);            }        });        jMenu1.add(jMenuItem3);        jMenu1.add(jSeparator1);        jMenuItem5.setText("发送");        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jMenuItem5ActionPerformed(evt);            }        });        jMenu1.add(jMenuItem5);        jMenuItem4.setText("退出");        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jMenuItem4ActionPerformed(evt);            }        });        jMenu1.add(jMenuItem4);        jMenuBar1.add(jMenu1);        setJMenuBar(jMenuBar1);

⌨️ 快捷键说明

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