Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Pictures outside of a window?  (Read 684 times)
0 Members and 1 Guest are viewing this topic.
Offline Sequalit

Jr. Member
**

Posts: 59



« on: 2006-02-13 00:50:46 »

I was wondering, is there any way in Java that you can make it so that you can have like a dog or cat graphic run around on your windows desktop, instead of being like inside of a JFrame or something, let the desktop be the Frame environment?

while(gettingTired())
     crankOutMoreCode();
     if(asleep()){
          wakeUp();
          makeCoffee();
          chugCoffee();
     }
}

-Sequalit
Offline moogie

JGO Strike Force
***

Posts: 775
Medals: 5


Java games rock!


« Reply #1 on: 2006-02-13 02:12:37 »

I believe you can.

I have not tested it, however i believe java 1.5 has a method ( setAlwaysOnTop(boolean) )
which causes the window/frame to always be on top. Thus by removing the decorations from the window and making the frame non-selectable you should be able to achieve what you are after.

I do know and have used a windows only library for java which achieved the same using java 1.4

it is called SkinLF

http://skinlf.l2fprod.com/

here is a tutorial for it which may help you:

http://skinlf.l2fprod.com/tutorials/page4/tutorial-clock.php
Offline swpalmer

JGO Kernel
*****

Posts: 3438
Medals: 4


Where's the Kaboom?


« Reply #2 on: 2006-02-13 08:43:17 »

You can't do this properly.  Java does not yet support transparent or irregularly shaped windows.  The closest thing you could do is to use the Robot class to capture the desktop areas that your dog or cat was going to walk over and then blit that background content into your rectangular wind that holds the dog/cat image.

Ages ago I posted a small sample of the technique that simply allowed you to drag a circle around the desktop.

There is an issue in Sun's bug database about the transparent windows and irregular shapes.  It's been there for a while now  (since Java 1.2) and it still doesn't look like it will make it into Mustang.. so that means it is another two years off at least... (sigh...)


Games published by our own members! Go get 'em!
Offline Riven
« League of Dukes »

JGO Kernel
*****

Posts: 5870
Medals: 255


Hand over your head.


« Reply #3 on: 2006-02-13 11:48:35 »

As long are your cat or dog is completely square, you have no problem Smiley

Hi, appreciate more people! Σ ♥ = ¾

Learn how to award medals... and work your way up the social rankings
Online cylab

JGO Kernel
*****

Posts: 1940
Medals: 27



« Reply #4 on: 2006-02-13 12:10:53 »

And if they are not just bonsai them  Grin

Mathias - I Know What [you] Did Last Summer!
Offline jbanes

JGO Neuromancer
****

Posts: 1178


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #5 on: 2006-02-13 12:20:54 »

And if they are not just bonsai them  Grin

Hmm... I see I'm not the only one who had that exact same thought after reading Riven's post. (And nearly snorting a Starbucks, BTW. Thanks a lump Riven! Wink)

Java Game Console Project
Last Journal Entry: 12/17/04
Offline Sequalit

Jr. Member
**

Posts: 59



« Reply #6 on: 2006-02-15 01:35:08 »

thanks for the help guys! =D


while(gettingTired())
     crankOutMoreCode();
     if(asleep()){
          wakeUp();
          makeCoffee();
          chugCoffee();
     }
}

-Sequalit
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.089 seconds with 20 queries.