您的位置:首页 >> 编程开发 >> Java >> Java基础 >> Eclipse >> 正文
RSS
 

Eclipse简介和插件开发

http://www.rdxx.com 04年12月06日 12:12 Blog 我要投稿

关键词: 插件 , Eclipse , 开发 , IP

            URL url  =new URL("http://weather.news.sina.com.cn//cgi-bin/figureWeather/simpleSearch.cgi?city="+city);
            String temp="";
            BufferedReader in 
             = new BufferedReader(new InputStreamReader(url.openStream()));
            //使用openStream得到一输入流并由此构造一个BufferedReader对象
            String inputLine;
            //从输入流不断的读数据,直到读完为止
            while ((inputLine = in.readLine()) != null)
                temp=temp+inputLine+"\n";
            //关闭输入流
            in.close();  
            String  weather
             =temp.substring ( temp.indexOf( "<body"),
                                  temp.lastIndexOf( "body>")+5);
            
            this.jEditorPane .setText(weather);
        } 
        catch (Exception e)
        {
            e.printStackTrace();
        } 
        this.setTitle("天气预报");
        this.setSize(400, 166);
        
    }
    /**
     * This method initializes jEditorPane
     * 
     * @return javax.swing.JEditorPane
     */    
    private JEditorPane getJEditorPane() 
    {
        if (jEditorPane == null) 

 
 
标签: 插件 , Eclipse , 开发 , IP 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站