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 / Java 3D / November 2003

Tip: Looking for answers? Try searching our database.

Drawing to the primary surface (screen) in Java

Thread view: 
Jeff Bronte - 02 Nov 2003 04:00 GMT
I'm looking for an experimentation platform, and I like Java, but
I can't find (easily) whether you can do the following: (also, if you
answer 'yes', can you give me the class/method that I need to look at?

#1 Drawing to the primary surface (not in a frame/dialog/applet)
#2 Alpha blending with existing primary surface (like putting up a
     'see through' menu on top of a non-java application window)
#3 Intercepting and dispatching mouse/keyboard events.

Of course, there is always JNI, but I would prefer platform independence.

Thanks,

Jeff
Andrew Thompson - 02 Nov 2003 04:13 GMT
> I'm looking for an experimentation platform, and I like Java, but
> I can't find (easily) whether you can do the following: (also, if you
> answer 'yes', can you give me the class/method that I need to look at?
>
> #1 Drawing to the primary surface (not in a frame/dialog/applet)

No.  You _might_ be able to mimic a psuedo effect by
somehow grabbing a screen image and replicating that
inside a window, then drawing over the top, but that
is purely an 'effect' - it would still not be drawing as you specify.

Java is not the best language for getting so intimate with
the underlying OS..

> #2 Alpha blending with existing primary surface (like putting up a
>       'see through' menu on top of a non-java application window)
> #3 Intercepting and dispatching mouse/keyboard events.

Sounds like a good basis for a virus, or apps
designed to defraud..   ;-)
'enter your PIN number to complete transaction..'

--
Andrew Thompson
http://www.AThompson.info/
http://www.PhySci.org/
http://www.1point1C.org/
Andrew Thompson - 02 Nov 2003 04:15 GMT
> > I'm looking for an experimentation platform, and I like Java, but
> > I can't find (easily) whether you can do the following: (also, if you
[quoted text clipped - 3 lines]
>
> No.

Not so sure of this now..
It might be yes (but you guessed it - I do not know how).

--
Andrew Thompson
http://www.AThompson.info/
http://www.PhySci.org/
http://www.1point1C.org/
Jeff Bronte - 02 Nov 2003 05:49 GMT
Ha Ha,
 No, my purpose isn't to deceive. I'm developing a popup navigation system
that
augments IDE's and other development tools. I guess the 'psuedo' effect will
have to do.

 I've heard that Java can talk to DirectX?

J

> > I'm looking for an experimentation platform, and I like Java, but
> > I can't find (easily) whether you can do the following: (also, if you
[quoted text clipped - 23 lines]
> http://www.PhySci.org/
> http://www.1point1C.org/
Andrew Thompson - 02 Nov 2003 06:14 GMT
> Ha Ha,
>   No, my purpose isn't to deceive. I'm developing a popup navigation system
> that
> augments IDE's and other development tools.

That is reassuring, and it sounds handy.

> I guess the 'psuedo' effect will
> have to do.

If you wish to do it as an Applet you face further
restrictions, especially in respect to the security
'sand box' in which Applets are constrained.

Your Applet would need to be signed, though if
you are installing your pop-up nav system via
Web Start, that is pretty much a given in any case.

>   I've heard that Java can talk to DirectX?

I'd have to cede to others on that one.  Anybody?

--
Andrew Thompson
http://www.AThompson.info/
http://www.PhySci.org/
http://www.1point1C.org/
Andrew Thompson - 02 Nov 2003 06:19 GMT
> >   I've heard that Java can talk to DirectX?
>
> I'd have to cede to others on that one.  Anybody?

Though Sun's own search is only a click away at..
http://search.java.sun.com/search/java/?qt=directx

Top link.  AFAIR there is a Java3d NG.

HTH

--
Andrew Thompson
http://www.AThompson.info/
http://www.PhySci.org/
http://www.1point1C.org/
Tor Iver Wilhelmsen - 02 Nov 2003 10:46 GMT
> #1 Drawing to the primary surface (not in a frame/dialog/applet)

The closest you get is apparently to use a fullscreen window, e.g.

Window w = new Window();
GraphicsEnvironment ge = GraphicsEnvironment.
  getLocalGraphicsEnvironment();
GraphicsDevice screen = ge.getScreenDevices()[0];
if (screen.isFullScreenSupported())
   screen.setFullScreenWindow(w);

You may also want to read up on the classes mentioned here, plus
GraphicsConfiguration.

> #2 Alpha blending with existing primary surface (like putting up a
>       'see through' menu on top of a non-java application window)

Something will possibly arrive with 1.5 - but not in 1.4

> #3 Intercepting and dispatching mouse/keyboard events.

Dispatching: Look at java.awt.Robot. But you can only intercept the
events directed at windows managed by the VM.
Jeff Bronte - 02 Nov 2003 16:29 GMT
Yes, I'm familiar with fullscreen, but that doesn't let me run existing
native platform applications.

Looks like JNI is the only way, which unfortunately defeats the
'cross-platformness' of Java.

Thanks all for the feedback(s).

Jeff

> > #1 Drawing to the primary surface (not in a frame/dialog/applet)
>
[quoted text clipped - 19 lines]
> Dispatching: Look at java.awt.Robot. But you can only intercept the
> events directed at windows managed by the VM.
Tor Iver Wilhelmsen - 02 Nov 2003 17:31 GMT
> Yes, I'm familiar with fullscreen, but that doesn't let me run existing
> native platform applications.
>
> Looks like JNI is the only way, which unfortunately defeats the
> 'cross-platformness' of Java.

No: You wanting to run native plattform applicaton is defeating that
all by itself.


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.