label over button

8 views
Skip to first unread message

Patrick Ngo

unread,
Nov 8, 2011, 11:42:48 PM11/8/11
to AsWing Discuss
Hello,

I have a panel which appends a very large JButton and a few JLabels.
The JButton is appended first and the JLabels are appended after. The
JLabels are physically over the JButton. My issue is that the area of
the JLabels makes that area of the JButton unclickable. I have tried
setting the JLabels to "not enabled" using the "setEnabled()"
function, however that makes the JLabels blurry for some reason.

To sum it up, I wish to have JLabels over my JButton and have them not
enabled. However I don't want them to be blurry. If you could give me
some insight on how to achieve this I would greatly appreciate it.

iiley

unread,
Nov 9, 2011, 2:34:19 AM11/9/11
to aswing-...@googlegroups.com
Hi Patrick,

There is a trick to solve the issue:

yourLabel.mouseEnabled = false;
yourLabel.mouseChildren = false;

it will work

2011/11/9 Patrick Ngo <pn...@sava.com>



--
-iiley
Burstyx Studio Limited

Reply all
Reply to author
Forward
0 new messages