Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Thursday, 11 February 2010

JavaFX HelloWorld

Hi everybody!
As I mentioned couple days before I bought the book about JavaFX. Yes, I started reading it and coding. The syntax is completely different from the languages that I learnt so far, therefore it takes me a bit of time to get used to it.

I would like to share my first Hello World application:


And here is the javaFX code for this:

import javafx.stage.Stage;
import javafx.scene.*;
import javafx.scene.paint.Color;
import javafx.scene.text.*;
import javafx.stage.StageStyle;

var helloWorld: Text;

Stage {
    title: "Helo world"
    width: 200
    height: 200
    resizable: false
    style: StageStyle.DECORATED
    scene: Scene {
        fill: Color.ORANGE
        content: [
            helloWorld = Text {
                layoutY: 80
                layoutX: 20
                fill: Color.BLACK
                font: Font.font("Serif", FontWeight.BOLD, 20);
                content: "HELLO WORLD"
            }
        ]
    }
}


Enjoy!

Cheers

Monday, 23 February 2009

"Hello world!" :)

The first application that any programmer learning any programming language is likely to write is Hello World. This simple program prints out only the string of characters Hello World. Why is it so important if it is so simple?? Well, the main purpose of this task is to get the ‘programmer’ familiar with main structure of the language.

I was bored and got together some Hello World application from the languages I can program in:

1. C

#include <stdlib.h>

void main()
{
printf(“Hello world!”);
}

2. C++

#include <iostream>
using namespace std;

int main()
{
cout << “Hello World” << endl;
return 0;
}

3. Java

public class helloWorld {
public static void main( String[] args )
{
System.out.println(“Hello World”);
}
}


4. PHP


<?php
echo 'Hello World!';
?>

5. Html

<html>
<head>
<title>Hello World</title>
</head>
<body>
Hello World!
</body>
</html>


6. Shell script


#!/bin/csh
echo “Hello World!”


How would you say 'Hello World!'??