Sun seeks comeback :
Adobe provides developers with a tool-box as well as good media support for music and movies. Above all, it comes out with a lean runtime environment. Flash is proprietary to whom or who are hesitant about supporting 64-bit architectures annoyed that looks at the free alternative Gnash. Microsoft Silverlight is a newcomer in the RIA market and has its share of work yet, because only about 20 percent of browsers have installed its plugin - for Linux still significantly less. It is based on our own Dotnet Framework, a Linux port is created in the Mono project under the name Moonlight.
Anti-authoritarian language :
Over a decade, Internet bandwidth and processing power have increased significantly. This, and the proportion of Cristal are a good 80 percent of all browsers may have motivated Sun's desire to again play along with the RIAs. The company announced in May with Java FX a new language - a pun on the movie business in the usual special effects SFX (). It is a separate language for RIAs, not just another Java library. Java FX is technically based on Java and requires a JRE, but also has influences from the Javascript scripting language, Tcl and the graphic format Scalable Vector Graphics (SVG).
Listing 1 demonstrates similarities with Java as well as new language constructs: The package "for example," defines the class "time." Stranger classes imported by the developer as in Java, he may even use classes from the JDK as "java.text.DateFormat" . The language defined variables and their types def different from Java: The new key words "var" and "regular and constant variables determine. Developers must specify the type of a variable, must it not. The variable "hours" from line 11 is given the type "integer", in "minutes" leaves it to the developer to the compiler to determine the type.
Code:
package example;
import java.lang.System,
import java.text.DateFormat;
import java.text.SimpleDateFormat
import javafx.animation.KeyFrame
import javafx.animation.Timeline
import javafx.lang
public class Time (
public var hrs
: Integer; public var mn
,
public var sec = 0;
public var til = "" / / <- bind on Listing 2 uses a
def int: Duration = 1 s,
def tl = new SimpleDateFormat ("dd.MM.yyyy HH: mm: ss");
function tick () (def simple =
'with simple quotes';
double def = "with double quotes "
test = 'a long text can nw var'
" over several rows defined, ";
mitVariablen var =" with Var '(simple }'.";
System.out.println ("Output) (mitVariablen ")
System.out.println (" letters in test = "
" (test.length ()}.");
/ / Normal Java class use;:
var nw = new java.util.Date () ,
sec = nw.getSeconds ();
mn nw.getMinutes = ();
hrs = nw.getHours ();
tl.format til = nw ();
System.out.println ("(hrs) (mn) (sec) ");
)
/ / Constructor
init (
/ / instance KeyFrame produce from
var ac = KeyFrame (
time: int,
: true canSkip,
/ / function reference:
ac: function () (tick ();)
)
/ / create instance of Time Line ...
var tl = Timeline (repeat Count
:
Timeline.INDEFINITE keyframes: [ac])
/ / ... and restart:
z.play ();)
)
Bookmarks