Friday, 15 June 2012

Java getDesktop().open works in Windows but, doesn't work in Mac -



Java getDesktop().open works in Windows but, doesn't work in Mac -

i using windows programming , open file using code below, worked fine.

file file2 = new file(folderchooser + file.separator + "targetapp" + file.separator + name + file.separator + "index.html"); desktop.getdesktop().open(file2);

now i'm using macbook programing , code doesn't work anymore, , i'm getting next exception:

java.awt.headlessexception @ java.awt.desktop.getdesktop(desktop.java:142) @ br.com.facilit.target.app.desktop.view.mainviewcontroller.btnabriroffline(mainviewcontroller.java:709) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:601) @ javafx.fxml.fxmlloader$controllermethodeventhandler.handle(fxmlloader.java:1435) @ com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(compositeeventhandler.java:69) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:217) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:170) @ com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent(compositeeventdispatcher.java:38) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:37) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.eventutil.fireeventimpl(eventutil.java:53) @ com.sun.javafx.event.eventutil.fireevent(eventutil.java:28) @ javafx.event.event.fireevent(event.java:171) @ javafx.scene.node.fireevent(node.java:6863) @ javafx.scene.control.button.fire(button.java:179) @ com.sun.javafx.scene.control.behavior.buttonbehavior.mousereleased(buttonbehavior.java:193) @ com.sun.javafx.scene.control.skin.skinbase$4.handle(skinbase.java:336) @ com.sun.javafx.scene.control.skin.skinbase$4.handle(skinbase.java:329) @ com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(compositeeventhandler.java:64) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:217) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:170) @ com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent(compositeeventdispatcher.java:38) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:37) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.eventutil.fireeventimpl(eventutil.java:53) @ com.sun.javafx.event.eventutil.fireevent(eventutil.java:33) @ javafx.event.event.fireevent(event.java:171) @ javafx.scene.scene$mousehandler.process(scene.java:3324) @ javafx.scene.scene$mousehandler.process(scene.java:3164) @ javafx.scene.scene$mousehandler.access$1900(scene.java:3119) @ javafx.scene.scene.impl_processmouseevent(scene.java:1559) @ javafx.scene.scene$scenepeerlistener.mouseevent(scene.java:2261) @ com.sun.javafx.tk.quantum.glassvieweventhandler.handlemouseevent(glassvieweventhandler.java:228) @ com.sun.glass.ui.view.handlemouseevent(view.java:528) @ com.sun.glass.ui.view.notifymouse(view.java:922)

how can open html file in browser using mac??

java

No comments:

Post a Comment