编程论坛's Archiver

xiaoyu2006 发表于 2008-5-10 16:47

已解决!!!

import java.io.*;
import java.net.*;
public class TcpServer {
        public static void main(String[] args) {
                // TODO Auto-generated method stub
                try
                {
                ServerSocket ss = new ServerSocket(8001);
                Socket s = ss.accept();
            InputStream ips = new s.getInputStream();
            OutputStream ops = new s.getOutputStream();
            ops.write("welcome to zz de world!".getBytes());
            byte [] buf = new byte[1024];
            int len = ips.read(buf);
            System.out.println(new String(buf,0,len));
            ips.close();
            ops.close();
            s.close();
            ss.close();
                }
                catch(Exception e)
                {
                        e.printStackTrace();
                }
        }

}
错误提示:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
        s cannot be resolved to a type
        s cannot be resolved to a type
请问这是为

[[it] 本帖最后由 xiaoyu2006 于 2008-5-10 17:23 编辑 [/it]]

sunkaidong 发表于 2008-5-10 17:14

new s.getInputStream();有这样的创建格式吗?java的包我懂的有限..还中毒了..不能运行看结果...郁闷

[[it] 本帖最后由 sunkaidong 于 2008-5-10 17:15 编辑 [/it]]

cbmtv 发表于 2008-5-10 17:17

想请问一个问题
我想把图片改成一个一个向左移动的那种
要怎么改哟
帮帮我

sunkaidong 发表于 2008-5-10 17:19

好像有人做过...把图片用graphic显示..然后对键盘事件监听..

xiaoyu2006 发表于 2008-5-10 17:20

谢谢啊,实在不好意思,是我疏忽了!

cbmtv 发表于 2008-5-10 17:21

<MARQUEE onmouseover=this.stop(); onmouseout=this.start(); scrollAmount=5 height=20>

我用的这种方法
可为什么图片变成了一排一个的那种了

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.