小编Mez*_*alt的帖子

检查是否在Java中单击了鼠标

我正在用Java编写GUI.我需要知道如何检查用户是否点击了鼠标.我知道如何检查鼠标的位置,但我只需要检查它是否被点击.

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
/*
 * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this …
Run Code Online (Sandbox Code Playgroud)

java mouse swing click mouselistener

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

click ×1

java ×1

mouse ×1

mouselistener ×1

swing ×1