1 message in net.java.dev.jna.usersRe: [jna-issues] FW: translucent, sha...
FromSent OnAttachments
Timothy WallApr 23, 2008 3:21 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-issues] FW: translucent, shaped window in a java application in mac os xActions...
From:Timothy Wall (twal@dev.java.net)
Date:Apr 23, 2008 3:21:47 pm
List:net.java.dev.jna.users

The JNA users' list is a good place to start.

Do you want a transparent background, with a transparent text field, or a transparent background with an opaque text field?

JNA provides setWindowAlpha (constant alpha) and setWindowTransparent (invisible background, except for what you paint).

As for the frame dragging when you drag the text field, that looks like an apple bug.

On Apr 23, 2008, at 5:19 PM, Pierre St-Germain wrote:

If you can not find something, can you refer me to someone who work on the JNA and/or customized window?

Thanks a lot!

Pierre St-Germain

http://apps.facebook.com/babytel/

From: Pierre St-Germain Sent: February 12, 2008 4:00 PM To: 'Josh@Sun.COM' Subject: RE: translucent, shaped window in a java application in mac os x

Hello,

1. The quick hack way does not work,

I tryed also to put a mouse, and motion, listener on the textArea, root pane and on the content pane, it does not work too,

2. JNA was what I tryed the first, I already use it for the Windows version of the application,

On MAC it works, but it do directly the same thing than the "setBackground(new Color(0,0,0,0))" with an image with transparency.

Maybe, it is better to refer me to someone who has developed the JNA on MAC?

Or if you have something else to try...?

Thanks a lot!

Pierre

From: Josh@Sun.COM [mailto:Josh@Sun.COM] Sent: January 22, 2008 3:10 PM To: Pierre St-Germain Subject: Re: translucent, shaped window in a java application in mac os x

It's been a while since I've worked with this technique. I have two answers for you:

Quick Hack way: I believe (though I haven't done it in a while), that you can put a JPanel in the background of your frame and then put the text area into that panel. Then add a mouse listener to the panel which will capture the events from the window system, preventing the root pane from getting them.

Long term Real way: use the JNA project to bind natively to the shaped window routines. The JNA guys have already wrapped the shaped window code on all of the major platforms so it's very easy to bundle in with your application.

I hope this helps, Josh

On Jan 21, 2008, at 9:31 AM, Pierre St-Germain wrote:

Hello Joshua,

I did a post in forums.java.net (
http://forums.java.net/jive/thread.jspa?messageID=252452&tstart=0 )

about a translucent, shaped window in a java application on Mac OS X,

I really need a solution to this problem. I am still having trouble implementing your recommendations. The problem is mac specific and adding a mouse listner has not resolved the issue. Can you please review the example code below. Its a simple implementation to test.

public static void main(String [] args) { JFrame jFrame = new JFrame(); JTextArea jTextArea = new JTextArea("test"); jFrame.add(jTextArea); jFrame.setBackground(new Color(0,0,0,150)); jFrame.setVisible(true); }

If you try to select with your mouse by clicking and dragging from the end to the begin of the text ("test") in the text box, the window dragging, and It should not...?

This is quite the high priorty for my project, Please reply soon

Thanks in advance

Pierre St-Germain Junior IT Engineer