Possible to create java code on the fly?

I'm just curious.
I am in the process of making a bunch of custom Lightweight components which will be a part of a physics tutorial package. (Stuff like arrows, charges, fields, cars, rocks, etc.). I have some specific tutorial applets I am creating for a prof at my local u using these components.
In the middle of this, I thought...
Wouldn't it be GREAT if I could make an extremely simple "editor" which my prof could use directly to create his own applets? (I can certainly do the drag and drop, menus and stuff that would go along with this)
Is it possible to write a program in Java which writes and compiles Java, without too much fuss?
Another words, it would be wonderful if my prof could:
Click on the Charge Object
Drag it to the Physics Container
Click on the Physics Container
Turn on the Electric Field by changing the Container's properties
Then hit Some Menu->Compile Applet
and boom!! he'd have his applet exactly the way he wants it. (and the program would create the code for him to put on his website).
Is it possible?
:) Jen
(P.S. please remember that my prof can't do Java, so even Java Beans in an IDE are out).

Sure it's possible, but there are three things you need to consider here.
1. Your IDE would support drag-and-drop as per your requirements. You'd have to learn that incase you haven't already done so.
2. There's no point in writing your own Java compiler. You could after pouring through the specifications, but it's better just to generate the source file and compile it by running javac through your application.
3. The source code generation. Depending on which part of your final applet code is fixed and which is variable this could be lot of work (the trickiest part being to decide what is fixed and what is variable.. in other words, the design).
It sounds like fun alright, but you would get the same results by just putting all these features in the applet itself. Have the applet allow the user to choose amongst a host of features (the ones that you plan to put into your editor). I guess you'll have to make your final decision based on how much time you have.
Have fun and best of luck.
Arjun

Similar Messages

  • Creating Java code for the function module

    Hi Colleagues,
    I have a fuction module in ABAP system. Now I want to Generate java code for the FM.
    I cam to know that we can achive that using AXIS, By getting the XML file for the fuction module and generate Java
    Class file using that XML file.
    Can any one tell me how to achive it.
    Or any other way to do that?
    Please provide you valid suggestions.
    Regards,
    Sathya

    Hi,
    You can integrate axis2 in eclipse. I think you have to find the plugin for that.
    After that you can let axis generate the jave code (stubs and proxies) for your web service via the wsdl file.
    Kind Regards,
    Robin

  • How do I create an object on the fly

    Hello there,
         I was wondering if it is possible to create an object on-the-fly. For example:- I have a class called Customer which holds the name, address and phone number of a customer. While the program is running I get a new customer, Mr Brown. How can I create a new Customer object which will hold the details of Mr Brown.
    yours in anticipation
    seaview

    If I understood you right, you are thinking far too complicated.
    So, when you click a button, a new object shall be created and stored. So basically you write a listener to your button that contains a method like this:
    public void actionPerformed(ActionEvent e){
       Customer newCustomer = new Customer(textfield.getText());
       listOfCustomers.add(newCustomer);
    }Maybe what got you confused is the object's name. Remember this: variables and field names DON'T exist anymore at runtime! They are just meant to help you when programming. If you want Mr. Brown as a customer, you have to provide a field in the customer class for the name. If a field is required for the existence of an object, you usually write a custom constructor for it, which accepts an according parameter.

  • Create Employee code with the mix of alphabets & numeric

    Hai,
    Is there any possibility to create Employee code with the mix of alphabets & numeric instead of the system generated employee code in employee master data? If so,   pls explain.
    Any suggestion is appreciated.
    Thanks,
    Parvatha Solai.N

    Hi Solai,
    You can do a work around for it. Just Leave the Employee ID field as it is. Create a new User Defined field (Alpha Numeric Type) And make it visible on the the employee master data form.
    Step2 : Depending upon your need  write the code that is if it should be auto generated write the code for else leave it blank for the user to enter the employee code.
    Step3: In before action = True. Make the newly created field as mandatory and check whether the value in the field is unique.
    Refer Route Class. Hope you understand
    Regards,
    P. Anand
    Edited by: Anand peter on Jan 2, 2012 11:59 AM

  • Provide the java code for the following scenario.

    Hi Experts,
    I have tried with all the combinations for this scenario. As per my understanding i require java code for the following scenario
    so that it becomes easy........
    I require a Message mapping for this Logic.
    In the Source there are 4 fields and, the Target side, the fields should appear like this.
    Source Structure- File
    Record
    |-> Header
    Order_No
    Date
    |-> Item
    Mat_No
    Quantity
    Target Structure-IDoc
    IDoc
    |-> Header
    |-> Segment
    Delivery_Order_No
    Recv_Date
    |-> Item
    |-> Segment
    Delivery_Order_No
    Material_Num
    Recv_Quantity.
    The Logic is for every Order number an IDOC is generated.And if the Material num matches then the quantity should be added. and important note is that the material numbers are different for every order number. That means if a material number is 2 in the order number A. Then the material number can never be 2 in any of the order numbers.Here is the following with an example for the above scenario.
    For example:-
    we have
    Source Structure- File
    Order-no Date Mat_No Quantity
    1 01/02/2011 A 10
    1 01/02/2011 B 15
    1 01/02/2011 A 10
    2 01/02/2011 C 10
    2 01/02/2011 C 10
    3 01/02/2011 D 20
    3 01/02/2011 D 10
    3 01/02/2011 E 25
    Target Structure-IDoc
    Delivery_Order_No Recv_Date Material_Num Recv_Quantity
    1 01/02/2011 A 20
    1 01/02/2011 B 15
    2 01/02/2011 C 20
    3 01/02/2011 D 30
    3 01/02/2011 E 25
    So for this example total of 5-Idocs created. That means for this example if Order_No is 1 When the Mat_No is A the quantity gets added. For this Scenario 1 IDoc with four Fields 2 in Header(Delivery_Order_No, Recv_Date) and 2 in Item(Material_Num, Recv_Quantity) is generated by adding the quantity field in the Target Side. Similarly if Order_No is 1 when the Mat_No is B then separate IDoc is generated with four Fields 2 in Header(Delivery_Order_No, Recv_Date) and 2 in Item(Material_Num, Recv_Quantity) in the Target Side. Similarly, if Order_No is 2 when the Mat_No is C, an IDoc is generated with four Fields 2 in Header(Delivery_Order_No, Recv_Date) and 2 in Item(Material_Num, Recv_Quantity) by adding the quantity field in the Target Side. ike wise the process goes on upto 3.Kindly do the needy..
    Kindly provide the java code.
    Thanq very much in advance..

    what i have understood from ur example is that u want to generate an idoc for unique combination of  Order-no and Mat_No
    if yes then chk the below mapping..
    change the context of Order_No, Date, Mat_No and Quantity to Record (right click-> context)
    1)
    Order-no
    ----------------------concat[;]---sort----splitbyvalue(valuechanged)-----collapse context---IDoc
    Mat_No
    2)
    Order-no
    --------concat[;]---sort----splitbyvalue(value changed)---collapse context---UDF1--splitbyvalue(each value)--Delivery_Order_No
    Mat_No
    3)
    Order-no
    -----------concat[;]---sortbykey----------------------- \
    Mat_No                       /                            \
    Date--------------- /                                       \
    ----------------------------------------------------------FormatByExample-----collapsecontext---splitbyvalue(each value)----Recv_Date
    Order-no                                                 /
    -----------concat[;]---sort----splitbyvalue(value changed)
    Mat_No
    4)
    Order-no
    --------concat[;]---sort----splitbyvalue(value changed)---collapse context-UDF2--splitbyvalue(each value)--Material_Num
    Mat_No
    5)
    Order-no
    -----------concat[;]---sortbykey
    Mat_No                       /
    Quantity --------------- /
    ----------------------------------------------------------FormatByExample-----SUM(under statistic)----Recv_Quantity
    Order-no
    -----------concat[;]---sort----splitbyvalue(value changed)
    Mat_No
    UDF1:
    String [] temp= a.split(";");
    return temp[0];
    UDF2:
    String [] temp= a.split(";");
    return temp[1];

  • How to create reports online on the fly using meta-data.

    We have dataset and blank report. How can I create report design on the fly ? so that it will able to display report dataset.
    Can someone tell me it is possible or not ? or some reference links....

    Hello,
    This can be certainly done by executing a script written using Report Application Server (RAS) SDK.
    Please refer the link : [http://devlibrary.businessobjects.com|http://devlibrary.businessobjects.com] for detailed documentation on the usage of RAS SDK.
    Regards,
    Chinmay Athavale
    Edited by: Chinmay1009 on Jul 27, 2010 3:46 PM

  • Creating java code from a class diagram in JDeveloper

    I have created a class diagram in JDeveloper 11.1.1.3.0. When I generated java code from the class diagram by right clicking on the class diagram->transform->same diagram->UML to Java, a .java file is generated with attributes and getters/setters, and also a .uml_cla file is generated. What is this .uml_cla file exactly and what is it used for? Also I have a package.uml_pck file that was created 3 times. I have a package of com.xxx.xxxx, and it put this package.uml_pck file in "com", in "xxx", and in "xxxx". Do I need to retain all 3 of these files in my project?
    One more question related to this. When I change something in the java representation of the class diagram (i.e. a datatype), it updates the .java file that was generated from the class diagram, and it also works the other way...change the .java file and the java representation of the class diagram changes. However, the class diagram that the code was generated from does not change, nor does the mysterious .uml_cla file I asked about in the above paragraph.

    This did work for me, with an exception. I have put the .java files generated from the class diagram in a different package from the .class_diagram file, the package.uml_pck file, and the .uml_cla file to keep the actual source code separate. When I modified the .java file and transformed the class diagram from java to UML, it created the package.uml_pck file and the .uml_cla files again in the same package as the .java file, and they show the update. The package.uml_pck file, and the .uml_cla file that were originally created and are in the separate package from the .java files were untouched, thus the class diagram displayed does not reflect the change either. Does this mean I should not, or cannot, separate these files, and that they all must be left in the same package? (the purpose of separating it in the first place was for ease of deployment since we don't want to deploy any of the class diagram files) Thanks!

  • Is it possible to create a link on the content of a text annotation??

    Is it possible to create a link on the content of a annotation??? Like the content of an annotation is some notes as well as a link...
    content -
    this is my first annotation(notes)
    http://www.google.co.in/(link)
    is it possible to create a link for the url given in the content of an annotation??? On click on the url...it should get opened...
    please reply its really urgent....

    How/where do you want to accomplish it?
    Within the document? Using Acrobat? Using another application?
    Using Acrobat within the document would be possible using Acrobat JavaScript. You can access the annotation objects of your document, and you then can evaluate the properties of each of these objects. Have a closer look at the Annotation Object section in the Acrobat JavaScript documentation.
    You will look for the contents property, and evaluate its content. When you have found something looking like a URL, you can create a link (using the rect property of the annotation), and you have what you want; you might then think to destroy the annotation, as it may overlay the link.
    Hope this can help.
    Max Wyss.

  • Is it possible to create a BBS in the web app?

    Is it possible to create a BBS in the web app?

    BBS you mean Bulletin board?
    You have a forums module in BC.

  • Is it possible to create a link to the bibliographies ?

    is it possible to create a link to the bibliographies ?

    How/where do you want to accomplish it?
    Within the document? Using Acrobat? Using another application?
    Using Acrobat within the document would be possible using Acrobat JavaScript. You can access the annotation objects of your document, and you then can evaluate the properties of each of these objects. Have a closer look at the Annotation Object section in the Acrobat JavaScript documentation.
    You will look for the contents property, and evaluate its content. When you have found something looking like a URL, you can create a link (using the rect property of the annotation), and you have what you want; you might then think to destroy the annotation, as it may overlay the link.
    Hope this can help.
    Max Wyss.

  • How to get the java code of the message mapping

    how to get the java code of the message mapping,
    I mean to ask how to get the background java code of the message mapping(graphical mapping).
    And where to view it?

    Hi Satya,
    The JAVA code for graphical msg mapping is in below folder:
    \usr\sap\<SID>\<DVEBMGS10>\j2ee\cluster\server0\temp\classpath_resolver
    Here all the mapping jars are there in this folder.
    Just decompile these jars and you can see the code.
    Thanks,
    Rajeev Gupta
    Message was edited by:
            RAJEEV GUPTA

  • Is it possible to create graph with in the table / Pivote table.

    Is it possible to create graph with in the table / Pivote table.
    Emp# Emp Name % Bonus Pay Amt
    111 AAA $28276
    222 BBB $78878
    In the place of Bonus I have to display Bar (Chart) instead of number.
    Is it possible in OBIEE? I know we can display chart and table next by next but my user want display just like above.
    Please help me on this issue
    Thank you very much for your time

    hi,
    it is better for 2 different questions,make 2 differents threads...
    You used the 2ond solution(google???),put in the dashboard...html enabled...and check your pdf again.
    Moreover,printing pdf with answer is discouraged...always prefer Xml Publisher.
    Last,there are 2 fst files which configure the *.pdf files , check them,
    http://obiee101.blogspot.com/2008/09/obiee-pdf-controls-fst-files.html
    hope i helped....
    http://greekoraclebi.blogspot.com/
    ///////////////////////////////////////

  • Is it possible to create in R/3 the invoices with status u0091parkedu0092?

    Hi ppl.
    We are working in EBP with extended classic scenario.
    We want to create invoices in EBP, but we want to create all invoice documents via EDI with status ‘parked’ in R/3.
    We read note 501524 (EDI: Generally parking incoming invoices). The note describes all that we want to do, but the problem is that the Function exit ‘EXIT_SAPLMRMH_014’ does not work for ‘BBPIV’ message type and the ‘IDOC_INPUT_BBP_IV’ function module.
    Is it possible to create in R/3 the invoices with status ‘parked’ for all incoming invoices created in EBP?
    Thanks and regards.

    Raul,
            Did you find a solution for this.
    We want to do the same here.
    thanks
    Sanjay

  • How to view the java code of the message mapping,

    Hi Experts,
    <b>how to view the java code of the message mapping,</b>
    how to get the background java code of the message mapping(graphical mapping).
    And where to view it?

    Hi sowmya,
    Open any  Message mapping in IR. Press <b>CtrlShift0(zero)</b> to open a new menu.
    There you will find an option "Is Java Source Code Available?"
    There will be an export button nearby. Use it to get the code.
    Open it in a zip , you will see the hide java code.
    The JAVA code for graphical msg mapping is in below folder:
    \usr\sap\<SID>\<DVEBMGS10>\j2ee\cluster\server0\temp\classpath_resolver
    Here all the mapping jars are there in this folder.
    Just decompile these jars and you can see the code.

  • How  to get the java code of the standard functions

    How  to get the java code of the standard functions in xi
    Example , hoh get the java code for a node function - removeContext.

    hi
    Click on the Standard Function.
    Hold Ctrl+Shift
    right click on the standard function to view the context menu. You will see options to view the source code by exporting
    regards
    krishna

Maybe you are looking for

  • Stock value and Quantity on a particular date

    Hi all, How to get the Stock value and Quantity on a particular date for the materials is there any standard report available or from which tables the corresponding  data can be fetched... With Regards, Vamsi.

  • What games still work with the 3.1.3 virsion

    so i brought my little sister a 1st genration ipod and im needing to know what games work with the 3.1.3 virsion

  • Hp Pro 8500 Photo

    I am trying to print photos on the HP Pro 8500 and am having many issues.  The prints are too dark, much darker than how they appear on screen.  And on the other end, some pictures come out too light.   I am using Lightroom and have tried to install

  • Templates will not load

    Hi there, I really REALLY need some help! I'm using DVD Studio 4.2.1 and when importing a template all I get is a progress bar that never finishes. I have to Force Quit the application every time I've tried this. I have already tried deleting prefere

  • Why does Firefox trigger the UAC warning each time I open it?

    I design websites and test them across most browsers. We use Windows 7 operating system, and only Firefox triggers the User Account Control message on our test computers, which is a major annoyance when opening instances of Firefox in rapidfire order