文件名称:95
-
所属分类:
- 标签属性:
- 上传时间:2014-03-14
-
文件大小:16.11kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
编程思路:本练习因为要实现华容道游戏中人物的构造,所以首先要生成表示人物的矩形块,这是通过语句Rectangle rect=null实例化Rectangle类,然后在People类的构造函数里通过语句rect=new Rectangle(x,y,w,h)实现有戏中人物的构造。然后因为要实现人机交互的效果,所以要响应当前光标的焦点事件,通过public void focusGained(FocusEvent e)函数得到焦点,通过public void focusLost(FocusEvent e)函数失去当前焦点,参数是焦点事件类FocusEvent的对象e.最后,因为要配合焦点的移动来设置颜色,所以用到了颜色类Color,当得到焦点的时候,通过语句setBackground(Color.red)将背景色设置为红色,当失去焦点的时候,通过语句setBackground(Color.orange)将背景色设置为橙色-Programming ideas: this exercise because Huarong game characters to achieve the structure, so the first character to generate said rectangular block, which is by the statement Rectangle rect = null instantiated Rectangle class, then class' s constructor People rect by the statement = new Rectangle (x, y, w, h) to achieve the structure Me characters. Then because to achieve the effect of human-computer interaction, so to respond to the current cursor focus events, through public void focusGained (FocusEvent e) function to get the focus, the focus of the current function lost through public void focusLost (FocusEvent e), the parameter is the focus of the event class FocusEvent The object e. Finally, because the focus moves to tie to set the color, so use a color class Color, when I get the focus through the statement setBackground (Color.red) set the background color to red, when losing focus, By statement setBackground (Color.orange) set the background color to orange
(系统自动生成,下载前可以参看下载内容)
下载文件列表
练习95华容道(一)/HuaRongRoad.class
练习95华容道(一)/HuaRongRoad.html
练习95华容道(一)/HuaRongRoad.java
练习95华容道(一)/People.class
练习95华容道(一)/_desktop.ini
练习95华容道(一)/练习95华容道(一).doc
练习95华容道(一)
练习95华容道(一)/HuaRongRoad.html
练习95华容道(一)/HuaRongRoad.java
练习95华容道(一)/People.class
练习95华容道(一)/_desktop.ini
练习95华容道(一)/练习95华容道(一).doc
练习95华容道(一)
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.