// Create a list
String[] items = {"A", "B", "C", "D"};
JList list = new JList(items); // Add a listener for mouse clicks
list.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt) {
JList list = (JList)evt.getSource();
if (evt.getClickCount() == 2) { // Double-click
// Get item index
int index = list.locationToIndex(evt.getPoint());
} else if (evt.getClickCount() == 3) { // Triple-click
// Get item index
int index = list.locationToIndex(evt.getPoint()); // Note that this list will receive a double-click event before this triple-click event
}
}
});
Related Examples

最新文章

  1. spring boot(五):spring data jpa的使用
  2. python的编码规范【摘】
  3. 【原创】WinForm 模态对话框
  4. x01.Lab.StoreApp: XP 停服,微软变脸
  5. 《JavaScript模式》第3章 字面量和构造函数
  6. 41. Unique Binary Search Trees && Unique Binary Search Trees II
  7. LeetCode OJ-- String to Integer (atoi) **
  8. Cornerstone无法上传静态库文件(.a文件)
  9. VB读写INI文件的四个函数以及相关API详细说明
  10. Python计算机视觉3:模糊,平滑,去噪
  11. 虚拟键盘,移动web开发的痛
  12. HALF<水题>
  13. php 运算符and or && || 的详解
  14. UWP中实现大爆炸效果(二)
  15. selenium+python启动浏览器出错,安装浏览器驱动
  16. spring4笔记----PropertyPlaceholderConfigurer 属性占位符配置器
  17. SwipeableFlatList 实现类似于QQ列表滑动
  18. python系统编程(八)
  19. Mybatlis SQL 注入与防范
  20. Linux 条件变量函数signal和wait补充

热门文章

  1. (原创)c++11改进我们的模式之改进观察者模式
  2. 每日英语:Patent Wars Erupt Again in Tech Sector
  3. ffmpeg转码参数设置
  4. 【转】suspend造成死锁
  5. 【Java】自动类型转换规则
  6. 软链接ln -s以及如何解决其产生“Too many levels of symbolic links ”的错误?
  7. How To Install Java with Apt-Get on Ubuntu 16.04
  8. django 部署,gunicorn、virtualenv、nginx
  9. WriteableBitmap/BitmapImage/MemoryStream/byte[]相互转换
  10. PHP判断当前页面是电脑登录,还是手机登录