Java Language Binding with JavaScript : Script Engines « JDK 6 « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Class
8. Collections Data Structure
9. Data Type
10. Database SQL JDBC
11. Design Pattern
12. Development Class
13. EJB3
14. Email
15. Event
16. File Input Output
17. Game
18. Generics
19. GWT
20. Hibernate
21. I18N
22. J2EE
23. J2ME
24. JDK 6
25. JNDI LDAP
26. JPA
27. JSP
28. JSTL
29. Language Basics
30. Network Protocol
31. PDF RTF
32. Reflection
33. Regular Expressions
34. Scripting
35. Security
36. Servlets
37. Spring
38. Swing Components
39. Swing JFC
40. SWT JFace Eclipse
41. Threads
42. Tiny Application
43. Velocity
44. Web Services SOA
45. XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java » JDK 6 » Script EnginesScreenshots 
Java Language Binding with JavaScript
    

//The Rhino scripting engine of Java SE 6 allows you to use the Java programming language in scripts.

importPackage(javax.swing);
importPackage(java.lang);
importPackage(java.awt.event);

jFrame1 = new JFrame("Greeting");
jLabel1 = new JLabel("Name:");
jTextField1 = JTextField();
jLabel2 = new JLabel();
jButton1 = new JButton("Click");
jFrame1.setSize(400400);
listener1 = {
  actionPerformed:function(e)
  {
    jLabel2.setText("Hello "+jTextField1.getText()" !");
  }
}
alistener = new ActionListener(listener1);
jButton1.addActionListener(alistener);
jFrame1.getContentPane().setLayout(null);
jFrame1.getContentPane().add(jLabel1);
jFrame1.getContentPane().add(jTextField1);
jFrame1.getContentPane().add(jLabel2);
jFrame1.getContentPane().add(jButton1)
jLabel1.setBounds(10504020);
jTextField1.setBounds(505022020);
jLabel2.setBounds(1010022020);
jButton1.setBounds(2805012023);
jFrame1.setDefaultCloseOperation(jFrame1.EXIT_ON_CLOSE);
jFrame1.setVisible(true);
for(;;)
{
}

          
    
    
  
Related examples in the same category
1. Listing All Script Engines
2. Running Scripts with Java Script Engine
3. Execute Javascript script in a file
4. Variables bound through ScriptEngine
5. Catch ScriptException
6. Any script have to be compiled into intermediate code.
7. With Compilable interface you store the intermediate code of an entire script
8. List the script engines
9. Run JavaScript and get the result by using Java
10. Pass parameter to JavaScript through Java code
11. Get the value in JavaScript from Java Code by reference the variable name
12. Working with Compilable Scripts
13. Call a JavaScript function three times
14. Save the compiled JavaScript to CompiledScript objectSave the compiled JavaScript to CompiledScript object
15. Invoke an function
16. Using thread to run JavaScript by Java
17. Get Script engine by extension name
18. Get a ScriptEngine by MIME type
19. Retrieving Script Engines by Name
20. Retrieving the Metadata of Script Engines
21. Retrieving the Supported File Extensions of a Scripting Engine
22. Retrieving the Supported Mime Types of a Scripting Engine
23. Retrieving the Registered Name of a Scripting Engine
24. Executing Scripts from Java Programs
25. Read and execute a script source file
26. Using Java Objects in JavaScript
27. Pass or retrieve values from a scripting engine (jdk1.6)
28. Use an external file containing the javascript code. The .JS file is loaded from the classpath.
29. Use Java scripting engine
30. Run Javascript function with ScriptEngine
31. Use Java scripting engine (JDK 1.6)
32. Use an external file containing the javascript code
33. Compresses a String containing JavaScript by removing comments and whitespace.
34. Escape and unescape javascript code
35. Utility to take xml string and convert it to a javascript based tree within html.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.