A DesktopPane for JavaFX

Post to Twitter

If you plan to create desktop business applications, you'll miss one thing in JavaFX: A real desktop pane with internal frames.

The only comparable thing is the Window implementation of JFXtras. The implementation was a first step in the right direction, but not a real desktop/internal frame solution.

We did some experiments with Window and had following problems:

  • Mouse cursor was changed to resize but not back to default
  • Resize operation moved the window to totally different positions
  • It was possible to drag the window out of the parent node
  • Components were set to managed (false) -> a lot of layouting problems
  • Missing maximize functionality
  • Problems with focus handling
  • Title wasn't always shown
  • No tab/window mode switching option
  • Modality?

It was not a real internal frame, as we knew it from Swing. And a desktop pane/window manager wasn't available, which could be used to manage active/inactive windows/frames.

Our customers won't work without MDI because they need more than one frame, because of different reasons. Sure it depends on the application and use case but big applications without internal frames are a No-Go.

So we thought that it's the right time to start with a real desktop implementation with internal frames. Here are some imporessions:

Desktop + InternalFrames

Desktop + InternalFrames

 
Maximized frame

Maximized frame

Desktop with Tabs

Desktop with Tabs

We need better styles for the frames and some nice icons, but this isn't a big problem because we use stylesheets for everything. The implementation isn't production ready at the moment, but we solved most problems and made good progress.

The current desktop/frames knew the difference between active and inactive, it possible to minimize/iconify frames, focus handling works, maximization is possible and it's possible to switch between frame and tab mode. Dragging works like a charm.

Our implementation will be a real replacement for Swing' internal frames. It's part of our JavaFX UI implementation for JVx.

11 Responses to “A DesktopPane for JavaFX”

  1. ahmed says:

    how can I get this project? does it sell?

  2. rjahn says:

    The project is OpenSource - check our sourceforge page!

  3. ahmed says:

    How can I get the source code, or could you provide the link, thanks

  4. rjahn says:

    The link: http://sourceforge.net/p/jvxfx/code/HEAD/tree/branches/dev2015/java/

    Be careful, it's still the dev2015 branch. The current trunk is an old PoC and not useful anymore.

  5. rzenz says:

    Hello ahmed.

    rjahn has pointed you to the correct location. To clarify what he meant with "be careful". At the moment the complete MDI system we created (it lives in the package com.sibvisions.rad.ui.javafx.mdi, it is standalone and not dependent on JVx) still lives in a development branch, it might change without notice and in incompatible ways, so I'd suggest that you only build prototypes with it for now. Once we're happy with all these components they will be merged to master (don't worry, you won't be able to miss it if you follow this blog), and from there it will be quite stable regarding the API.

    We are also looking into the possibility to provide a read-to-use jar with all our extended components and no dependencies (except the JRE >= 8 obviously) once we merged to trunk.

    So if you want to test it, for the moment I'd suggest to copy the complete com.sibvisions.rad.ui.javafx.mdi package into your project (it is licensed under Apache v2, so this shouldn't be a problem). Because if you only copy that package you won't have to deal with all the other dependencies (the MDI system is already only dependent on the JRE), and it should be easier to use.

    Also note that in the test.manual directory, under the com.sibvisions.rad.ui.javafx.mdi package, you'll find our manual test case which can serve as a usage example.

  6. mounir says:

    great job ...
    the final version will be open source ?tks

  7. Rajesh says:

    Exception in Application start method
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
    Caused by: java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$156(LauncherImpl.java:182)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.RuntimeException: Application classname needs to be provided as first argument.
    at com.sibvisions.rad.ui.javafx.impl.ApplicationParameters.parse(ApplicationParameters.java:82)
    at com.sibvisions.rad.ui.javafx.impl.JavaFXApplication.createParameters(JavaFXApplication.java:125)
    at com.sibvisions.rad.ui.javafx.impl.JavaFXApplication.start(JavaFXApplication.java:72)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$163(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$176(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$174(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$149(WinApplication.java:191)
    ... 1 more
    Exception running application com.sibvisions.rad.ui.javafx.impl.JavaFXApplication

  8. rjahn says:

    Please use the Forum for such things :) It's the better place to discuss problems.

    The exception tells you: Application classname needs to be provided as first argument.

    The first command line parameter should be the Java classname of the IApplication implementation.
    Did you use the DemoERP or did you create your own application?

  9. Rajesh says:

    I made use of DemoERP while running it getting the above exception. Im unable to recognise the problem

  10. rjahn says:

    Please use our Forum next time!

    The DemoERP contains a fully functional Eclipse project - I guess you're using it? (Download zip archive: http://sourceforge.net/projects/erpdemoapplication/files/1.1/, or checkout the repository)
    There's already a Demoerp.launch File (see http://sourceforge.net/p/erpdemoapplication/code/HEAD/tree/trunk/apps/DemoERP/Demoerp.launch)

    This launch file was created for SwingApplication launcher. Simply copy the launch configuration (in Eclipse) and replace main class com.sibvisions.rad.ui.swing.impl.SwingApplication with com.sibvisions.rad.ui.javafx.impl.JavaFXApplication.

Leave a Reply

Spam protection by WP Captcha-Free