Skip to main content
Jump to: navigation, search


< Efxclipse‎ | Tutorials
Revision as of 09:11, 6 November 2013 by (Talk | contribs) (Create a Mobile iOS with RoboVM app on OS-X)

Create a Mobile iOS with RoboVM app on OS-X

In this tutorial we'll guide you through the creation of JavaFX iOS application using e(fx)clipse tooling. While development of the application is possible with the default e(fx)clipse tooling. You need to install an additional plugin to get the robovm support.

  1. You need to have XCode and its command line tools installed
  2. Install additional Eclipse Plugin If you have downloaded our all in one download [1] (you need the nightly-sdk) no extra install is needed. In case you've not done so you need to post install additional features from [2]
    Efxclipse tut5 0.png
  3. Navigate to the JavaFX project wizard
    Efxclipse tut5 1.png
  4. Give the project a name
    Efxclipse tut5 2.png
  5. Navigate to the last page
    Efxclipse tut5 3.png
  6. The resulting project should look like this
    Efxclipse tut5 4.png
  7. Open the Sample.fxgraph-File and add the following code
    package application
    import application.SampleController
    import javafx.scene.shape.Rectangle
    component Sample styledwith "application.css" controlledby SampleController {
    	Deck id deck {
    		cards : [
    			Card {
    				name : "c1",
    				center : Rectangle {
    					^id : "r1",
    					width : 100,
    					height : 100,
    					onMouseClicked : controllermethod c1
    			Card {
    				name : "c2",
    				center : Rectangle {
    					^id : "r2",
    					width : 100,
    					height : 100,
    					onMouseClicked : controllermethod c2
  8. Open the application.css and add the following selector definitions
    Rectangle#r1 {
    	-fx-fill: red;
    Rectangle#r2 {
    	-fx-fill: green;
  9. Open the SampleController and make it look like this
    package application;
    import javafx.fxml.FXML;
    public class SampleController {
    	@FXML Deck deck;
    	@FXML public void c1() {
    		deck.moveTo("c2", TransitionType.SLIDE_LEFT);
    	@FXML public void c2() {
    		deck.moveTo("c1", TransitionType.FADE); 
  10. Bring up the Context-Menu on the and navigate to "Run As" > "Mobile Simulator"
    Efxclipse tut5 5.png A Java Application will launch showing the surface of a iPhone (you can modify screen size, ... in the launch configuration dialog)
  11. Bring up the Context-Menu on the and select "Generate RoboVM Build"
    Efxclipse tut5 6.png
  12. Select the robovm-ant.xml and select "External Tools Configurations ..." in the toolbar menu
    Efxclipse tut5 7.png
  13. Select "Ant" Build and press the "New" button and enter -Dbuild.compiler=javac1.7 in the arguments field Efxclipse tut5 8.png
  14. Wait for some minutes ...
  15. When the Simulator comes up flip it to show in horizontal format Efxclipse tut5 9.png
  16. In the outline of the ant-file open the context menu on "do-run-device" and select "Run As" > "Ant Build"
  17. Wait for some minutes ... (in the meanwhile connect your iPad/iPhone)

Back to the top