Coders Packet

JavaFx Temperature Converter Packet

By Satyam Singh

It is a simple project of converting temperature units using JavaFX. A proper GUI is prepared to perform the function.

Java's unique GUI library was the Abstract Window Toolkit (AWT). Swing (Chapters 12 and 22) was added to the stage in Java SE 1.2. From that point forward, Swing has stayed the essential Java GUI innovation. Swing is presently in support mode—Oracle has halted improvement and will give just bug fixes going ahead; however, it will remain part of Java is still broadly used.Java's GUI, graphics, and multimedia API of things to come are JavaFX. Sun Microsystems (procured by Oracle in 2010) launched JavaFX in 2007 as a contender to Adobe Flash and Microsoft Silverlight. JavaFX 1.0 was delivered in 2008. Preceding adaptation 2.0, designers utilized JavaFX Script—which was like JavaScript—to compose JavaFX applications. The JavaFX Script source code accumulated to Java bytecode, permitting JavaFX applications to run on the Java Virtual Machine. Beginning with form 2.0 in 2011, JavaFX was reimplemented as a bunch of Java libraries that could be utilized straightforwardly in Java applications.

Here, in this packet, we made a temperature converter tool using JavaFX.

GUI Presentation:


Initially, GUI was designed in the applayout.fxml file of JavaFX, in which all the components visible to the users are well placed according to their function. Then in the Mymain.class file, a start method was introduced which displays the top index of the window which contains menu options, also contains a link between the FXML file and the Mymain.class file. Then in the Controller. class file every button, text field, etc. are assigned their function code that'll be performed whenever it'll be used. It detects a proper error if the temperature is not entered in a valid format. After conversion, it popups an alert message displaying the answer of the conversion.

Screenshot Of Results:



Although it is a simple project but uses all the concepts of JavaFX and a very good project to learn and clear all the basic concepts of JavaFX.

Download Complete Code


No comments yet