Wednesday, May 29, 2013

Simple example of JavaFX ComboBox

Simple example of JavaFX ComboBox
Simple example of JavaFX ComboBox


package javafxcombobox;

import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

/**
 * @web http://java-buddy.blogspot.com/
 */
public class JavaFXComboBox extends Application {
    
    @Override
    public void start(Stage primaryStage) {
        
        final ComboBox comboBox = new ComboBox();
        comboBox.getItems().addAll(
                "Item 1",
                "Item 2",
                "Item 3",
                "Item 4");
        comboBox.setValue("Item 1");
        
        final Label label = new Label();
        
        Button btn = new Button();
        btn.setText("Read comboBox");
        btn.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                label.setText("selectd: " + comboBox.getValue());
            }
        });

        VBox vBox = new VBox();
        vBox.setPadding(new Insets(5, 5, 5, 5));
        vBox.setSpacing(5);
        vBox.getChildren().addAll(label, comboBox, btn);
        
        StackPane root = new StackPane();
        root.getChildren().add(vBox);
        
        Scene scene = new Scene(root, 300, 250);
        
        primaryStage.setTitle("Hello World!");
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}


Next: JavaFX ComboBox for custom object

Thursday, May 23, 2013

Join this FREE Virtual Developer Day: Java

Join this FREE virtual event where you will learn about:
  • Improved developer productivity and HTML5 applications
  • What's new in Java that helps you begin programming on a wide range of embedded devices
  • Language improvements in Java SE to accelerate application development Watch informative tutorials that you can repeat at your own pace to improve your Java programming expertise, as well as engage in live chat sessions with technical experts.
Agenda of Virtual Developer Day: Java
Agenda of Virtual Developer Day: Java

Americas/Canada - Wednesday June 19, 2013
9:00 a.m. - 1:00 p.m. PDT / 12:00 p.m. - 4:00 p.m. EDT / 1:00 p.m. - 5:00 p.m. BRT

EMEA/Africa/Middle East - Tuesday June 25th, 2013
9:00:00 a.m. - 1:00pm BST / 10:00:00 a.m. - 2:00 p.m.CEST /

1:30:00 p.m. - 5:30:00 p.m. IST / 12:00:00 p.m. - 4:00 p.m. MSK /

08:00:00 a.m. - 12:00 p.m. Corresponding UTC (GMT)

Register: https://oracle.6connex.com/portal/java2013/login?langR=en_US&mcc=netbneansblog

Sunday, May 19, 2013

Android development arrive IntelliJ

EARLY ACCESS PREVIEW of Android Studio is available now. Android Studio is a new Android development environment based on IntelliJ IDEA. Similar to Eclipse with the ADT Plugin, Android Studio provides integrated Android developer tools for development and debugging.

Android Studio is currently available as an early access preview. Several features are either incomplete or not yet implemented and you may encounter bugs.