"Always on top" behavior for Navigator Window?

Greetings,
Several of our users have asked for an "Always on Top" feature for the OHJ help navigator window. We are using OHJ 4.2.3, on Windows platforms. Our application displays help topics from certain dialog buttons and menu items (using CshManager.showTopic()). If the help windows are currently displayed from a previous help request and the user maximizes the application window, any new help requests are not seen as the help windows do not top themselves.
Is there any way to force the OHJ window to top itself when a new help topic is displayed? Our users are also asking for the help window to always be on top (a la Task Manager on windows) so they know where it is especially if they're performing a complex task and relying on a set of instructions in the help topic...
thanks,
Elizabeth Dyer.

Elizabeth,
As part of the showTopic() implementation OHJ calls toFront()
to bring the help window to the front. If this isn't working
in a particular case, please let us know. I don't think any
permanent "on top" feature is feasible, since OHJ windows are
normal Java dialogs and frames and selecting another Java
window will activate it instead of OHJ.
- Ryan (again with quoting from Jeff Stephenson)

Similar Messages

  • Always on top feature for inspector window

    Are there any ability to enable/disable 'Always on top' feature for inspector shown in separate window in Mac OS ? On my laptop not always comfortable to keep inspector in browser window. On Ubuntu window managers allow to pin windows always on top but mac os has no abilities to do it. (using firefox developer edition)

    Elizabeth,
    As part of the showTopic() implementation OHJ calls toFront()
    to bring the help window to the front. If this isn't working
    in a particular case, please let us know. I don't think any
    permanent "on top" feature is feasible, since OHJ windows are
    normal Java dialogs and frames and selecting another Java
    window will activate it instead of OHJ.
    - Ryan (again with quoting from Jeff Stephenson)

  • "Always on TOP"option for my window

    Hi All
    I am developing an application in which I wanted to develop a facility for enabling "always stay on top" to one of the windows .How can I do this.
    Thanks in advance
    Haritha

    I solved this problem using JNI, and I think that is the only way to allow the "Alwasy on Top" option. Here's how I did it.
    1. Create an extension of JFrame or JDialog or JWindow, whatever you want.
    2. Add the native method setAlwaysOnTop()
    import java.awt.*;
    import javax.swing.*;
    public class MyFrame extends JFrame {
    static { System.loadLibrary("MyFrame"); }
    public MyFrame() {
    super();
    public void setAlwaysOnTop(boolean b) {
    int hwnd = getNativeWindowHandle(this);
    seteAlwaysOnTop(hwnd, b);
    private native int getNativeWindowHandle(Window window);
    private native void setAlwaysOnTop(int hwnd, boolean flag);
    *NOTE the getNativeWindowHandle method is required to manipulate the frame in native code
    **NOTE I will take about the static { System.loadLibrary("MyFrame"); }
    at the end.
    3. Compile your code.
    4. Next you must create a c or c++ source file, name it whate every you want, and then define the setAlwaysOnTop method.
    Heres the code for the native file.
    #include <jni.h>
    #include <jawt.h>
    #include <afxwin.h>
    #include <windows.h>
    #include "MyFrame.h"
    #include "jawt_md.h"
    JNIEXPORT jint JNICALL
    Java_MyFrame_getNativeWindowHandle(JNIEnv *env, jobject jobj, jobject window)
    JAWT awt;
    awt.version = JAWT_VERSION_1_3;
    jboolean result = JAWT_GetAWT(env, &awt);
    if (result == JNI_FALSE)
    return 0;
    JAWT_DrawingSurface* ds = awt.GetDrawingSurface(env, window);
    if (ds == 0)
    return 0;
    jint lock = ds->Lock(ds);
    if ((lock & JAWT_LOCK_ERROR) != 0)
    return 0;
    JAWT_DrawingSurfaceInfo* dsi = ds->GetDrawingSurfaceInfo(ds);
    if (dsi != 0)
    return 0;
    JAWT_Win32DrawingSurfaceInfo* dsiwin = (JAWT_Win32DrawingSurfaceInfo*) dsi->platformInfo;
    jint ret = reinterpret_cast<jint>(dsiwin->hwnd);
    ds->FreeDrawingSurfaceInfo(dsi);
    ds->Unlock(ds);
    awt.FreeDrawingSurface(ds);
    return ret;
    JNIEXPORT void JNICALL
    Java_MyFrame_windowAlwaysOnTop(JNIEnv *env, jobject jobj, jint hwnd, jboolean flag)
    if (flag)
    SetWindowPos((HWND) hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
    else
    SetWindowPos((HWND) hwnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
    *NOTE say your class MyFrame is in the package com.me.swing then the method prototype would look like this:
    JNIEXPORT void JNICALL
    Java_com_me_swing_MyFrame_windowAlwaysOnTop(JNIEnv *env, jobject jobj, jint hwnd, jboolean flag)
    5. you may have noticed the #include "MyFrame.h" line, well that is generated by the javah command. So, next run javah on your MyFrame.class file. you will have to look at the options to configure the command to do what you want, but essentially "javah MyFrame.class".
    6. Make sure your MyFrame.h file and MyFrame.c or MyFrame.cpp file is in the same directory and compile them into an object file. Now you will have to figure out how to do this on your own. First you must get a c++ compiler, I use Visual C++ form Microsoft. If you are using that then
    here is the command line
    cl -Ic:\j2sdk1.4.0\include -Ic:\j2sdk1.4.0\include\win32 /c -LD
    -IMyFrame.h MyFrame.cpp
    Execute this command from the directory where you MyFrame.h and MyFrame.cpp files are or you will have to specify their paths.
    the -Ic:\j2sdk1.4.0\include -Ic:\j2sdk1.4.0\include\win32 provide path information to include the jni.h and jawt.h files.
    7. Now you will have to link the object file with the jawt.lib file and create the final dll. Again you will have to figure how to do this, but with VC++ the command is.
    link /DLL MyFrame.obj c:\j2sdk1.4.0\lib\jawt.lib
    Now you should 8 have files
    MyFrame.java
    MyFrame.class
    MyFrame.h *created form javah
    MyFrame.cpp
    MyFrame.obj *created from compiling
    MyFrame.exp *created from compiling
    MyFrame.lib *created from compiling
    MyFrame.dll *created from linking
    You are done, now create a main class and instanciate and test your new frame.
    **REMEBER the static { System.loadLibrary("MyFrame"); } line in your MyFrame.java file. This loads your newly created dll into the system so you can access it.
    **IMPORTANT THE MyFrame.dll AND THE MyFrame.class FILE MUST BE IN THE SAME DIRECTORY, OR SPECIFY IT IN THE System.loadLibrary METHOD CALL.

  • I just installed the lastest update of Firefox and now the Firefox window is always on top of all other windows - what a pain! How can I fix this?

    I looked at all of the options available to me and did not see where there is a link or anything saying "always on top." Is there such a thing somewhere and if so, where?

    Well hells bells - I went to watch TV and came back and all is good. Is it magic? :) (Some days I just plain don't understand anything - I swear!)

  • "Always on Top" of jdk 1.5 is not working when...

    I created a sample application that has Frame/Window and displays some text. Then i needed to make the window always visible on top of any other application or windows. But then when i opened applications like Battle Realms, Counter Strike, or any other games, the window is blocked by the previously run application.
    Can you help me on how can i provide solution with this?
    Thanks in advance.

    This might help you!!!
    About setAlwaysOnTop()
    Changes the always-on-top window state. An always-on-top window is a window that stays above all other windows except maybe other always-on-top windows. If there are several always-on-top windows the order in which they stay relative to each other is not specified and is platform dependent.
    If some other window already is always-on-top then the relative order between these windows is unspecified (depends on platform). No window can be brought to be over always-on-top window except maybe another always-on-top window.
    All owned windows of an always-on-top window automatically become always-on-top windows. If a window ceases to be always-on-top its owned windows cease to be always-on-top.
    When an always-on-top window is sent toBack its always-on-top state is set to false.
    This method makes the window always-on-top if alwaysOnTop is true. If the window is visible, this includes bringing window toFront, then "sticking" it to the top-most position. If the window is not visible it does nothing other than setting the always-on-top property. If later the window is shown, it will be always-on-top. If the Window is already always-on-top, this call does nothing.
    If alwaysOnTop is false this method changes the state from always-on-top to normal. The window remains top-most but its z-order can be changed in the normal way as for any other window. Does nothing if this Window is not always-on-top. Has no effect on relative z-order of windows if there are no other always-on-top windows.

  • "always on top" in fullscreen mode; disable switching away

    Hi,
    I am trying to write a mode for emacs that will keep out as many distractions as possible.  When activated, I can't switch away from the file I'm working on.
    Unfortunately, I can *easily* switch away from my fullscreen Emacs to my webbrowser or email program, and Gnome notifications appear on my screen on top of the Emacs window.
    Is there a way for me to push a fullscreen Emacs window (what Emacs users call a frame) to the top of the windowing stack and DISABLE SWITCHING AWAY FROM IT, while also stopping other windows from poppint above it in the stack?  I'm using Gnome right now, so something gnome-specific would be great, as would any generic solution for X.  There is an "always on top" option for windows in gnome (I am using the default window manager, whatever it is now -- metacity?  compiz? I don't even know anymore!), but it is disabled for fullscreen windows.  that makes sense, normally, but I would like to suspend some of the computer's functionality when I'm writing. 
    Also:  perhaps this deserves its own thread, but it would be nice if notification windows didn't overlay themselves on top of the window that I make this way.
    Thank you!
    Matt

    Hi,
    You say you're using gnome so the default window manager for that would be mutter. The gnome notifications can be turned off from
    gnome-control-center
      I don't know if that's an acceptable solution for you. As for disabling switching to other windows, I've had look in
    dconf-editor
    org --> gnome --> desktop --> wm --> preferences but I don't think I can much that's relevant there. Would disabling raise-on-click deliver the desired behaviour? Otherwise, you could try seeing whether there is an extension at https://extensions.gnome.org/.
    Hope you find what you're looking for
    Last edited by Chazza (2014-03-15 11:47:37)

  • Always On Top Functionality in Java

    Hi,
    I am opening a HTML file in IE browser from my swing application.But the html page always goes behind the application.I need to implement "Always On Top" functionality for the html page in java / javascript.
    any idea please ??
    Thanks

    Try this code. It should be work on all windows which are inherited from java.awt.Window
    * Call this from class consructor
    public void initialize() {
    TopThread top = new TopThread();
    top.start();
    * Keep JWindow on top (inner class)
    class TopThread extends Thread {
    public void run() {
    while(true) {
    toFront();
    * Let 10 milliseconds for other code to execute
    try {
    Thread.sleep(10);
    catch(Exception e) {
    // Nothing to do

  • Setting always on top makes it on top of non java applications.

    Hi all..
    If i set always on top property for my frame then my frame is always on top of all the application.
    While i want the frame to be always on top of my Java application not with other windows or any other application.
    Could you suggest me how to proceed for it.

    Typically an application only has a single JFrame, so it is either active or not.
    If you have child windows related to the main frame that you want to also be active when the frame is active then you use a JDialog and specify the main frame as the owner.

  • Facetime always on top

    why isn't there an 'Always on top' option for Facetime?

    I would also like to see this feature!!
    Very annoying when on FaceTime and you want to do something whilst talking.. you end up loosing the person you're speaking with behind whatever window is in the foreground i.e. web browser etc.
    Please fix this Apple!

  • JOptionPane show Message Dialog always on top found a Solution

    just thought of a solution for the age old java problem with message boxes / dialogs / input .
    It's funny when you google it you'll find like a million people asking for a solution but none or very few that gives an answer that works.
    this is probly not a new solution but i came up with this yesterday and thought i would "share".
    dunno why the java developers hasnt made a always on top function for this since there seems to be a very high demand for it.
    this hax will hopefully work at all times.
    hope google will find this thread, i searched for a solution yesterday and found none? which is surprising and im a pro googler too.
    import javax.swing.*;
    public class main{
         public static void main(String args[]){
              JFrame j=new JFrame();
              j.setAlwaysOnTop(true);
              j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              j.setVisible(true);
              j.setVisible(false);
              JOptionPane.showMessageDialog(j,"hi");
              System.exit(0);
    }

    I didn't realize it was an "age old problem." The JOptionPane's showXXX methods just show an ordinary modal dialog. If you want to set the alwaysOnTop property of said dialog then you just need to obtain a reference and call the method in question.
    JOptionPane op = new JOptionPane("hi",JOptionPane.INFORMATION_MESSAGE);
    JDialog dialog = op.createDialog("Message Dialog");
    dialog.setAlwaysOnTop(true); //<-- this line
    dialog.setModal(true);
    dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    dialog.setVisible(true);No need for an intermediate frame.

  • Always On Top Internal Frames

    Dear Friends,
    How we set Always on Top option for Internal Frames.
    Or User can't Do anything without closing that dialog(frame).
    Thankx.

    no, an internal frame can not be on top of anything that doesn't exist inside that frame.
    Maybe they can be forced on top of other content of the same frame, but that's as far as it goes.

  • Always on top under solaris (7)

    Hi all,
    I have searched through this forum and have found no usable answer to the question how to enable a window in Java to stay on top under Solaris 7. Best solution is probably through JNI (java native interface) but does anybody know any help about that?
    Thanx in advance,
    G

    I forgot to tell, that it is very probable that the always on top depends on the window manager. I am using mwm (motif window manager). As far as I know this mwm has no feature like letting a window stay on top.
    My despearat question would be that does anybody know any alternatives?
    Thanx,
    G

  • Making a Message Box always on top

    Hi all,
    I want a solution so that the message box I show on the screen should remain always on top of all the windows. Just like the common windows operating system modal dialog boxes so that the user cannot proceed unless and untill he closes the message box.
    I have tried with the JDialog by calling the method
    setModal(true);
    but unable to fix it.
    Thanx in advance,
    With regards
    Yuvraj
    Mumbai.

    If you instanciate your JDialog with the parent Frame, it will be always on top of it.
    JFrame fra = new JFrame();
    fra.setVisible(true);
    JDialog dia = new JDialog(fra);
    dia.setModal(true);
    dia.setVisible(true);
    Happy programming !

  • [Bug] Center panel is always on top

    When running Spotify installed from the Arch AUR, the center web panel is always on top, even when a window is maximized or the Spotify window is minimized.
    System information:
    Linux archie 3.17.6-1-ARCH #1 SMP PREEMPT Sun Dec 7 23:43:32 UTC 2014 x86_64 GNU/Linux
    Cinnamon 2.4.5
    GDM
    Screenshots:

    Same here...running Ubuntu 15.04 x64 in VirtualBox VM with two monitors.  Recent clean install with almost no custom configurations.

  • How can I script a Flash .exe file to always stay on top of all other windows?

    Hi All,
    I'm new to action script, and I just need this one script
    > How can I script a Flash .exe file to always stay on top of
    all other windows?
    Basically what i want to do is have a flash-created
    step-by-step instructional movie, but for the movie to remain on
    top of all windows so the instructee is able to follow the
    instructions on-screen...
    It would be preferable to not have to buy another product
    just to do this... as I said, this is the only scripting I need.
    Thanks in advance
    Cheers
    Rick

    if you create your exe with mProjector you can use one of its
    new AS
    commands to do this.
    setZOrder
    http://www.screentime.com/software/mprojector/docs/mWin_setZOrder.htm
    all APIS
    http://www.screentime.com/software/mprojector/docs/index.html
    Demo
    http://www.screentime.com/software/mprojector/demo.html
    mProjector installs new classes and help into Flash, to
    enable them you
    must build your app with mProjector (its input is your swf)
    John Pattenden
    Screentime Media - Flash Tools since 1997
    http://www.screentime.com

Maybe you are looking for