-1

I´m trying to get the running programs with graphic interfaz that I have running and iterate over them to give them focus. Is there a way to do this with java (or any other language)?

Searching the web I only find things for Android. Any help is appreciated

Example: I have my calculator open, and my app made with javafx. My app shows me a list with all the programs running in my computer, in this example, it shows me that the calculator is open. There is a button next to each item of the list, and if I click on them, I can give the calculator focus and start using it.

daniel gon
  • 159
  • 2
  • 14
  • 2
    I am not sure I understand the question. Can you try to clarify with an example? – Juan Dec 11 '18 at 13:54
  • 2
    Read about JavaFX or Swing – Rafał Sokalski Dec 11 '18 at 13:55
  • I am aware of this: Microsoft Assessment and Planning (MAP) Toolkit – robot_alien Dec 11 '18 at 13:56
  • 1
    I agree, I am confused as well. I guess you are NOT asking about GUI toolkits such as Swing or JavaFX? (if so, your question title is grossly misleading the reader) – GhostCat Dec 11 '18 at 13:57
  • You can use the Windows API to get access to other applications. Then you can send keystrokes or other predefined messages to that window and show/hide/focus them. – f1sh Dec 11 '18 at 14:02
  • 1
    Please clarify what you have meant by " graphic interfaz that I have running and iterate over them to give them focus". Does it mean that you currently have java console applications(those applications that run in CMD) and that you want the same application to have a graphical UI to make it more user friendly? We are more than ready to help you as we have struggled a lot in figuring out how to program at first. Please clarify as what you wanted to achieve is not clear from your question. – arunken Dec 11 '18 at 14:04
  • First you need to get familiar with using graphical user interfaces in Java. You can use java swing for this purpose. Get familiar with it first and the rest you want to achieve like you have said in your example is possible. But you need to get used to creating graphical UI applications using Java swing. There are lots of tutorials online available online related to java swing. We can help you on your way if you get stuck or have any problem in understanding things. – arunken Dec 11 '18 at 14:12

1 Answers1

0

You could use ps on the Linux and tasklist on the Windows. Java allows you the command line access.

Oleg Cherednik
  • 17,377
  • 4
  • 21
  • 35