User Tools

Site Tools


part_4-_java_mode

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
part_4-_java_mode [2007/05/31 10:45]
tomliar0 created
part_4-_java_mode [2007/09/13 06:43]
scarl Added caution about Java mode
Line 1: Line 1:
 ===== Processing Tutorial ===== ===== Processing Tutorial =====
 === Part 4: Java Mode === === Part 4: Java Mode ===
-In Java mode, you can use full java programs. ​Just put your code in a class that extends PApplet:+In Java mode, you can develop complete Java programs ​with classes, methods, and most anything ​However,​ you cannot develop stand-alone Java apps in Processing. ​ All Processing sketches are essentially applets, governed by the Processing system class ''​PApplet''​. 
 + 
 +To write a sketch in Java Mode, start by writing ​a class that extends PApplet:
  
   public class MyDemo extends PApplet   public class MyDemo extends PApplet
   { ...   { ...
  
-Now that your program has its own class name, you can reference it from other programs, ​which allows ​you to re-use it in other applications.+Now that your program has its own class name, you can reference it from other programs, ​and you can re-use it in other applications.
  
-[This removes ​the limitations ​of Processing- you can now use Processing utilities without being constrained to one of Processing'​s PApplet windows. This means that you can write a program that uses one of Processing'​s windows as an embedded object, etc.]+Also, any Processing sketch (in any mode) can be made up of multiple files using //​tabs//​. ​ A new tab is created by clicking the right-arrow button on the right hand side of the tab bar (the bar which contains your sketch'​s name). 
 + 
 +However, the Processing reference cautions that this mode is not really recommended. ​ There are tricky issues in communicating values/​methods across Java files that take a solid understanding of the Java language to get right. ​ Java code can be added to a sketch written for Continuous mode using the tabs described above.  ​This removes ​some  ​of Processing's limitations ​- you can now use Processing utilities without being constrained to one of Processing'​s PApplet windows. This means that you can write a program that uses one of Processing'​s windows as an embedded object, etc.
  
 \\ \\
-Next: [[Part 5- Running Programs]] 
  
-Last: [[Part 3- Continuous Mode]]+Prev: [[Part 3- Continuous Mode]] ​| Next: [[Part 5- Running Programs]] 
part_4-_java_mode.txt · Last modified: 2007/09/13 06:43 by scarl