Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎĵµ£º

JAVA½ø½×£ºÒ»¸ö¼òµ¥Thread»º³å³ØµÄʵÏÖ


ÔÚÓ¦ÓÃÖУ¬ÎÒÃdz£³£ÐèÒªThread»º³å³ØÀ´×öһЩÊÂÒÔÌá¸ß³ÌÐòµÄЧÂʺͲ¢·¢ÐÔ¡£±¾ÎÄÑÝʾÁËÈçºÎÀûÓÃQueueÕâÖÖÊý¾Ý½á¹¹ÊµÏÖÒ»¸ö¼òµ¥µÄThread»º³å³Ø¡£
Ò»¸öThread»º³å³Ø¿ÉÒÔÉè¼Æ³ÉÒÔÏÂÕâÑù£º»º³å³ØÓɼ¸¸ö¹¤×÷ThreadºÍÒ»¸öQueue×é³É£¬Client¸ºÔð°ÑÈÎÎñ·Åµ½QueueÀïÃ棨put·½·¨£©£¬¶ø¹¤×÷Thread¾ÍÒÀ´ÎÈ¡³öÕâЩÈÎÎñ²¢Ö´ÐÐËüÃÇ£¨get· ......

Java SwingÖмüÅÌʼþµÄ´¦Àí


ÔÚjdk1.2ÖУ¬·Ö±ðÕë¶ÔJcomponentºÍTextÀàµÄ¶ÔÏó¶¨ÖÆÁ˲»Í¬µÄ´¦Àí¼üÅÌʼþµÄ·½·¨£ºÔÚJcomponentÖУ¬¶¨ÒåÁËregisterKeyboardAction·½·¨£¬Ê¹ÓÃÕâ¸ö·½·¨À´½«ÐèÒª´¦ÀíµÄ¼üÅÌʼþÒÔ¼°´¦ÀíʼþµÄÐÐΪ°ó¶¨ÔÚÒ»Æð¡£TextÀàÖоßÓÐkeymap¶ÔÏó£¬Í¬JcomponentÖеĴ¦Àí·½·¨ÀàËÆ£¬Õâ¸ö¶ÔÏó±£´æ×ÅÐèÒª´¦ÀíµÄ¼üÅÌʼþºÍ¶ÔÓ¦µÄÐÐΪ¡£
¡¡¡¡¶ø ......

CoreJava »ù±¾Óï·¨ [Java]


1.  Ò»¸öjavaÔ´ÎļþÖ»ÓÐÒ»¸öpublicÀàÇÒÀàÃûÓëÎļþÃûÒ»Ö¡£×¢£ºÒ»¸ö¿ÉÔËÐеÄjavaÓ¦ÓóÌÐòÓ¦ÓÐÒ»¸ömain·½·¨£¬ÇÒ¸ñʽ¹Ì¶¨£¬µ«²»Ò»¶¨ÔÚpublicÀàÖС£
2. packageÓï¾äÖ»ÄÜÓÐÒ»¸öÇÒ·ÅÔÚ³ÌÐòµÄµÚÒ»ÐС£
3. ÕûÊýÔÚÄÚ´æÖÐʽ°´ÕÕÆä²¹ÂëÀ´´æ´¢µÄ£¬ÕýÊýµÄ²¹Âë=Ô­Â룬¸ºÊýµÄ²¹Âë=Ô­ÂëÈ¡·´¼Ó1 £¬charÎÞ·ûºÅ루0~65535£©
4. Ç¿ÖÆ ......

ÈçºÎÔÚÈÎÎñÀ¸ÏÔʾjava³ÌÐòͼ±ê

¸Ã´úÂëʵÏÖÁËÔÚϵͳÓÒϽǵÄÈÎÎñÀ¸ÖÐÏÔʾ³ÌÐòµÄͼ±ê£¬²¢ÇÒ×îС»¯³ÌÐòºóµ¥»÷ͼ±ê¿ÉÒÔÏÔʾ³öÀ´Õâ¸ö³ÌÐò´°¿Ú
import java.awt.Color;
¡¡¡¡import java.awt.Image;
¡¡¡¡import java.awt.MenuItem;
¡¡¡¡import java.awt.PopupMenu;
¡¡¡¡import java.awt.Toolkit;
¡¡¡¡
¡¡¡¡
¡¡¡¡import javax.swing.JFrame;
¡¡¡ ......

javaÊäÈëÊý¾ÝµÄÁ½ÖÖ·½·¨

1 »ù±¾·½·¨
 import java.io.*;
public class input1
{
public static void main(String[] args) throws IOException
{
InputStreamReader reader = new InputStreamReader(System.in);
BufferedReader buf = new BufferedReader(reader);
/* »òÕß
BufferedReader buf; ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ