比如说
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Rectangle clipRect = g.getClipBounds();
Iterator iter = allShapes.iterator();
while (iter.hasNext()) {
((Rect)iter.next()).draw(g, clipRect);
}
}如果要让clipRect不止Rectangle一种类型,那我要怎么修改呢?
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Rectangle clipRect = g.getClipBounds();
Iterator iter = allShapes.iterator();
while (iter.hasNext()) {
((Rect)iter.next()).draw(g, clipRect);
}
}如果要让clipRect不止Rectangle一种类型,那我要怎么修改呢?
解决方案 »
- JSP问题,想知道这个语句是什么意思
- jsp 加载插件问题
- 关于java中关于sql语句的问题……
- 怎样测试文件关闭的时候发生IOException错误
- 请问怎么拿数据库的时间跟当天的时间进行比较啊!!!!
- 哪们仁兄有JDK1.5的中文文档吗?
- 请教名词解释
- 求高手解决这个简单的问题!!
- 新手关于 HelloWorld.java
- jbuilder编辑器中光标定位问题!
- 一个赋值空间的问题(希望,各路高手云集,来解决下这个问题)分不多,但是礼轻情谊重。
- jar命令,为什么打包的中文名为乱码?------------------在线等待------------------------------------------------
g.getClipBounds()返回的就是Rectangle的类型阿