首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

批改Eclipse启动图片

2012-09-15 
修改Eclipse启动图片import java.io.File import java.util.ArrayList import java.util.List import j

修改Eclipse启动图片

import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Random;  public class RunEclipse {      private static String picFolder = "mysplash";      /**     * @param args     * @throws Exception     */     public static void main(String[] args) throws Exception {          makeFolder(picFolder);          String runString = "eclipse.exe -showsplash ";         runString += picFolder;         runString += "\";         runString += getShowPictureName(picFolder);          Runtime rt = Runtime.getRuntime();         rt.exec(runString);      }      private static void makeFolder(String folder) {         File file = new File(folder);         if (!file.exists()) {             file.mkdir();         }     }      /**     * @param args     */     private static String getShowPictureName(String filePath) {          int picCount = 0;         List<String> picList = new ArrayList<String>();         String strRun = "";          File file = new File(filePath);          if (file.isDirectory()) {             String[] filelist = file.list();              for (int i = 0; i < filelist.length; i++) {                 if (filelist[i].toLowerCase().endsWith(".bmp")) {                     picCount++;                     picList.add(filelist[i]);                 }             }              if (picCount > 0) {                 Random rand = new Random();                 int index = rand.nextInt(picCount);                 strRun = filelist[index];             }         }          return strRun;     }  }  

热点排行