• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

2 Queations: Button Focus, and mouseListener/windowFocus

ZXQ

Limp Gawd
Joined
Jul 22, 2004
Messages
160
//edit: HAHA! Typo in the title, can someone fix that?

Ok all, I'm a little stumped at the moment. I'll be honest, I've been drinking a bit, as is my tradition on saturday nights while doing programming homework, but, I think that might have screwed me a bit (no, not really, but I have to blame something).

Yes, this is homework, and yes, I know I'm not supposed to be 'ignorant noooooooob', but, I understand the logic here.

user clicks window
change button status to enabled, or inFocus, or whatever
user clicks off window
change button status to disabled, or outFocus, or whatever

Anyway, the API listings are betraying me this evening. I'm trying to find the best code to do the following:

When the window is out of focus, 2 specific JButtons are greyed out (not even sure on how to do that. I bet its just a simple JButton option, but, I can't freaking find it, and its annoying as hell.)

When the window comes into focus, change those JButtons to enabled (also, not sure how to do this, but, its obviously the opposite of the previous issue.)


There are no recommended methods, or ideas on how to obtain this outcome, so, this is where I'm lost. Should I be using a mouseListener? or maybe a windowInFocus? And what option of a JButton would let me just 'grey it out' as in, visible, but obviously not usable?

Theres some other things in this homework, but its cake. Exception handling stuff, I've got it handled.


<3 you all if I could get some recommendations.
 
Ok, got everything handled, EXCEPT how to set the window focus, based on mouse, of inFocus.

Can't figure out either method.
 
Back
Top