Getting the state of a window [duplicate] - java

This question already has answers here:
Getting active window information in Java
(3 answers)
Closed 4 years ago.
I'm trying to get the state of a window on Windows. I have to check if the window of word is active or inactive. I don't find any answer to this problem in Google.
Does anyone knows how to do this or if this is possible at all?
Window activeWindow = javax.swing.FocusManager.getCurrentManager().getActiveWindow();
The code above returns always NULL.
Thank you for your answers.
Regards
Roman

Try to use frame.hasFocus() or frame.isFocusOwner()
https://docs.oracle.com/javase/7/docs/api/javax/swing/JFrame.html

Related

i want to add two numbers in android studio but when i click on a button my app crashed? [duplicate]

This question already has answers here:
Unfortunately MyApp has stopped. How can I solve this?
(23 answers)
Closed 2 years ago.
I use two edit fields and get their texts in on lick method of a button, but when i click button my app crashed. please help me to resolve this problem.
I am fresh one here, if I make any mistake in uploading my question ignore it
thanks..!
Text Field returns a string, which can be a non-number string.
A try-catch block would help if the method could not parse it into an integer.

onKeyReleased does not work when a character is typed [duplicate]

This question already has answers here:
How to disable Button when TextField is empty?
(3 answers)
Closed 3 years ago.
I want to disable the button when the text fields are empty.
I have created two fields with the onKeyReleased property
Sorry i sent it unintentionally.
Something like btn.disableProperty().bind(field.textProperty().isEmpty()) should work.
In the future please add a compilable skeleton and what you have tried so far to your question. That makes it way easier to help.
And welcome to stack overflow!

Java Swing checkboxes active [duplicate]

This question already has answers here:
How to add a radio button group in a core java program such that only one radio button is selected at one time?
(3 answers)
Closed 6 years ago.
I have a short question for you.
I have 2 checkboxes and I want to: when is the active one, the other should be off.
Tks in advance!
Please use JRadioButtons, that would fulfill your requirement.

Is there any way block Control-Alt-Delete in java? [duplicate]

This question already has answers here:
Disable the Ctrl-Alt-Delete event through Java program
(4 answers)
Closed 7 years ago.
Is there any way to block the control key in java. I have looked and looked but I have not found any way to do it thanks in advance
There is no way to block CTRL+ALT+DELETE. In any way, shape or form. It is an absolute guarantee against hacking.

Gwt check if object has focus [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Why is there no isFocused() in GWT?
Hi guys is possible check if a specific object has focus ? My problem in my web app is determine which object has focus when i press tab button, for each focus i need to do a specific action. thx
This is already addressed here - Why is there no isFocused() in GWT?
Please use the stackvoverflow search!!!!

Categories

Resources