鼠标移动监听的注意事项


鼠标移动是高级动作,不能用MouseListener 而要用 MouseMotionListener

 

其他小知识点:

金额:不使用double 而使用BigDecimal

窗体居中显示:f.setLocationRelativeTo(null);

f.setIconImage(arg0);//设置窗体默认图标

随机数:
1.
Math.random()方法是一个可以产生[0.0,1.0]区间内的一个双精度浮点数的方法
产生一个100以内的整数:int x=(int)(Math.random()*100);

2.
Random random = new Random();
产生一个(1-100)以内的整数:int x=random.nextInt(100)+1 // [0,99)

HashMap底层是数组加链表实现的

HashMap、ArrayList、HashSet、Properties 常用

posted @ 2015-11-18 15:26  曾颐楠  阅读(339)  评论(0编辑  收藏  举报