Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

Java-Application to front

Thread view: 
Oliver Hirschi - 15 Sep 2006 06:36 GMT
Hi

How can I programatically  take my java-application under MacOSX to
front?
I have a JFrame and I think I tested all kinds of methods to do this:
"toFront, setVisible, invalidate, validate, setenable, etc."

Under Win it works well as follow:
------------------------------------
// disable and minimize Frame
this.setVisible(false);
m_oApp.getFrame().setEnabled(false);
m_oApp.getFrame().setExtendedState(Frame.ICONIFIED);

// SWITCH
SwitchSend oSwitchSend = new SwitchSend(m_oApp, m_oJob);
oSwitchSend.pmm_CallSwitch(m_oObPubForm_Layout, m_oObPubForm_Extract);

// enable and reactivate Frame
m_oApp.getFrame().setExtendedState(Frame.NORMAL);
m_oApp.getFrame().setEnabled(true);
this.setVisible(true);
this.requestFocus();
------------------------------------

Thanks a lot.
Signature

Oliver Hirschi
http://www.FamilyHirschi.ch

--
Oliver Hirschi
http://www.FamilyHirschi.ch

Oliver Wong - 15 Sep 2006 17:08 GMT
> Hi
>
> How can I programatically  take my java-application under MacOSX to front?
> I have a JFrame and I think I tested all kinds of methods to do this:
> "toFront, setVisible, invalidate, validate, setenable, etc."

   toFront is the standard way, but from what I understand, the OS is free
to ignore the request, or implement it in ways other than simply bringing
the window the the front (in Windows XP, for example, it'll cause its
corresponding entry in the taskbar to flash). Think of toFront as a
"request" to be brought to front, rather than a direct order to do so.

   See
http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Window.html#toFront()

   - Oliver
Oliver Hirschi - 18 Sep 2006 08:15 GMT
>> Hi
>>
[quoted text clipped - 12 lines]
>    See
> http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Window.html#toFront()

I have seen this and it seems that there is only the way to do this, to
implement a nativ library for each OS and a jni-interface.

by-the-way: On win 2000 there is the behaviour i want (the application
comes really to front). On win xp, i can get the behaviour when I reset
the system flag "Prevent applications from stealing focus" with the
powertoy TweakUI from microsoft.

Oli


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.