zoukankan      html  css  js  c++  java
  • java代码

    1,

        Properties prop= new Properties();
            try {            
                InputStream is = this.getClass().getResourceAsStream ("/data.properties");
                prop.load(is);             
            }catch(Exception e) {
                // fatal error!
                System.err.println("FATAL ERROR: application root configuration not found: data.properties");
                System.exit(0);
            }
    
            String coreRootRelative = prop.getProperty("COREROOT");
            
            Class c = this.getClass();
            URL u = c.getProtectionDomain().getCodeSource().getLocation();        
            String fileUri = "";
            try
            {
                fileUri =  URLDecoder.decode(u.getFile(), "UTF-8") ;
            }
            catch(UnsupportedEncodingException e)
            {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }        
              
            File f = new File(fileUri); 
            String coreRootBeforeChanges = f.getParent();

     2.

        protected void processWindowEvent(WindowEvent e) {
            super.processWindowEvent(e);
            int defaultCloseOperation = getDefaultCloseOperation();
            if (e.getID() == WindowEvent.WINDOW_CLOSING ){
                if(defaultCloseOperation != DO_NOTHING_ON_CLOSE){
                this.closeCancel();
                }
            // processActionEvent(new ActionEvent(this,
            // ActionEvent.ACTION_PERFORMED, CANCEL_COMMAND));
            }else if (e.getID() == WindowEvent.WINDOW_OPENED) {
                // simulate tab from last to wrap around to first & properly set
                // initial focus
                if (getComponentCount() > 0)
                    getComponent(getComponentCount() - 1).transferFocus();
            }
        }
  • 相关阅读:
    scrapy相关信息
    BeautifulSoup常见使用
    requests常用模块以及爬取github个人项目
    django rest framework 与前端跨域问题解决
    nginx配置正向代理与反向代理
    django+nginx+uwsgi+https
    linux基本命令
    python基本算法
    centos7配置ftp服务器
    nginx1.12配置
  • 原文地址:https://www.cnblogs.com/happyPawpaw/p/2942934.html
Copyright © 2011-2022 走看看