Skip to main content

Setting BorderPanel dynamically

1 reply [Last post]
pdizzyd
Offline
Joined: 2008-05-08

We are looking at implementing JavaFX as our GUI and have a need to bring in "content" dynamically. Currently we have created a frame and are using a BorderPanel to display one of the content areas. The content needs to change when a button is clicked. We would like to be able to determine which .fx file to display based on the button clicked. Is there a way with the JavaFXScriptingEngine or through the javax.script libraries to simply pass the name of the file, which contains either a BorderPanel def or a method that returns a BorderPanel object to the frame?

We are looking to implement a simple BorderPanel factory.

Ultimately we are looking to separate the UI from mapping actions to views, I guess trying to implement a simple MVC pattern so we can pass these FX scripts to less technical designers on the UI side.

We have review many of the articles posted about using the scripting engines but need a little more guidance.

http://java.sun.com/developer/technicalArticles/scripting/javafx/javafx_...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pdizzyd
Offline
Joined: 2008-05-08

Thanks to a post http://forums.java.net/jive/thread.jspa?messageID=274096&#274096 it seems to implement a BorderPanel Factory we would start with a Java Swing frame and then fill the Frame with FX Widgets rather than starting with an FX Frame.

The APIs for the FX components are based on many of the AWT components but casting only works one way, meaning the instance of the FX object is an AWT instance and can not be passed back and forth without "losing is FXness".

Does this sound right? To reiterate we are looking to move to Java but want something less complex than the a full Swing implementation for design team integration.

This is great stuff, keep it up!