JavaʵÏÖ£ºÎļþ´«Êä
//´úÂë¾¹ý±àÒ룬ÔËÐУ¬Ö¤Ã÷¿ÉÒÔÔËÐÐ
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.io.*;
import java.net.*;
import javax.swing.filechooser.FileFilter;
public class Ftp extends JLabel
{
private JButton openButton;
private JButton saveButton;
JFileChooser fc;
String fileName;
int result;
Ftp()
{
setLayout(new GridLayout());
JButton openButton = new JButton("Open");
openButton.addActionListener(new openFile());
JButton saveButton = new JButton("Save");
saveButton.addActionListener(new saveFile());
add(openButton);
add(saveButton);
}
class openFile implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
fc = new JFileChooser();
result = fc.showOpenDialog(Ftp.this);
File file = fc.getSelectedFile();
if(file != null && result == JFileChooser.APPROVE_OPTION)
{
fileName = file.getAbsolutePath();
System.out.println("Ñ¡ÔñÄãÒª´ò¿ªµÄÎļþ£º" + fileName);
try
{
File file1 = new File(fileName);
FileInputStream fos = new FileInputStream(file1);
ServerSocket ss = new ServerSocket(2048);
Socket client = ss.accept();
OutputStream netOut = client.getOutputStream();
OutputStream doc = new DataOutputStream(new BufferedOutputStream(netOut));
byte[] buf = new byte[2048];
int num = fos.read(buf);
while(num != (-1))
{
&nb
Ïà¹ØÎĵµ£º
±à³Ì£º±àдһ¸ö½ØÈ¡×Ö·û´®µÄº¯Êý£¬ÊäÈëΪһ¸ö×Ö·û´®ºÍ×Ö½ÚÊý£¬Êä³öΪ°´×Ö½Ú½ØÈ¡µÄ×Ö·û´®¡£µ«ÊÇÒª±£Ö¤ºº×Ö²»±»½Ø°ë¸ö£¬Èç"ÎÒABC"4£¬Ó¦¸Ã½ØÎª"ÎÒAB"£¬ÊäÈë"ÎÒABCººDEF"£¬6£¬Ó¦¸ÃÊä³öΪ"ÎÒABC"¶ø²»ÊÇ"ÎÒABC+ººµÄ°ë¸ö"¡£
¡¡¡¡public static String substring(String str, int toCount,String& ......
1£©DOM£¨JAXP Crimson½âÎöÆ÷£©
DOMÊÇÓÃÓëÆ½Ì¨ºÍÓïÑÔÎ޹صķ½Ê½±íʾXMLÎĵµµÄ¹Ù·½W3C±ê×¼¡£DOMÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐѰÕÒÌØ¶¨ÐÅÏ¢¡£·ÖÎö¸Ã½á¹¹Í¨³£ÐèÒª¼ÓÔØÕû¸öÎĵµºÍ¹¹Ôì²ã´Î½á¹¹£¬È»ºó²ÅÄÜ×öÈκι¤×÷¡£ÓÉÓÚËüÊÇ»ùÓÚÐÅÏ¢²ã´ÎµÄ£¬Òò¶ ......
ÔÚÓ¦ÓÃÖУ¬ÎÒÃdz£³£ÐèÒªThread»º³å³ØÀ´×öһЩÊÂÒÔÌá¸ß³ÌÐòµÄЧÂʺͲ¢·¢ÐÔ¡£±¾ÎÄÑÝʾÁËÈçºÎÀûÓÃQueueÕâÖÖÊý¾Ý½á¹¹ÊµÏÖÒ»¸ö¼òµ¥µÄThread»º³å³Ø¡£
Ò»¸öThread»º³å³Ø¿ÉÒÔÉè¼Æ³ÉÒÔÏÂÕâÑù£º»º³å³ØÓɼ¸¸ö¹¤×÷ThreadºÍÒ»¸öQueue×é³É£¬Client¸ºÔð°ÑÈÎÎñ·Åµ½QueueÀïÃæ£¨put·½·¨£©£¬¶ø¹¤×÷Thread¾ÍÒÀ´ÎÈ¡³öÕâЩÈÎÎñ²¢Ö´ÐÐËüÃÇ£¨get· ......
ÔÚjdk1.2ÖУ¬·Ö±ðÕë¶ÔJcomponentºÍTextÀàµÄ¶ÔÏó¶¨ÖÆÁ˲»Í¬µÄ´¦Àí¼üÅÌʼþµÄ·½·¨£ºÔÚJcomponentÖУ¬¶¨ÒåÁËregisterKeyboardAction·½·¨£¬Ê¹ÓÃÕâ¸ö·½·¨À´½«ÐèÒª´¦ÀíµÄ¼üÅÌʼþÒÔ¼°´¦ÀíʼþµÄÐÐΪ°ó¶¨ÔÚÒ»Æð¡£TextÀàÖоßÓÐkeymap¶ÔÏó£¬Í¬JcomponentÖеĴ¦Àí·½·¨ÀàËÆ£¬Õâ¸ö¶ÔÏó±£´æ×ÅÐèÒª´¦ÀíµÄ¼üÅÌʼþºÍ¶ÔÓ¦µÄÐÐΪ¡£
¡¡¡¡¶ø ......
¶ÔÓÚJava×ÀÃæÓ¦ÓÃÀ´Ëµ£¬±È½Ï·³ËöµÄ¾ÍÊǰ²×°²¿ÊðÎÊÌ⣬È磺¿Í»§¶ËÊÇ·ñ°²×°ÓÐjre¡¢jre°æ±¾¡¢jreÔÚÄÄÀïÏÂÔØ¡¢ÈçºÎÓÃjreÆô¶¯JavaÓ¦Óõȵȡ£²»ÒªËµ¸Õ½Ó´¥µçÄÔµÄÈË£¬¾ÍËãÊDZȽÏÊìϤµçÄÔ£¬Èç¹ûûÓнӴ¥¹ýJava£¬Ãæ¶ÔÒ»¸öJavaÓ¦Óã¬ÈçºÎÔÚWindowsÏÂÆô¶¯Ëü£¬¹À¼Æ¶¼»áÕÛÌÚ°ëÌì¡£ËùÒÔÕâ¸öÊǵ¼ÖÂJava×ÀÃæÓ¦Óñ»Ò»Ð©ÈËËùÌÖÑáµÄ×î´óÔÒò£¬J ......