[Urgent] using javafx object in java project

Suppose I here created a very simple java project and the main file is like below,
public class test {
    public static void main(String[] args){
            System.out.println("Hello World!");
}and in this particular java project, I need to use another javafx object which is defined as (the javafx and java file are in the same package),
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.shape.Rectangle;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
var stage: Stage = Stage {
    title: "Declaring Is Easy!"
    scene: Scene {
        width: 300
        height: 250
        content: [
            Circle {
                centerX: 150  centerY: 120 radius: 80
                fill: Color.MAROON
                stroke: Color.INDIANRED
                strokeWidth: 10.0
            }, //Circle
            Rectangle {
                x: 25, y: 80 width: 250, height: 80
                arcWidth: 20 arcHeight: 20
                fill: Color.web("#6699ff")
                stroke: Color.web("#003399")
          strokeWidth: 5.0
            } //Rectangle
        ] //Content
    } //Scene
} //StageSo how could I achieve this?
Regards.

Thanks for your reply.
But would you please elaborate on this sentence: create the fx class using Class.forName("....").newInstance()?
Indeed I implemented an interface which was extended by the javafx class, and in the main java file I need to write following codes to use this object,
Context context = FXLocal.getContext();
        FXClassType instance = context.findClass("packageName.JavaFXClass");
        ObjectValue obj = (ObjectValue)instance.newInstance();
        JavaInterface ji = (JavaInterface)obj.asObject();The problem that I encountered right now is, the exception was thrown at context.findClass("javatest.MyChart");, since it's not able for the compiler to find the JavaFXClass.class.
I checked the folder build\classes\packageName and noticed that both my main JavaClass and JavaInterface have been compiled with .class file, while the JavaFXClass was not, which means the file JavaFXClass.class doesn't exist.
What's the solution?

Similar Messages

  • A RCP Application using javafx deployed by java web start,in jre8u25 run have problem.

    a RCP Application using javafx deployed by java web start,in jre8u20 can use jre7run the applicat,but in jre8u25 use jre7run application have problem.
    in jre8u20 use jre7 run the application can run success.
    but in jre8u20 the control print:
    java.lang.UnsupportedClassVersionError: com/sun/javafx/runtime/VersionInfo : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.sun.deploy.config.JfxRuntime.runtimeForPath(Unknown Source)
    at com.sun.deploy.config.JREInfo.<init>(Unknown Source)
    at com.sun.deploy.config.JREInfo.setInstalledJREList(Unknown Source)
    at com.sun.deploy.config.ClientConfig.storeInstalledJREs(Unknown Source)
    at com.sun.javaws.Main.launchApp(Unknown Source)
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    at com.sun.javaws.Main.access$000(Unknown Source)
    at com.sun.javaws.Main$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    the reason (i think) is that the application will use javafx's com.sum.javafx.runtime.VersionInfo,i use e(fx)clipse load the javafx runtime.in jre8u20,the web start use jre7's class.in jre8u25,the web start use jre8's class.
    so i use jre7 run the application get this result.
    how could i solve this problem?

    Hi,
    I have created client stubs for a webservice using axis wsdl2java tool. When I try calling these stubbed methods from JUnit tests, they are working fine but when I try to execute the jar (it is a swing) I get the following exception:
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/rpc/Service
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at com.Gudds.SeCURE.MainUI.<init>(MainUI.java:76)
    at com.Gudds.SeCURE.Main.Start(Main.java:62)
    at org.owasp.webscarab.WebScarab.main(WebScarab.java:34)
    I have put the jaxrpc.jar in the classpath and I suppose this jar has the java.xml.rpc.service class but I donot understand why it fails while executing the jar but works fine from the eclipse IDe. Plase help me.
    Regrdas,
    Kundan

  • Using JavaFX directly in Java without scripting

    Group group = new Group();
    group.set$translateX(this.translateX);
    group.set$translateY(this.translateY);How can I now set the content of the group for example a rectangle and a text? Has anybody an idea?

    Thanks for your reply.
    But would you please elaborate on this sentence: create the fx class using Class.forName("....").newInstance()?
    Indeed I implemented an interface which was extended by the javafx class, and in the main java file I need to write following codes to use this object,
    Context context = FXLocal.getContext();
            FXClassType instance = context.findClass("packageName.JavaFXClass");
            ObjectValue obj = (ObjectValue)instance.newInstance();
            JavaInterface ji = (JavaInterface)obj.asObject();The problem that I encountered right now is, the exception was thrown at context.findClass("javatest.MyChart");, since it's not able for the compiler to find the JavaFXClass.class.
    I checked the folder build\classes\packageName and noticed that both my main JavaClass and JavaInterface have been compiled with .class file, while the JavaFXClass was not, which means the file JavaFXClass.class doesn't exist.
    What's the solution?

  • How to use Oracle objects in java code

    Hi all!
    I'm reading an xls and i need to fill me oracle objects with java code:
    OBJECT_NAME OBJECT_TYPE
    LETTURA_OBJ TYPE
    LETTURA_OBJ TYPE BODY
    In the past weeks i've been using both java code into oracle and oracle objects, but new i need to write those objects with data i read with java, anybody can help me?
    I know that the easiest work around would be to put the data i read from the excel file into a table and then fill the oracle objects, but now i want to learn how to write directly those objects with a command like the following one:
    a sample of the code i'm tryng to write:
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED REPORT."Manage_Excel_ASMBS" AS
    import java.io.*;
    import java.io.IOException;
    import jxl.*;
    public cass ....
    #sql{  variabili_globali.var_ER_F3.Tipo_Lettura := 5}
    thanks,
    Massimo
    Edited by: LinoPisto on 16-mag-2011 16.38

    mmmh i'm not understanding so much....
    well... as i told before i'm working in oracle database environment and i'm developing a java procedure.
    now, i have this object
    CREATE OR REPLACE
    TYPE REPORT.FATTURA_OBJ AS OBJECT (
    POD VARCHAR2(1000),
    ID_FATTURA NUMBER,
    ID_FILE NUMBER,
    COERENZA_EA_F VARCHAR2(1000),
    COERENZA_ER_F VARCHAR2(1000),
    COERENZA_EA_M VARCHAR2(1000),
    COERENZA_EF_M VARCHAR2(1000),
    ANOMALIA VARCHAR2(1000),
    MOTIVO_INVALIDAZIONE VARCHAR2(1000),
    MATRICOLA_CONTATORE VARCHAR2(1000),
    POTENZA_DISPONIBILE VARCHAR2(1000),
    MEMBER PROCEDURE pulisci
    /and i need to work with it inside this procedure:
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED REPORT."Manage_Excel_ASMBS" AS
    import java.io.*;
    import java.io.IOException;
    import java.io.StringWriter;
    public class Manage_Excel_ASMBS
    public static void read_Excel(String inputFile,int var_Id_Caricamento, int var_Id_Distributore, String var_Distributore) throws SQLException, IOException
              **here i need to put what i'm reading inside the excel file into oracle objects**
    /can you please give me a sample ?
    thanks

  • Can not JavaScript objects in Java project

    Hi guys and girls,
    I have CMP managed java project that I am trying to create a menu for. Each time I create a new javascript object I am getting the error "objectname is undefined". Below is a code snipset followed by the error message I get when I try displaying the jsp.
    <head>
         <link rel="stylesheet" href="menu.css">     
         <script language="javascript" type="text/javascript" src='menu.js'></script>     
         <script language="javascript" type="text/javascript" src='menu_items.js'></script>     
         <script language="javascript" type="text/javascript" src='menu_tpl.js'></script>
    </head>
    <body leftmargin="15" rightmargin="15" marginheight="15" marginwidth="15" bgcolor="white">
    <script language="javascript">               
              new menu (MENU_ITEMS, MENU_POS);
         </script>     
    </body>
    The error message is 'menu' is undefined.
    I supspect that the src=menu.js reference is not working but I am not sure how I can change this. Any help would be appreciated.

    Hi guys and girls,
    I have CMP managed java project that I am trying to
    create a menu for. Each time I create a new javascript
    object I am getting the error "objectname is
    undefined". Below is a code snipset followed by the
    error message I get when I try displaying the jsp.
    <head>
    <link rel="stylesheet" href="menu.css">
    <script language="javascript" type="text/javascript"
    src='menu.js'></script>
    <script language="javascript" type="text/javascript"
    src='menu_items.js'></script>
    <script language="javascript" type="text/javascript"
    src='menu_tpl.js'></script>
    </head>
    <body leftmargin="15" rightmargin="15"
    marginheight="15" marginwidth="15" bgcolor="white">
    <script language="javascript">
    new menu (MENU_ITEMS, MENU_POS);
    </script>
    </body>
    The error message is 'menu' is undefined.
    I supspect that the src=menu.js reference is not
    working but I am not sure how I can change this. Any
    help would be appreciated.
    Hi
    I didn't get a clear picture of your question. Any way try this.
    1) make sure that menu.js is in the same directory as your jsp file. if it is not give the proper path.
    2) what is this MENU_ITEMS, and MENU_POS. instead of it try with integers

  • Use portal functions wethin java project

    Hello Every body,
    I have i Java project,
    i want to perform a user mapping in the portal by this project.
    how can i tell the program whats the host of the portal i am using,
    i have read in some threads that i have to initialize the UMFactory .
    how can i doit,
    what does the method initialize of the UMFactory class shoud take as parameter?
    i wrote the portal path but it does not work.
    i have seen also that i shoud initialize the property: ume.cfg.path !!!
    where can i set this property and with which value i have to set it ??
    Thanks alot
    Morad Zeidan

    Hi,
    With this code you can get a user in the UME.
    Hope this help.
    IUserFactory userFac = UMFactory.getUserFactory();
    IUser thisUser = userFac.getUser("uniqID");
    Regards,
    Stefan

  • How to use bean objects in java script

    function insertRow()
              var row=1;
              var tbl = document.all("TAU");
         var tr = tbl.rows(row);
         var td = tr.cells(0);
         var td2 = tr.cells(1);
         var td3 = tr.cells(2);
         row++;
         tr = tbl.insertRow();
         tr.setAttribute(false);
         td = tr.insertCell();
         td2 = tr.insertCell();
         td3 = tr.insertCell();
         td.innerHTML = "<html:text property='unit' value ='02' />";
         td2.innerHTML = "<html:text property='unit Id' />" ;
         td3.innerHTML = "<html:text property='unit Type' />" ;
    this is my code, it is basicaly add row at run time thru java scripts. i want to set property of beans with this script , in this code i foun error ie. "can not found bean in nay scope" so plz anybody can tell me how can i pass bean object to java script !!!!!!

    mmmh i'm not understanding so much....
    well... as i told before i'm working in oracle database environment and i'm developing a java procedure.
    now, i have this object
    CREATE OR REPLACE
    TYPE REPORT.FATTURA_OBJ AS OBJECT (
    POD VARCHAR2(1000),
    ID_FATTURA NUMBER,
    ID_FILE NUMBER,
    COERENZA_EA_F VARCHAR2(1000),
    COERENZA_ER_F VARCHAR2(1000),
    COERENZA_EA_M VARCHAR2(1000),
    COERENZA_EF_M VARCHAR2(1000),
    ANOMALIA VARCHAR2(1000),
    MOTIVO_INVALIDAZIONE VARCHAR2(1000),
    MATRICOLA_CONTATORE VARCHAR2(1000),
    POTENZA_DISPONIBILE VARCHAR2(1000),
    MEMBER PROCEDURE pulisci
    /and i need to work with it inside this procedure:
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED REPORT."Manage_Excel_ASMBS" AS
    import java.io.*;
    import java.io.IOException;
    import java.io.StringWriter;
    public class Manage_Excel_ASMBS
    public static void read_Excel(String inputFile,int var_Id_Caricamento, int var_Id_Distributore, String var_Distributore) throws SQLException, IOException
              **here i need to put what i'm reading inside the excel file into oracle objects**
    /can you please give me a sample ?
    thanks

  • Need to use business objects with a project, please guide on basics.

    Hello
    I am a dotnet developer (asp.net with C#). I am sorry I dont know much about Business objects. Our client a financial firm wants to use Business object with a web based application. I couldn't got a clear and good understanding of Business object. The client just said Business objects allows dynamically creating reports even clients can create reports very easily even without knowing SQL.
    Kindly guide me about Business Object product and its what component I should check for using it. Please mention some links that can give me introduction.
    Thanks a lot,
    haansi

    Hi
    Business Objects is not just one tool. You should ask your client what they will use e.g. Crystal Reports or Web Intelligence.
    Here you can see half an hour Webinars that give you a good understanding of Business Objects:
    Webinars
    Regards
    Roland

  • Using Container Object in Java Mapping

    Hi All,
    I need to use a Container object inside a Java Mapping, just like the one wich is used in the Graphical Mapping.
    Here is the scenario:
    I have an Interface Mapping with three steps on it.
    The first step is a Java Mapping just to put some info in the Container. The second step is a XSLT transformation that uses an XSLT file to transforms from IDOC to xCBL. The third step is another Java Mapping that get the info from the Container and insert in the xCBL.
    Does any one knows how to do it inside the Java Mapping Code? We cannot make modifications in the XSLT file because of some internal restrictions.
    Thanks,

    Hi,
    If you make the container variable is a part of your message (input of Java Mapping) then you can access as normal fields.
    Just have a look at these discussions-
    How to use Container Variable across Maps
    xi 3.0 - Using BPM variables in messages
    Hope this helps,
    Regards,
    Moorthy

  • Using request object in java web service code

    Hi,
    I am working on a java web service and require the request object in my code.
    This is because i want to get the name of the user who is using this web service.
    I am getting error in the line
    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    Please guide me how to use the request object.
    Please also suggest if there is any other way to get the name of the user who is using the web service.

    Simple answer: This is not possible due a web service doesn't has such request objects.
    If you want to use the user information you have to pass it from the programm logic you are calling the web service. When you have e.g. a JSPDynPage you can read out the user information and supply this information for your web service.

  • Problem using View Object in Java

    I am creating a simple Java class to use a view object (companiesView)that I created and tested in JSP with the following code:
    String where="EID = " + eid;
    companyAppModuleImpl cam=new companyAppModuleImpl();
    CompaniesViewImpl cv=cam.getCompaniesView1();
    cv.setWhereClause(where);
    cv.executeQuery();
    RowSet rs= cv.getRowSet();
    return rs.first().getAttribute("Name").toString();
    I got
    java.lang.NullPointerException
    at setWhereClause
    What step(s) did I miss?
    If you know where I can find such samples, please let me know.
    Thank you.

    Hi,
    You cannot instantiate an application module using the new operator. You have to use the Configuration class. I quote this from the JDeveloper help.
    <quote>
    Use the method oracle.jbo.client.Configuration.createRootApplicationModule().
    Pass this method the package-qualified name of your application module and the name of the configuration you want to use. For example, to instantiate OnlineOrders.OnlineOrdersModule in local mode, you would use: ApplicationModule myAM = Configuration.createRootApplicationModule("OnlineOrders.OnlineOrdersModule", "OnlineOrdersModuleLocal");
    </quote>
    Hope that helps.

  • How can I invoke JavaFX application in Java project

    I want to set an actionlistener on a button.When I click the button,it will run the JavaFX application.
    Any idea?Thanks in advance.

    A program that launches JavaFX programs? Something like this might work:
         * Launches the given JNLP file.
         * @param jnlpFileURL The url to the JNLP file of the JavaFX application we are launching.
        public void launchFXApplication(String jnlpFileURL) throws Exception {
            //Retrieve the runtime.
            Runtime runtime = Runtime.getRuntime();
            //Create the commands we will be executing.
            String[] commands = new String[] {
                System.getProperty("java.home") + File.separator + "bin" + File.separator + "javaws",
                jnlpFileURL
            //Execute it.
            final Process process = runtime.exec(commands);
            //Need to read the input.
            final BufferedReader errorReader = new BufferedReader(
                new InputStreamReader(process.getErrorStream()));
            final BufferedReader outputReader = new BufferedReader(
                new InputStreamReader(process.getInputStream()));
            //Input MUST be read and should be done in separate threads.
            Thread errorThread = new Thread(new Runnable() {
                public void run() {
                    String line;
                    try {
                        while ((line = errorReader.readLine()) != null) {
                            //Examine it if you like. Optional.
                        errorReader.close();
                    } catch (IOException ex) {
                        ex.printStackTrace();
            Thread outputThread = new Thread(new Runnable() {
                public void run() {
                    String line;
                    try {
                        while ((line = outputReader.readLine()) != null) {
                            //Doing something with the input is optional.
                        errorReader.close();
                    } catch (IOException ex) {
                        ex.printStackTrace();
            //Run the separate threads.
            errorThread.start();
            outputThread.start();
            //Wait until it's done.
            process.waitFor();
        }This code will of course need to be signed if you intend to launch it as an applet or via webstart.
    Edited by: aidreamer on Aug 14, 2011 8:35 PM

  • Is there a way to use bpm object in jsp (java)

    hello
    i could see that the bpm object can be used in jsp with javascript and fuego tag. but is there a way to use bpm object with java code?
    thank you!

    Suppose a Servlet/JSP calls java classes. In the java
    functions of those classes, is there a way to get and
    set attributes with application/session scope
    directly? Thanks.Only by passing a reference to those classes (or by tying in to the framework/container).

  • How to run a java project based on x86 Windows XP on Windows CE?

    I am a freshbird of J2ME and i am very confused these days.I beg you can look this topic thoughout.
    I used to configurate a Java Project File about SIP&VOIP successfully,and I can run it well on my PC .
    Now I want to migrate the project to a Mobile OS,and problems comes.
    I have installed the Windows CE 5.0 Evalution Edition on my machine(Windows XP SP2) and it works fine.I search it online for days ,and I download almost all related including CLDC(j2me_cldc-1_1-fcs-src-winunix.zip),MIDP(midp-2_0-fr-spec.zip<==Maybe this is not the right one beacuse it don't have a bin folder),and J2ME Wireless Tool KIt(j2me_wireless_toolkit-2_2-ml-windows.exe).
    I have configrate the enviroment-variable already , but I don't kown what to do next . Do you kown? I would be very thankfull.

    You need to completely rewrite the app to use the mobile APIs as they're very different from the PC ones, I suppose.

  • Using JavaFX to rewrite GUI layer for Java Desktop Swing application

    From the faq's on javafx.com I read the following:
    I currently build applications in Java. Can I reuse my Java libraries in JavaFX Script?
    Yes. You can leverage the power of Java by using any Java library within a JavaFX application.
    This way you can preserve your investment in Java and use JavaFX to build engaging visual experiences.
    Can I use JavaFX to develop a user interface for my Java program?
    While it's easy to write your application in JavaFX and call into Java where necessary,
    the inverse - writing a Java application that calls into JavaFX for the user interface - is not yet true.
    We expect this to be addressed in the near future.
    * Perhaps I'm missing something, but I do not see the difference between the two questions, but they give completely different answers?
    * We have a swing application that we might want to use JavaFX to replace the current Swing user interface, however, we also have alot of business logic / communications code written in
    * Java that we aren't going to rewrite.
    Could someone tell me why the two questions have different answers?
    Thanks. Cheers.

    Hi Josh,
    I'm facing serious issue trying to invoke a javafx class from my java code. Could you please suggest a way to do it. Even hacks would be ood enough for now.
    I have created file Clock.fx. When run individually from my IDE (i'm using NetBeans) it works fine. But when i try to invoke it from a java class in project in throws exception.
    public static void main(String[] args) {
    ScriptEngineManager manager = new ScriptEngineManager();
    JavaFXScriptEngine fxEngine = (JavaFXScriptEngine) manager.getEngineByName("javafx");
    System.out.print("created fxEngine");
    try {
    Object o = fxEngine.eval ("Clock { property: \"Clock\" }");
    fxEngine.invokeMethod (o, "create");
    } catch (Exception ex) {
    ex.printStackTrace();
    I get following exception
    Exception thrown in JavaFX pretty printing: java.io.FileNotFoundException: \tmp\___FX_SCRIPT___.fxdump from StringInputBuffer (The system cannot find the path specified)
    Exception thrown in JavaFX pretty printing: java.io.FileNotFoundException: \tmp\___FX_SCRIPT___.fxdump from StringInputBuffer (The system cannot find the path specified)
    javax.script.ScriptException: compilation failed
    at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.parse(JavaFXScriptEngineImpl.java:255)
    at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.eval(JavaFXScriptEngineImpl.java:145)
    at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.eval(JavaFXScriptEngineImpl.java:136)
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
    at newpackage.Main.main(Main.java:29)
    Could you please give a solution to it. I would be obliged.

Maybe you are looking for

  • How to print text/data in flex 3 using printer???Plz help...

       Hi,           plz tell me the way to print text/data using printer in flex.  I tried the FlexPrintJob class. but it takes object of a container to be printed & prints the visible content of that container(along with scrollbars), bt i want to print

  • Commit=y in import

    Hi all, I am using oracle 9.2. I want o know ig i set the value commit=y at the time of importing the database.HOw much rows or data will get imported at a time or it depends on the buffe size

  • ID in Document library in SharePoint 2013

    Hi, I have an document library in SharePoint 2013.I uploaded some documents to document library for testing.Now I deleted these testing documents.And when user starts adding documents,the id of the document  is not started from 1. So how I will get t

  • Sapscript bottom text in Main, just for the last page, but printing only in the last page

    I need to print a text but only for the last page in the main window. I have tried with IF. IF &PAGE& = &SAPSCRIPT-FORMPAGES& BOTTOM ....TEXT ENDBOTTOM ENDIF But it prints in all pages in every main window. Can someone point me what I am doing wrong

  • Connecting ipad to a printer

    Hi, My mum has an ipad and wants to print off it. She has just brought a Cannon Pixma MG3150 wireless all in one printer. We have gone through the manual and tried to set up the link between the ipad and the printer. She has a Zyxel AMG1202 wireless