Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009
    Posts
    2
    Rep Power
    0

    Default Image that remains always on the top of the windows

    hello everyone,

    I would like to write an application in java which should keep my image always on the top of the windows desktop. Just like VirtuaGirl applications.

    Is it possible to achieve this in java?

    If yes, then what are the packages i need to use ?

    Image should not be in a box or an applet window. Only the image shape say fish shape should float on the window.

    -Satish Nankani (satishnankani@gmail.com)

  2. #2
    neilcoffey is offline Senior Member
    Join Date
    Nov 2008
    Posts
    286
    Rep Power
    7

    Default

    You say "float on the window", so does that mean you want the image to remain inside one of your application's windows, just on top of everything else in that Window? If so, look at the setGlassPane() method.

    If you mean "on top of everything" on the desktop, then you can "almost" do it:
    - create a (J)Window just the right size for your image (a Window has no border, unlike a (J)Frame) and paint your image into that
    - call setAlwaysOnTop() to be true on your window
    - now, if your image isn't rectangular the tricky bit: I don't think there's a way to make a Java window transparent. But what you can do is create a component whose paint method uses the Robot class to capture the screen behind and then paint this. I seem to recall the "Swing Hacks" book (O'Reilly) contains an example.

  3. #3
    Join Date
    Jan 2009
    Posts
    2
    Rep Power
    0

    Default

    Thanks for the reply neilcoffey.

    Eventhough i was not able to put my requirement properly, I highly appreciate the way you answered both the possibilities of the question.

    Actually I want to keep my image on the top of everything, which should be tranparent, say something like when we watch the TV channels we see Channel logo's on the top. like HBO,AXN

Similar Threads

  1. Replies: 6
    Last Post: 04-08-2009, 05:05 AM
  2. Canvas Image popups another image (SWT)
    By SpaceY in forum New To Java
    Replies: 2
    Last Post: 11-11-2008, 02:25 PM
  3. drawing an image to an offscreen image
    By hunterbdb in forum Java 2D
    Replies: 9
    Last Post: 10-30-2008, 07:17 PM
  4. Replies: 0
    Last Post: 01-08-2008, 06:29 PM
  5. swt for windows
    By Gajesh Tripathi in forum SWT / JFace
    Replies: 2
    Last Post: 10-18-2007, 07:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •