Tuesday, February 24, 2015

Web Services with Java

Kindle Price: $0.00 includes free international wireless delivery via Amazon Whispernet


The concept of a web service is rather simple; however, the implementation often faces many challenges from the technical aspects to the overall strategy of a business. This book places the emphasis on the technical implementation and technical challenges of a web service from the field. The book leads you through a journey of developing your first web service application to more complex multitier enterprise application. The examples include the use of commercially available software product such as Oracle Fusion Middleware and open source from the Apache Foundation. Through this journey, you will be able to understand and master a process that enable you to incorporate sound techniques to your web service application

Tuesday, February 10, 2015

Core Java for the Impatient

The release of Java SE 8 introduced significant enhancements that impact the Core Java technologies and APIs at the heart of the Java platform. Many old Java idioms are no longer required and new features like lambda expressions will increase programmer productivity, but navigating these changes can be challenging.

Core Java for the Impatient is a complete but concise guide to Java SE 8. Written by Cay Horstmann—the author of Java SE 8 for the Really Impatient and Core Java™, the classic, two-volume introduction to the Java language—this indispensable new tutorial offers a faster, easier pathway for learning the language and libraries. Given the size of the language and the scope of the new features introduced in Java SE 8, there’s plenty of material to cover, but it’s presented in small chunks organized for quick access and easy understanding.

If you’re an experienced programmer, Horstmann’s practical insights and sample code will help you quickly take advantage of lambda expressions (closures), streams, and other Java language and platform improvements. Horstmann covers everything developers need to know about modern Java, including
  • Crisp and effective coverage of lambda expressions, enabling you to express actions with a concise syntax
  • A thorough introduction to the new streams API, which makes working with data far more flexible and efficient
  • A treatment of concurrent programming that encourages you to design your programs in terms of cooperating tasks instead of low-level threads and locks
  • Up-to-date coverage of new libraries like Date and Time
  • Other new features that will be especially valuable for server-side or mobile programmers 
Whether you are just getting started with modern Java or are an experienced developer, this guide will be invaluable for anyone who wants to write tomorrow’s most robust, efficient, and secure Java code.

Monday, February 2, 2015

JavaFX detect right click on mouse

JavaFX example to detect right click on mouse, by setOnMouseClicked(new EventHandler<MouseEvent>(){...}).


package javafxmouseclick;

import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

/**
 *
 * @web http://java-buddy.blogspot.com/
 */
public class JavaFXMouseClick extends Application {
    
    @Override
    public void start(Stage primaryStage) {
        
        Label label = new Label();
        Button btn = new Button();
        btn.setText("Click ME");
        btn.setOnMouseClicked(new EventHandler<MouseEvent>() {

            @Override
            public void handle(MouseEvent event) {
                MouseButton button = event.getButton();
                if(button==MouseButton.PRIMARY){
                    label.setText("PRIMARY button clicked on button");
                }else if(button==MouseButton.SECONDARY){
                    label.setText("SECONDARY button clicked on button");
                }else if(button==MouseButton.MIDDLE){
                    label.setText("MIDDLE button clicked on button");
                }
            }
        });
        
        VBox vBox = new VBox();
        vBox.getChildren().addAll(btn, label);
        
        StackPane root = new StackPane();
        root.getChildren().add(vBox);
        
        root.setOnMouseClicked(new EventHandler<MouseEvent>() {

            @Override
            public void handle(MouseEvent event) {
                MouseButton button = event.getButton();
                if(button==MouseButton.PRIMARY){
                    label.setText("PRIMARY button clicked");
                }else if(button==MouseButton.SECONDARY){
                    label.setText("SECONDARY button clicked");
                }else if(button==MouseButton.MIDDLE){
                    label.setText("MIDDLE button clicked");
                }
            }
        });
        
        Scene scene = new Scene(root, 400, 300);
        
        primaryStage.setTitle("java-buddy.blogspot.com");
        primaryStage.setScene(scene);
        primaryStage.show();
    }

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