Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ALT TAB  RSS feed

 
Joel de Matos
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, i am currently developing a swing app for a presentation.
This presentation will have the cliend and a powerpoint presentation running at the same time.
The thing is how do i switch from my app to ppt? Using ALT TAB is NOT an option so i want to associate that functionality to a button that when pressed it wil load the PPT.
I have looked for this everywhere but i found nothing
Thanks in advance.

Best regards,
Joel
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can launch a native application with the family of java.lang.Runtime.exec() methods.
 
Joel de Matos
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so mutch for you quick answer, but my problem is switching between 2 running apps (My swing app and a powerpoint presentation) not launching the ppt. I can exec() the "tasklist" command and parse the result to get the pid of the presentation, but how do i change the focus to it?
Thanks
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no Java way -- this is an OS-specific issue which needs an OS-specific solution. You can reduce the problem to using Runtime.exec() to launch something which brings PowerPoint to the front -- then you have to go and find that something. I think this is easy enough to code in C with the Win32 APIs; I'm not much of a Windows person myself, but I imagine with a little Googling you could find an app that brings an application to the front by name or window title or such.
 
Joel de Matos
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will try that.
Thanks for your help Ernest!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!