import java.io.*;import java.net.Socket;import java.net.SocketException;public class TestClient { public static void main(String args[]) { try { Socket s1 = new Socket("localhost",8884); InputStream is = s1.getInputStream(); DataInputStream dis...
import java.io.*;import java.net.Socket;import java.net.ServerSocket;public class TestServer { public static void main(String args[]) { try { ServerSocket s = new ServerSocket(8888); while (true) { Socket s1 = s.accept(); Out...
import java.io.InputStreamReader;import java.io.BufferedReader;import java.io.IOException;import java.net.URL;import java.net.MalformedURLException;public class URLReader{ public static void main(String args[]){ try{ URL tirc = new URL("http://www.google.cn/"); B...
import java.net.InetAddress;public class TestInetAddress { public static void main( String args[]) { try{ InetAddress ia = InetAddress.getLocalHost(); showInfo(ia); ia = InetAddress.getByName("www.sina.com.cn"); showInfo(ia); ...
package com.yds.gui.threepart;
import java.awt.Button;import java.awt.Frame;import java.awt.GridLayout;import java.awt.Panel;import java.awt.TextField;
public class Jishuan { static Button b1, b2, b3, b4, b5, b6, b7, b8, b9; static Button b11, b12, b13,b14;
public static void main(String[] ar...
package com.yds.javatalk;
import java.awt.Button;import java.awt.Frame;import java.awt.Panel;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;
public class ButtonTest extends Frame implements ActionListener { Button b1,b; ButtonTest(){ Panel p=new Panel(); b=new Button...
import java.io.IOException;import java.net.DatagramPacket;import java.net.DatagramSocket;import java.net.InetAddress;import java.net.SocketException;public class UdpClient { public static void main(String[] args) { try { DatagramSocket ds = new DatagramSocket(); ...
public void actionPerformed(ActionEvent e) { // System.out.println(); if (e.getActionCommand().equals("启动服务")) { System.out.println("已经进来了"); System.out.println(this.tf1); } // } else if (e.getActionCommand().equals("停止服务")) { // System.out.println("!!!!!!!"); // } else if (e.getActi...