On Tue, Sep 05, 2000 at 06:24:56PM +0530, Gurumurthi, Nandakumar wrote:
> 
> Hi,
> 
> My problem concerns both Java and Linux, and I'm of the opinion that this would
> be the ideal place to post the problem - " On linux, using java, how do I create
> a Window that will *always* remain on top of all other windows ?" I need to
> create a window that will always remain on top of all other windows. It should
> also be possible for me to add swing/awt components like JButton to this window.
> 
> 
> >From the JDC mailing lists, I came to know that it is NOT possible to write pure
> java code to accomplish the above task, and that it should be possible to write
> native code to accomplish the same. 
> 
> I am clueless, on how I should proceed. Can someone show me the way ?

I don't have code handy, but here's an outline of how you could solve
the problem in some JNI code...

You'll need to write some native code that knows how to deal with the X
Window System, and access it through a class with one or more methods
declared "native". In that code, you'll need to:

1) Open a connection to the X server and find your top-level window.
   Under JDK1.3, there are ways to directly get handles to objects
   in the X Window System; under earlier JDKs, you'll need to search
   the window hierarchy for your window.

2) Write a loop, running in its own thread, to listen for
   ConfigureNotify events on your window. When you get an event
   indicating that your window is not on top, issue an XRaiseWindow
   request for your window.

Unless you have experience programming for the X Window System, turning
this into code will take you up a steep learning curve... but that's
basically what needs to be done.

Nathan Meyers
[EMAIL PROTECTED]


> 
> Thanks in advance.
> Nandakumar. 
> 
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to