区别Display.getDefault()与Display.getCurrent()
Display.getDefault(): 该方法会返回用户图形界面线程中的Display实例,不管当前线程是否是用户图形界面线程.如果这个实例不存在,默认创建一个用户图形界面线程中的Display实例.
/** * Returns the display which the currently running thread is the * user-interface thread for, or null if the currently running thread is not * a user-interface thread for any display. * * @return the current display */public static Display getCurrent(){return findDisplay(Thread.currentThread());}