NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed. (sponsored)
In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.
Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.
Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Swing does not currently have a proper integration solution to embbed native components (1). Fortunately, there is a solution now: the DJ Project - Native Swing.
The DJ Project is a set of tools and libraries to enhance the user experience of Java on the Desktop.
Native Swing is part of this set: it is a library that allows to easily integrate some native components into Swing applications, and provides some native utilities to enhance Swing's APIs.
The main focus at this stage is the integration of a native Web Browser and Flash Player, using a Swing-like API. All the threading issues and general integration headaches are handled automatically.
The demo is part of the release, so you can download it and try it out on other platforms (Linux)
It uses SWT Under the hood, so it should work everywhere SWT allows to be placed inside a Swing component. To get the web browser to work on Linux, follow the FAQ on SWT's website (it requires the XULRunner).
Let me know what you think. It is not a final version but it seems stable and probably can help to improve the current situation.
Re: Native Web Browser, Flash Player for Swing applications
Hi Dmitri,
> Looks nice!
Thanks!
> Does it handle lightweight/heavyweight clipping
> issues?
Yes it does, by making popups heavyweight. It also handles focus grabbing issues and other such common problems (these are detailed in the first sections of the demo if you want to know more).
Re: Native Web Browser, Flash Player for Swing applications
Very impressive ! There is a problem on Windows/Vista though with the embedded media player demo, if I click the button to browse for a media file and then select the drives list drop down I get a black rectangle - looks like some sort of heavyweight/lightweight collision. See the attached picture. The drop down occasionally works but most of the time I get the black rectangle.
Anyway, great work - I hope it inspires Sun to give us these things as standard...
Yes it does. The readme file gives some information about how to set things up.
Basically, you just need to have SWT 3.4 for your platform in your classpath. For the demo to work, simply place the SWT JAR file named "swt.jar" alongside the JAR of the demo. The Web Browser also needs the XULRunner as explained in the SWT FAQ.
The Web Browser works properly on Linux as far as I can tell. This is the key component of this library.
The Flash player partially works, and I would need to investigate to make it fully working (it asks for local permission, and it does not allow to set variables...)
Re: Native Web Browser, Flash Player for Swing applications
> Are you planing to add also support for OSX?
Maybe it does work for OSX, I just don't know because I don't have one to develop and test on.
Moreover, I don't know if the feature of embedding SWT in AWT is supported on OSX.
Re: Native Web Browser, Flash Player for Swing applications
Christopher,
Your work in general continues to impress me. You seem to only like solving really hard problems (UI lightweight/native integration, event handling across frameworks, rendering, etc.) and pretty much are kicking ass at it.
I'm impressed with myself when I use punctuation in sentences...
Re: Native Web Browser, Flash Player for Swing applications
Hi Riyad,
> Your work in general continues to impress me. You
> seem to only like solving really hard problems (UI
> lightweight/native integration, event handling across
> frameworks, rendering, etc.) and pretty much are
> kicking ass at it.
The technical challenges (especially people saying something is impossible), trying to improve the situation and these encouraging messages are the reasons for me to do it. So it is me who thank you!
Native Web Browser, Flash Player for Swing applications
URL: DJ Project - Native Swing
At 12:23 PM on Jan 6, 2008, Christopher Deckers wrote:
Fresh Jobs for Developers Post a job opportunity
The DJ Project is a set of tools and libraries to enhance the user experience of Java on the Desktop.
Native Swing is part of this set: it is a library that allows to easily integrate some native components into Swing applications, and provides some native utilities to enhance Swing's APIs.
The main focus at this stage is the integration of a native Web Browser and Flash Player, using a Swing-like API. All the threading issues and general integration headaches are handled automatically.
Screenshots: http://djproject.sourceforge.net/ns/screenshots
Web Start Demo (win32 only): http://djproject.sourceforge.net/ns/DJNativeSwingDemo.jnlp
The demo is part of the release, so you can download it and try it out on other platforms (Linux)
It uses SWT Under the hood, so it should work everywhere SWT allows to be placed inside a Swing component. To get the web browser to work on Linux, follow the FAQ on SWT's website (it requires the XULRunner).
Let me know what you think. It is not a final version but it seems stable and probably can help to improve the current situation.
The DJ Project: http://djproject.sourceforge.net
Native Swing: http://djproject.sourceforge.net/ns
-Christopher
(1) The closest Web Browser one can think of is the JDIC Browser, but the way processes are seperated creates more problems and has many limitations.
29 replies so far (
Post your own)
Re: Native Web Browser, Flash Player for Swing applications
Oh, the JWebBrowser is really really great!!Re: Native Web Browser, Flash Player for Swing applications
That's cool stuff.The JWebBrowser and JFlashPlayer are very impressive.
Looking forward to use them in our swing apps.
Re: Native Web Browser, Flash Player for Swing applications
Looks nice!Does it handle lightweight/heavyweight clipping issues?
(like if you have a JMenu overlapping your browser window)
Dmitri
Re: Native Web Browser, Flash Player for Swing applications
Hi Dmitri,> Looks nice!
Thanks!
> Does it handle lightweight/heavyweight clipping
> issues?
Yes it does, by making popups heavyweight. It also handles focus grabbing issues and other such common problems (these are detailed in the first sections of the demo if you want to know more).
Cheers,
-Christopher
Re: Native Web Browser, Flash Player for Swing applications
Very impressive ! There is a problem on Windows/Vista though with the embedded media player demo, if I click the button to browse for a media file and then select the drives list drop down I get a black rectangle - looks like some sort of heavyweight/lightweight collision. See the attached picture. The drop down occasionally works but most of the time I get the black rectangle.Anyway, great work - I hope it inspires Sun to give us these things as standard...
Rob
Re: Native Web Browser, Flash Player for Swing applications
Here is the picture showing the black rectangle.Linux?
I downloaded the release but there are no linux libraries inside it.Does it work on Linux platform?
Kees.
Re: Native Web Browser, Flash Player for Swing applications
Hm, I wish I had Vista to test.My feel would be that it is a bug in the JRE because popups should be heavyweight, including the ones of combo boxes.
Hopefully I get to test that some day, or people at Sun could play with it and see if the bug is mine or theirs.
Thanks for the feedback, I'll keep that in mind!
-Christopher
Re: Linux?
Hi Kees,> Does it work on Linux platform?
Yes it does. The readme file gives some information about how to set things up.
Basically, you just need to have SWT 3.4 for your platform in your classpath. For the demo to work, simply place the SWT JAR file named "swt.jar" alongside the JAR of the demo. The Web Browser also needs the XULRunner as explained in the SWT FAQ.
The Web Browser works properly on Linux as far as I can tell. This is the key component of this library.
The Flash player partially works, and I would need to investigate to make it fully working (it asks for local permission, and it does not allow to set variables...)
Cheers,
-Christopher
Re: Native Web Browser, Flash Player for Swing applications
Nice!Are you planing to add also support for OSX?
Re: Native Web Browser, Flash Player for Swing applications
> Are you planing to add also support for OSX?Maybe it does work for OSX, I just don't know because I don't have one to develop and test on.
Moreover, I don't know if the feature of embedding SWT in AWT is supported on OSX.
-Christopher
Re: Native Web Browser, Flash Player for Swing applications
Christopher,Your work in general continues to impress me. You seem to only like solving really hard problems (UI lightweight/native integration, event handling across frameworks, rendering, etc.) and pretty much are kicking ass at it.
I'm impressed with myself when I use punctuation in sentences...
Keep up the good work!
Re: Native Web Browser, Flash Player for Swing applications
Hi Riyad,> Your work in general continues to impress me. You
> seem to only like solving really hard problems (UI
> lightweight/native integration, event handling across
> frameworks, rendering, etc.) and pretty much are
> kicking ass at it.
The technical challenges (especially people saying something is impossible), trying to improve the situation and these encouraging messages are the reasons for me to do it. So it is me who thank you!
-Christopher
Re: Native Web Browser, Flash Player for Swing applications
"That stuff looks da bomb, G!"Like I heard the people talk about it on the streets.
I just wished it would be all cross-platform out of the box.