Re: Experience with piecewise migration Swing - JFX

2013-06-17 Thread Werner Lehmann
In addition to what has been said before, you could check Jira for 
keywords jfxpanel and/or swing. Just today we had another Mac-only 
problem. Apparently AWT is not as thread-safe on Mac as it is on 
Windows, resulting in deadlocks in native AWT code (which currently is a 
guess, not confirmed, RT-31124).


Another relatively minor issue: if you have to use multiple JFXPanels on 
one Swing window the code can get quite complicated because of the 
frequent context switches between the GUI threads. Currently I am adding 
a note to the javadoc of UI methods to state which thread it is supposed 
to be called in.


Even with one JFXPanel and other Swing UI on the same window, you'll get 
a problem with tab focus movement: the jfxpanel would happily receive 
focus but then users cannot tab out of the jfxpanel.


Also seen today: after closing the last JFXPanel while the Swing 
application continues, FX would exit the platform (not the VM) and you 
cannot use another JFXPanel. There is probably some workaround available.


And just in case it has not been said before: you cannot have a Stage on 
top of a JFrame (modal or not). This forces you to wrap a JFXPanel into 
a JDialog.


I have also seen a performance problem. Try an indeterminate progressbar 
in a JFXPanel. The progressbar width directly correlates with CPU usage. 
With ~400px width I get about 20% CPU usage (almost one core). This is 
probably caused by constant pixel shifting to AWT.


Werner

On 14.06.2013 17:08, Robert Krüger wrote:

What are the hidden problems one should be
aware of (other than having 2 UI threads).




Re: Experience with piecewise migration Swing - JFX

2013-06-17 Thread Anthony Petrov

On 06/17/13 16:35, Werner Lehmann wrote:

In addition to what has been said before, you could check Jira for
keywords jfxpanel and/or swing. Just today we had another Mac-only
problem. Apparently AWT is not as thread-safe on Mac as it is on
Windows, resulting in deadlocks in native AWT code (which currently is a
guess, not confirmed, RT-31124).


I haven't investigated deeply, but since you've mentioned cursors I 
believe this issue has been fixed already. Please try 7u40 and/or 8 ea 
builds.




Even with one JFXPanel and other Swing UI on the same window, you'll get
a problem with tab focus movement: the jfxpanel would happily receive
focus but then users cannot tab out of the jfxpanel.


Did you file a bug for this issue?



Also seen today: after closing the last JFXPanel while the Swing
application continues, FX would exit the platform (not the VM) and you
cannot use another JFXPanel. There is probably some workaround available.


You want to call Platform.setImplicitExit(false). Please see

http://docs.oracle.com/javafx/2/api/javafx/application/Platform.html#setImplicitExit(boolean)



And just in case it has not been said before: you cannot have a Stage on
top of a JFrame (modal or not). This forces you to wrap a JFXPanel into
a JDialog.


To clarify: you can't make a Swing frame be a parent of an FX stage, 
meaning that you can't maintain a particular z-order between the two. So 
you have to wrap a JFXPanel into a JDialog to implement this behavior.


--
best regards,
Anthony



I have also seen a performance problem. Try an indeterminate progressbar
in a JFXPanel. The progressbar width directly correlates with CPU usage.
With ~400px width I get about 20% CPU usage (almost one core). This is
probably caused by constant pixel shifting to AWT.

Werner

On 14.06.2013 17:08, Robert Krüger wrote:

What are the hidden problems one should be
aware of (other than having 2 UI threads).




Re: Experience with piecewise migration Swing - JFX

2013-06-17 Thread Artem Ananiev


On 6/17/2013 5:17 PM, Anthony Petrov wrote:

On 06/17/13 16:35, Werner Lehmann wrote:

In addition to what has been said before, you could check Jira for
keywords jfxpanel and/or swing. Just today we had another Mac-only
problem. Apparently AWT is not as thread-safe on Mac as it is on
Windows, resulting in deadlocks in native AWT code (which currently is a
guess, not confirmed, RT-31124).


I haven't investigated deeply, but since you've mentioned cursors I
believe this issue has been fixed already. Please try 7u40 and/or 8 ea
builds.


Even with one JFXPanel and other Swing UI on the same window, you'll get
a problem with tab focus movement: the jfxpanel would happily receive
focus but then users cannot tab out of the jfxpanel.


Did you file a bug for this issue?


There is already filed one:

RT-10919: Provide possibility to traverse focus out of FX scene

Thanks,

Artem


Also seen today: after closing the last JFXPanel while the Swing
application continues, FX would exit the platform (not the VM) and you
cannot use another JFXPanel. There is probably some workaround available.


You want to call Platform.setImplicitExit(false). Please see

http://docs.oracle.com/javafx/2/api/javafx/application/Platform.html#setImplicitExit(boolean)


And just in case it has not been said before: you cannot have a Stage on
top of a JFrame (modal or not). This forces you to wrap a JFXPanel into
a JDialog.


To clarify: you can't make a Swing frame be a parent of an FX stage,
meaning that you can't maintain a particular z-order between the two. So
you have to wrap a JFXPanel into a JDialog to implement this behavior.

--
best regards,
Anthony



I have also seen a performance problem. Try an indeterminate progressbar
in a JFXPanel. The progressbar width directly correlates with CPU usage.
With ~400px width I get about 20% CPU usage (almost one core). This is
probably caused by constant pixel shifting to AWT.

Werner

On 14.06.2013 17:08, Robert Krüger wrote:

What are the hidden problems one should be
aware of (other than having 2 UI threads).




Re: Experience with piecewise migration Swing - JFX

2013-06-17 Thread Richard Bair
 Also seen today: after closing the last JFXPanel while the Swing
 application continues, FX would exit the platform (not the VM) and you
 cannot use another JFXPanel. There is probably some workaround available.
 
 You want to call Platform.setImplicitExit(false). Please see
 
 http://docs.oracle.com/javafx/2/api/javafx/application/Platform.html#setImplicitExit(boolean)

Do we have a Swing Migration Guide document that we can call this out in, or 
do we already?



Re: Experience with piecewise migration Swing - JFX

2013-06-16 Thread Robert Krüger
On Sat, Jun 15, 2013 at 11:39 PM, Pedro Duque Vieira
pedro.duquevie...@gmail.com wrote:
 My biggest problems were with having 2 UI threads.

 I ran into some concurrency issues between the 2.

Meaning things that just needed extra care or things that were hard to
work around? Could you elaborate a bit?


Experience with piecewise migration Swing - JFX

2013-06-14 Thread Robert Krüger
Hi,

we're currently in the process of migrating our Swing application from
Apple JDK 6 to OpenJDK 8 hoping to be able to ship it bundled with
OpenJDK 8 in the coming months. In addition to that we're seriously
considering a Migration of the UI to JFX and it appears very tempting
to do this component-wise, i.e. using JFXPanel.

I have read and understood
http://docs.oracle.com/javafx/2/swing/swing-fx-interoperability.htm
but wanted to ask if someone has followed this route and could share
their experience regarding caveats of this. How well does it work for
a non-trivial application? What are the hidden problems one should be
aware of (other than having 2 UI threads).

Thanks in advance,

Robert