Pular para o conteúdo principal

Postagens

Mostrando postagens de janeiro, 2014

A generic handler for all input events in JavaFX 2

The JavaFX API is really complete and sometimes I find new possibilities with it. This is a small blog post to describe what I recently did with the event handling part of the JavaFX API. Update:   Jonathan Giles pointed that we can add a handler  to all kind of events with one single line instead call setOn* multiple times:  lbl.addEventHandler( MouseEvent.ANY, eventHandler) One handler to all Events I'm creating a sample application for my portuguese blog about JavaFX basics and I was exploring the Event class to find the best way to create an event handler to demonstrate all Node's possible event input handlers.(or the most famous one) I found that the event object has an attribute of type EventType and all the events implementations contains a String representation of that event. It can be done checking, for example, the MouseEvent class source code. With this I created only one class to handle all the events on my sample program. I think it might be useful...

Using BRMS/Drools 5 REST API - Part 1

As you might have noticed already, everything comes with a RESTful API . REST is just awesome. A friend of mine works everyday with Business Rule Management System , BRMS, and it has a simple,but useful, client API. In this series of articles, we will create a Java wrapper for the REST API and then a simple JavaFX 2.2 application to use it. In this article I'll describe the reusable wrapper I created. On next article we will talk about the JavaFX application. * I call a programming language   wrapper  an API that allow us to access a REST API without caring about the HTTP operations, but only with the programming language itself. Our wrapper is aimed to help us access the REST API provided by BRMS without having to handle HTTP requests. About BRMS/Drools Drools is a community project  which is part of the product created by Red Hat called BRMS. The BRMS 5.x documentation defines it as follow: "JBoss Enterprise BRMS Platform is a business rules management ...

JavaFX CRUD: The Client Side

Beta post In my last post I showed a JEE application to make CRUD operation on a domain object called Framework, which represents an application framework. In this post we will show the client part, the technologies that were used and how simple is to create JavaFX applications using FXML and pure Java. The view I had the honor of being one of the first "bloggers" to test JavaFX Scene Builder . Using this tool you can drag and drop interface elements and a XML will be generated and it has the .fxml extension. This FXML can be loaded in a JavaFX application and the view elements can be inject in a controller class using the @FXML annotation. Screenshots from the application are in a previous post . Then, in Java side, we have a class called  CrudframeworksPresenter . This class is linked with the FXML and it the presenter, which updates the view and handle the CRUD actions. See the FXML source code first line where I refer to the controller class. I tell the con...