Scene Builder with JFX 11 imports - javafx

I have a jar with custom controls. When it is built under Java 10 I'm able to import it to scene builder and access my custom controls. When I build it using Java 11, the list of controls to import is empty.
Does anyone know if there's something special I need to configure to handle this? Or do I need to wait for Scene Builder to be updated? With gluon apparently taking on a stewardship role of JavaFX I had expected this to work out of the box.

Related

Where is a checkbox "include interface callbacks" when you want to create new fragment in android studio 3.6.3

I just upgraded my android studio at 3.6.3 version and I started to watch some Udemy course about Kotlin programming and I noticed when I tried to create new Fragment I didn't see a checkbox "include interface callbacks" as in old version in Android studio.
I am a beginner in Kotlin so I need some advice.
Here is an example of fragment creation in the new Android studio:
Here is in some old version:
How can I include interface callbacks in the new version of the Android studio automatically?
I hope I don't need to do it all manually, maybe some shortcut option?
I investigated and I found out that interface callbacks for communication between fragments and fragments with activity are now maintained with the use of ViewModel class which is much easier than using all that code with interface callbacks.
Second good option for such communication is the use of third-party libraries like RxJava.
Means guys from Google and JetBrains removed that option and now is available option to create ViewModel class within Fragment through File -> New -> Fragment -> Fragment(with ViewModel).

Run JavaFX Application Thread/Toolkit in Java9

I'm trying to migrate a program from java 8 to java 9.
In my program I found the following code.
//Run JavaFX Application Thread/Toolkit
PlatformImpl.startup(() -> {
});
It tries to start the JavaFX Toolkit
Unfortunately, the PlatformImpl.startup is no longer supported in java 9.
Which substitute is there for it?
How can I start the JavaFX Toolkit?
Thank you
The startup() method is one of the methods that was promoted from the non-public class PlatformImpl to the public API Platform class in the Java 9 release. It is now fully documented in the API documentation.
Thus the equivalent call in Java 9 is
Platform.startup(() -> { });
Note that the use cases for this method are fairly rare, and the API docs go to some lengths to emphasize this:
In general it is not necessary to explicitly call this method, since it is invoked as a consequence of how most JavaFX applications are built.
...
As noted, it is normally the case that the JavaFX Application Thread is started automatically. It is important that this method only be called when the JavaFX runtime has not yet been initialized. Situations where the JavaFX runtime is started automatically include:
For standard JavaFX applications that extend Application, and use either the Java launcher or one of the launch methods in the Application class to launch the application, the FX runtime is initialized automatically by the launcher before the Application class is loaded.
For Swing applications that use JFXPanel to display FX content, the FX runtime is initialized when the first JFXPanel instance is constructed.
For SWT application that use FXCanvas to display FX content, the FX runtime is initialized when the first FXCanvas instance is constructed.
When an application does not follow any of these common approaches, then it becomes the responsibility of the developer to manually start the JavaFX runtime by calling this startup method.
Calling this method when the JavaFX runtime is already running will result in an IllegalStateException being thrown - it is only valid to request that the JavaFX runtime be started once.
So, while you are in the process of making the changes you need to update your application to be Java 9 compatible, you might want to carefully consider if you need to call startup() at all; maybe there is a more standard and robust approach to starting your JavaFX application anyway.

Flex 4 SWFLoader - Main app detecting events from remote sub app swf

I have 2 separate Flex 4 projects, same framework but running on different servers.
1) MainApp (IP:192.168.12.113:8080)
2) SubApp (IP:192.168.10.19:5080)
I need to integrate SubApp into MainApp and I have managed to do so using a SWFLoader.
//MainApp/mainapp.mxml
<s:SWFLoader id="contentLoader"
loadForCompatibility="true"
trustContent="true"
source="http://192.168.10.19:5080/SubApp.swf"/> //Using url
Right now, I need the SubApp to notify the MainApp when a particular button is clicked so that the MainApp can perform some functions (E.g. Open/close a sliding window). How can I go about doing it?
In addition, to clarify, is this kind of setup considered as multi-versioned remote sandbox? Both applications are trust-able and should be able to access each other variables/functions.
Help is greatly appreciated. Thanks.
Since they are in a differant domain, they are sandboxed applications. You can use the following for your case
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f0d.html#WS2db454920e96a9e51e63e3d11c0bf69084-7f00

AIR - Different behaviour when the app is installed and when it runs inside the builder

we are developing an Adobe AIR app using Flex4. We are facing lot of bugs that didn't show up when we run the application inside Flash Builder (both debug mode and run mode), but when we install the app and run it, the app shows a different behaviour. Any idea ? what does it change between running the installed application in the builder and outside ?
Thanks a lot
Ok i've founded the problem using MonsterDebugger in the application running stand alone. The problem was the File.browseForDirectory(). I'm creating the File object, registering the event listener and then calling File.browseForDirectory() and that generate an exception. I switched the order, First creating a new file, then calling File.browseForDirectory() and at last register an event handler and works great.
My guess is that inside the debugger version and inside Flash Builder it takes just few more millisec and the File object is ready when i register the eventlistener but in the stand alone application AS3 code for event listener registration is executed before the File object initialization.

Warning when migratring from Flex 3 to Flex 4

I received this warning when I migrated my application from flex 3 to flex 4:
components:MyApp is a module or application that is directly referenced. This will cause components:MyApp and all of its dependencies to be linked in with modules:searchModule. Using an interface is the recommended practice to avoid this. Unknown Flex Problem
MyApp is a class which extends the Application component and in the module named "searchModule" there's this line:
var parentApp:myApp = parentApplication as MyApp;
I then use the variable myApp to call methods defined in the MyApp class from within this module.
This warning is reported 10 times because I am doing the same in other modules.
I want to fix it but I don't understand the part "this will cause its dependencies to be linked in with modules" and how would I make an interface to avoid this? And why there wasn't a warning about it in flex 3?
Thanks in advance
I'm guessing a bit, but...
The Flex Framework is one of those special Adobe-only libraries that can be cached by the Flex player. As such, with certain compile settings, the SWF from the compiler does not contain the Flex library. In lex 4, the framework is not compiled into your application SWf, resulting in significantly smaller application file size.
If you extend the Application class, which it sounds like you done, the compiler cannot count on your new "Application" being in the cached Flex Framework and therefore must compile your new class, and therefore the Application tag into your SWF. This is going to daisy chain significantly; as the Application tag does a lot of Flex Framework setup stuff.
I assume that is what the warning means in terms of dependencies.
Did you really extend Application with additional functionality? Or is "MyApp.mxml" just the name of the your main application file?
You might try this:
var parentApp:Application = parentApplication as Application;
I believe there is a FlexGlobals class introduced in Flex 4, which can also give you access to the top level Application.
In terms of using an interface. Interfaces are designed to help remove specific dependencies. You can create an interface for your new functionality of the new Application class and reference that instead.
var parentApp:myApp = parentApplication as IMyApp
Based on my interpertation of the messages you're seeing that may address the issue.
I had this error when I had Application MXML insted of Component MXML, for example.
Changed Application to Group, in referenced Component, and warning was no more.
Reason for error was, because I worked on component in separate project as application, and later copied it to main project, but I didn't change it to component.

Resources