Java游戏中延迟下载资源及调用示例 - 编程入门网
file except in compliance with the License. You may obtain a copy of
* the License at
*
* [url]http://www.apache.org/licenses/LICENSE-2.0[/url]
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*
* @project loonframework
* @author chenpeng
* @email:ceponline@yahoo.com.cn
* @version 0.1
*/
public class Main extends Frame { /** * */ private static final long serialVersionUID = 1L; public Main(String titleName, int width, int height) { this.setTitle(titleName); this.setBackground(Color.black); this.setPreferredSize(new Dimension(width + 5, height + 25)); this.requestFocus(); this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); DownloadCanvas progress = new DownloadCanvas(this,width,height); this.add(progress); this.pack(); progress.createBufferGraphics(); this.setResizable(false); this.setLocationRelativeTo(null); this.setIgnoreRepaint(true); this.setVisible(true); } public static void main(String[] args) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Main("下载游戏数据", 640, 480); } }); } } Java游戏中延迟下载资源及调用示例(9)时间:2011-01-26 cping程序执行效果如下图所示: 下载完毕后后将自动加载并执行下载的Java2.5D行走示例,画面如下图: (源码依旧在Jar中) 源码下载地址:http://code.google.com/p/loon-simple/downloads/list 本文出自 “Java究竟怎么玩” 博客,请务必保留此出处http://cping1982.blog.51cto.com/601635/154277 |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |