Friday, 27 March 2009

Getting JFXtras to run on a Mac

Many people have encountered problems getting JFXtras to run on a Mac and a number of solutions have been proferred.

This simple solution worked for me:

1 - Close Netbeans
2 - Open a terminal window
3 - cd /System/Library/Frameworks/JavaVM.framework/Versions
4 - rm -f CurrentJDK (this is just a symlink to version you are using)
5 - ln -s 1.6 CurrentJDK
6 - close terminal window
7 - start Netbeans

Just to test it, I threw together the following code (copied and paste from various resources, so nothing original here)


/*
* Main.fx
*
* Created on Mar 27, 2009, 7:34:38 AM
*/

package test;

import javafx.ext.swing.SwingButton;
import javafx.lang.FX;
import javafx.scene.layout.HBox;
import javafx.scene.Scene;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;

/**
* @author johndunning
*/
var stage:Stage;

stage = Stage {
title: "Application title"
width: 250
height: 80
scene: Scene {
content: [ Text {
font : Font {
size : 16
}
x: 10, y: 30
content: "Application content"
},
HBox {
content: [

SwingButton {
text:"Click Me"
action:function()
{
var help:Help = Help{}
help.showHelp(stage);
}
},
SwingButton {
text:"Exit"
action:function()
{
FX.exit();
}

}
]
}


];
}
}



package test;

import javafx.ext.swing.SwingButton;
import javafx.ext.swing.SwingLabel;
import javafx.scene.Scene;
import javafx.stage.Stage;
import org.jfxtras.scene.layout.Cell;
import org.jfxtras.scene.layout.Grid;
import org.jfxtras.scene.layout.GridConstraints;
import org.jfxtras.scene.layout.Row;
import org.jfxtras.stage.JFXDialog;

package class Help
{
package function showHelp (owner: Stage): Void
{
def helpText = ""
"Welcome to Text Search!

"
"Enter the search text in the text field.
"
"Click Search to initiate the search.
"
"Click Stop to interrupt a search.
"
"Click Help to display this help.
"
"
"
"The paths of all files that contain
"
"the search text appear in the list."
"";

var dialogRef: JFXDialog;
dialogRef = JFXDialog
{
title: "Text Search Help"

owner: owner
modal: true
packed: true
resizable: false

scene: Scene
{
content: Grid
{
border: 15

rows:
[
Row
{
cells: SwingLabel
{
text: helpText
}
}
Row
{
cells: Cell
{
content: SwingButton
{
action: function (): Void
{
dialogRef.close ()
}

text: "OK"
}

horizontalAlignment: GridConstraints.CENTER
}
}
]

vgap: 10
}
}
}
}
}

5 comments:

Laptop Motherboard Repair said...

Thanks for sharing this info. I shall definitely give it a try. Lets hope for the best.

Highest CD Rates said...

I have given it a try and believe me, that I haven't encountered any problems yet.

dreamboxhome.com said...

nice your blog and very nice dear your blog psoting we like its you can see our also website for online shopping

DreamBox 500S Dreamboxhome supplies DreamBox 500S,DreamBox500C, DreamBox 7025, DreamBox Remote Controls.DreamBox 500S,DreamBox 500c and DreamBox 70200 are available on whole sale best prices.



SONY Dell Acer Apple battery Yahoo battey supplies high quality laptop batteries on lowest prices with 30-day money-back guarentte.Yahoo batteries also carry a 12-month full repair of replacement warrantly for any form of manufacturing defects.

interphone wireless inter phone wireless is an online store for wireless computer peripherals, mobile phones, car accessories, iphone & ipod accessories, laptop motherboard and accessories.

wholesalediy said...

Hi! I like your works very much! I recently came across your blog and have been reading along. I don’t know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.i'm so sorry to send so many links in your blog comment.but this is my job,i have no idea.Dell Latitude D410 battery Dell Latitude X300 battery Dell Latitude X300 battery HP Pavilion DV1000 Battery HP Pavilion DV1000 Battery Dell Inspiron 6400 battery Dell Inspiron 6400 battery Dell Inspiron E1505 battery DELL Latitude D620 battery Dell Latitude D610 Battery DELL Latitude D630 battery Dell Inspiron E1505 battery DELL Latitude D620 battery DELL Latitude D630 battery DELL Latitude D610battery HP Pavilion DV2000 Battery HP Pavilion DV2000 Battery HP Pavilion DV4000 Battery HP Pavilion DV4000 Battery HP Pavilion DV6000 Battery HP Pavilion DV6000 Battery HP Pavilion DV6000 Battery HP Pavilion DV8000 Battery HP Pavilion DV8000 Battery HP Pavilion DV9000 Battery HP Pavilion DV9000 Battery

thinkway.org said...

nice your blog and very nice dear your blog psoting we like its you can see our also website for online shopping

DreamBox 500S Dreamboxhome supplies DreamBox 500S,DreamBox500C, DreamBox 7025, DreamBox Remote Controls.DreamBox 500S,DreamBox 500c and DreamBox 70200 are available on whole sale best prices.



SONY Dell Acer Apple battery Yahoo battey supplies high quality laptop batteries on lowest prices with 30-day money-back guarentte.Yahoo batteries also carry a 12-month full repair of replacement warrantly for any form of manufacturing defects.

interphone wireless inter phone wireless is an online store for wireless computer peripherals, mobile phones, car accessories, iphone & ipod accessories, laptop motherboard and accessories.