Narayan G. Maharjan

Narayan Gopal Maharjan is a 22 years old software developer, living in the Kathmandu, Nepal and currently under-graduating on software engineering.He has keen interest at Java and Javafx programming , he started programming from his high school age and he develops software on Web(JavaEE), Desktop(Java Swing,Java FX), Mobile(Android) devices.

FXML Stuffs (include and define)

Hello folks,

Today I would like to blog about the FXML define and include tag which can be very useful for those who are very keen to use FXML in their application. The FXML is an XML file which is loaded by javafx using FXMLLoader . It’s all loaded at the runtime and it’s really fast to load and easy to learn too. The previous blog about the FXML as Flexible XML is just a basic about FXML . Today in this blog here you will learn about how to include FXML files in your main FXML file.

I’m talking about the <fx:include> tag of the FXML.

Let’s see the basic flow of how the <fx:include> are loaded. Let’s assume there are two FXML Main.fxml and Child.fxml

Read More »FXML Stuffs (include and define)

JavaFX has FXML as Flexible XML

Hello Today after long days I’ve came here to share my experience of FXML in JavaFX. After working with FXML I found it’s really easy for every developer.

Requirements:

  •  XML knowledge
  •  CSS knowledge

FXML and Binding Stuff

Ok First lets start with a FXML Template.

In above FXML I’ve not added Rectangle,Button,TextArea controls.
As per the FXML specification you can call the function from the FXML attribute using ‘#’ just before the function name. Here I’ve added #handleButton() and #handleClearButton() functions to handle the event of Buttons. Here First we are going to load them in JavaFX Application moreover we are going to make the Rectangle flexible to the Stage‘s width and height. To make any shapes or controls width and height relative to the Stage‘s width, height we can use bind feature plus a the control or the shape which we are going to make bind must static. Ok now we are going to need one Controller for the FXML which helps to control the FXML GUI components. I’ve already added fx:controller = "fxmlstuff.fxml.GUITemplate" in above FXML. So to map the controller we ought to make one conroller class inside fxmlstuff.fxml package with classname GUITemplate.java
Read More »JavaFX has FXML as Flexible XML

Save Node or Scene to Image in JavaFX 2.0


Even after waiting so many days, the Javafx bug team has not implemented this feature still in this new Javafx General Availability release . So I’ve managed to make blog about this function for javafx. Many javafx enterprises developer may think that javafx is still not useful because they don’t know how to save their graphics component in image format. Developer don’t have a simple api function like sceneToImage() which was provided in javafx script 1.3. Don’t know why ? We developers are that’s why intelligent to find the alternative way. So I also intended to research on this topic.Then started to warmup my hands on keyboard.

We are using some Java apis and JavaFX apis for making these things work. Ok Let’s get started with the class ‘FXImaging’Read More »Save Node or Scene to Image in JavaFX 2.0

Updated: Dynamic TableView Data From Database

Updated in: Aug 5, 2014 @ 12:50 by Narayan [This update is compatible with new Java 8 codes modified]

Hello, Today I’m going to show the demo of how to display the exact database data in JavaFX 2.0 from TableView. I call this TableView as Dynamic TableView because the tableview automatically manages the columns and rows.

Requirements of this demo:

Database StructureRead More »Updated: Dynamic TableView Data From Database

TableView Cell Modify in JavaFX

Hello and Welcome . Today I would like to blog about the TableView of Javafx 2.0 beta b_45. If you are new to the TableView then please have a look at these class files.

The java documentation of those classes are very important for you when developing the application.

Let’s start here. First the thing what I’m going to show you is about the Cell which is the intersection of any row and column. Before going to TableCell , you can go for the TableColumn which helps to take control over the TableCell with cellFactory. The TableColumn is the column of any table which defines the new column with it’s defined named. Let’s make four columns our Test. I’m running these codes with compatible to JavaFX 2.0 build 45. So it might varies on future or on previous version of javafx.Read More »TableView Cell Modify in JavaFX