![](/img/trans.png)
[英]I can't draw multiple lines in JLabel with mouse listener such as pressed and released
[英]Is there a way to detect mouse released on another JLabel?
您好,假设我有两个不同的JLabel,实现了两个不同的MouseListener。
我想要的是在Label1上按下鼠标,如果我在Label2上释放它,则返回true,否则返回false。
有什么办法吗? 我正在尝试hasFocus()方法,还有更多方法,但是没有一个可以满足我的需要。
您应该考虑使用MVC:这是它的确切目的!
本教程非常简单,并得到了很好的解释: http : //www.tutorialspoint.com/design_pattern/mvc_pattern.htm
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.