Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,156,062 members, 7,828,752 topics. Date: Wednesday, 15 May 2024 at 01:43 PM

Javafx For Gui Developer - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Javafx For Gui Developer (1325 Views)

Kivy Framework For Gui Dev. With Python / Hope For C++ Newbies: Gui Toolkits / How To Create A Simple Calculator Using Java Programing Language GUI (2) (3) (4)

(1) (Reply) (Go Down)

Javafx For Gui Developer by mimohmi(m): 2:30am On Sep 09, 2007

Hi all, just thought it right to introduce the new mind blowing tool from
SUN microsystems. Been trying it out. For those people which feel that
GUI programming is hard to grab this is an easy way out.

Ok, The new JavaFx was introduced during the JavaOne conference. it is
worth to mention that it is still under development but the massive support
it gaining especially among the open source community is quite massive.
Also, giving the fact it is declarative language. making it easy for people with
scripting languages to master. Also, there are nice tutorials out there.

Those with Java SE experience will also find it easy to use as it allows importation
of java classes and methods. JavaFx has it own development environment but
plug ins are available for major Java IDE. If your using netbeans 5.5 or 6, just
go to the download center and install the JavaFx modules and examples.

You can download the JavaFx developer environment
http://download.java.net/general/openjfx/demos/javafxpad.jnlp

Tutorials
http://java.sun.com/developer/technicalArticles/scripting/javafxpart1/
https://openjfx.dev.java.net/Learning_More_About_JavaFX.html
https://openjfx.dev.java.net/JavaFX_Programming_Language.html#basic_types



Re: Javafx For Gui Developer by mimohmi(m): 4:05am On Sep 09, 2007

Let compare two code that uses Java Swing and JavaFx.
I just want to show the ease of use. So, let's get codes
that that display a button. Am using netbeans 5.5

Here is the swing code.

package javaswingapp;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

/**
*
* @author Musa
*/
public class Main extends JFrame{
JFrame frame;
JButton btn;

/** Creates a new instance of Main */
public Main() {
}

/**
* @param args the command line arguments
*/

public void buildUi(){
frame = new JFrame();
btn = new JButton("Press Me"wink;
frame.getContentPane().add(btn);
// btn.addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// btn.setText("Am Pressed"wink;
// }
// });

frame.setTitle("Swing Demo"wink;
frame.setSize(400,500);
frame.setVisible(true);
}
public static void main(String[] args) {
// TODO code application logic here
Main m = new Main();
m.buildUi();

}

}

JavaFX Code

import javafx.ui.*;

Frame{
title: "Press Me"
width: 200
content:Button {
text:"Press me"
}
visible: true
};

Notice how declarative it is. Under the hood, it is still a swing appearance


Re: Javafx For Gui Developer by Seun(m): 11:48am On Sep 09, 2007
The problem I have with JavaFX is the size of what people have to download before they can use your application. This is not an issue with software packaged on a CD or DVD or corporate software, but it's a problem for web-based software.
Re: Javafx For Gui Developer by mimohmi(m): 4:03pm On Sep 09, 2007

@Seun

Hey, long time. Been out of the forum for a while now.
Actually, most of the JavaFx example online uses the
Java Network Launch Protocol. That means you have to
run them with javaws tool available with the jdk.
To run, just use
javaws -offline <your-jnlp-file-name>. You can use just
type the command without any option to display other available options.
Also, you can click the java Web start icon in your control
panel for the GUI version.

For deployment, you often deploy the application as a jar
file. Well, I think, it JavaFx is going to be a thing for the future.
Thanks

(1) (Reply)

What Are The Candidate Keys? / Oracle Form / JSTL- Image Download From Mysql Db

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 11
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.