資源簡介
基于java的p2p文件傳輸代碼.rar

代碼片段和文件信息
package?com.tarena.file.gui;
import?com.tarena.file.service.*;
public?class?Loginframe?extends?javax.swing.Jframe?{
????private?ClientContext?context;
????public?Loginframe(ClientContext?context)?{
????????this.context?=?context;
????????initComponents();
????????ExamTools.setframeCenterPoint(this);
????????this.setResizable(false);
????}
????public?String?getHost()?{
????????return?addrText.getText().trim();
????}
????public?int?getPort()?{
????????return?Integer.parseInt(portText.getText().trim());
????}
????//?//GEN-BEGIN:initComponents
????private?void?initComponents()?{
????????buttons?=?new?javax.swing.ButtonGroup();
????????jPanel1?=?new?javax.swing.JPanel();
????????jLabel1?=?new?javax.swing.JLabel();
????????jLabel2?=?new?javax.swing.JLabel();
????????jLabel3?=?new?javax.swing.JLabel();
????????addrText?=?new?javax.swing.JTextField();
????????portText?=?new?javax.swing.JTextField();
????????loginButton?=?new?javax.swing.JButton();
????????serverRadio?=?new?javax.swing.JRadioButton();
????????clientRadio?=?new?javax.swing.JRadioButton();
????????exitButton?=?new?javax.swing.JButton();
????????setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
????????settitle(“P2P文件傳輸程序“);?//?NOI18N
????????setAlwaysOnTop(true);
????????addWindowListener(new?java.awt.event.WindowAdapter()?{
????????????public?void?windowClosing(java.awt.event.WindowEvent?evt)?{
????????????????formWindowClosing(evt);
????????????}
????????});
????????jPanel1.setBackground(new?java.awt.Color(255?255?255));
????????jPanel1.setName(“jPanel1“);?//?NOI18N
????????jLabel1.setIcon(new?javax.swing.ImageIcon(getClass().getResource(“/com/tarena/file/resource/logo.PNG“)));?//?NOI18N
????????jLabel1.setName(“jLabel1“);?//?NOI18N
????????jLabel2.setText(“IP地址:“);
????????jLabel2.setName(“jLabel2“);?//?NOI18N
????????jLabel3.setText(“端口號:“);
????????jLabel3.setName(“jLabel3“);?//?NOI18N
????????addrText.setText(“127.0.0.1“);
????????addrText.setName(“addrText“);?//?NOI18N
????????addrText.addActionListener(new?java.awt.event.ActionListener()?{
????????????public?void?actionPerformed(java.awt.event.ActionEvent?evt)?{
????????????????addrTextActionPerformed(evt);
????????????}
????????});
????????portText.setText(“6860“);
????????portText.setName(“portText“);?//?NOI18N
????????loginButton.setText(“登錄“);
????????loginButton.setName(“l(fā)oginButton“);?//?NOI18N
????????loginButton.addActionListener(new?java.awt.event.ActionListener()?{
????????????public?void?actionPerformed(java.awt.event.ActionEvent?evt)?{
????????????????loginButtonActionPerformed(evt);
????????????}
????????});
????????serverRadio.setBackground(new?java.awt.Color(255?255?255));
????????buttons.add(serverRadio);
????????serverRadio.setSelected(true);
????????serverRadio.setText(“我是服務(wù)器“);
????????serverRadio.setName(“serverRadio“);?//?NOI18N
????????clientRadio.setBackground(new?java.awt.Color(255?255?255));
????????but
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????390??2011-02-27?20:15??FlieSendSystem\.project
?????文件??????12040??2011-02-27?20:26??FlieSendSystem\src\com\tarena\file\service\ClientContext.java
?????文件????????564??2011-02-27?20:28??FlieSendSystem\src\com\tarena\file\service\ExamTools.java
?????文件???????1789??2011-02-27?20:16??FlieSendSystem\src\com\tarena\file\resource\logo.PNG
?????文件??????10816??2011-02-27?20:16??FlieSendSystem\src\com\tarena\file\gui\Loginfr
?????文件???????9208??2011-02-27?20:28??FlieSendSystem\src\com\tarena\file\gui\Loginfr
?????文件??????22833??2011-02-27?20:16??FlieSendSystem\src\com\tarena\file\gui\Menufr
?????文件??????20248??2011-02-27?20:31??FlieSendSystem\src\com\tarena\file\gui\Menufr
?????文件??????10816??2011-02-27?20:16??FlieSendSystem\bin\com\tarena\file\gui\Loginfr
?????文件??????22833??2011-02-27?20:16??FlieSendSystem\bin\com\tarena\file\gui\Menufr
?????文件???????7823??2011-02-27?20:28??FlieSendSystem\bin\com\tarena\file\gui\Loginfr
?????文件??????11345??2011-02-27?20:31??FlieSendSystem\bin\com\tarena\file\gui\Menufr
?????文件????????817??2011-02-27?20:28??FlieSendSystem\bin\com\tarena\file\gui\Loginfr
?????文件????????817??2011-02-27?20:28??FlieSendSystem\bin\com\tarena\file\gui\Loginfr
?????文件????????790??2011-02-27?20:28??FlieSendSystem\bin\com\tarena\file\gui\Loginfr
?????文件????????817??2011-02-27?20:28??FlieSendSystem\bin\com\tarena\file\gui\Loginfr
?????文件????????810??2011-02-27?20:31??FlieSendSystem\bin\com\tarena\file\gui\Menufr
?????文件????????810??2011-02-27?20:31??FlieSendSystem\bin\com\tarena\file\gui\Menufr
?????文件???????1789??2011-02-27?20:16??FlieSendSystem\bin\com\tarena\file\resource\logo.PNG
?????文件???????6816??2011-02-27?20:26??FlieSendSystem\bin\com\tarena\file\service\ClientContext.class
?????文件???????2166??2011-02-27?20:26??FlieSendSystem\bin\com\tarena\file\service\ClientContext$1.class
?????文件???????2693??2011-02-27?20:26??FlieSendSystem\bin\com\tarena\file\service\ClientContext$ReadThread$1.class
?????文件???????2677??2011-02-27?20:26??FlieSendSystem\bin\com\tarena\file\service\ClientContext$ReadThread$2.class
?????文件???????6775??2011-02-27?20:26??FlieSendSystem\bin\com\tarena\file\service\ClientContext$ReadThread.class
?????文件???????1124??2011-02-27?20:28??FlieSendSystem\bin\com\tarena\file\service\ExamTools.class
?????文件????????629??2011-02-27?20:15??FlieSendSystem\.settings\org.eclipse.jdt.core.prefs
?????文件????????301??2011-02-27?20:15??FlieSendSystem\.classpath
?????目錄??????????0??2011-02-27?20:16??FlieSendSystem\src\com\tarena\file\service
?????目錄??????????0??2011-02-27?20:16??FlieSendSystem\src\com\tarena\file\resource
?????目錄??????????0??2011-02-27?20:16??FlieSendSystem\src\com\tarena\file\gui
............此處省略16個文件信息
評論
共有 條評論