Javafx For Gui Developer

A Member? Please Login  
type your username and password to login
Date: October 13, 2008, 03:25 PM
249407 members and 148022 Topics
Latest Member: charlesluv
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Javafx For Gui Developer
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Javafx For Gui Developer  (Read 149 views)
mimoh_mi (m)
Javafx For Gui Developer
« on: September 09, 2007, 02:30 AM »


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



mimoh_mi (m)
Re: Javafx For Gui Developer
« #1 on: September 09, 2007, 04:05 AM »


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");
        frame.getContentPane().add(btn);
       // btn.addActionListener(new ActionListener() {
         //   public void actionPerformed(ActionEvent e) {
         //       btn.setText("Am Pressed");
         //   }
       // });
       
        frame.setTitle("Swing Demo");
        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


Seun (m)
Re: Javafx For Gui Developer
« #2 on: September 09, 2007, 11:48 AM »

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.
mimoh_mi (m)
Re: Javafx For Gui Developer
« #3 on: September 09, 2007, 04:03 PM »


@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
 Developer Of Fortran Dead At 82  Bardon Full Control Software Needed  Hi Great One's,i Need You To Explain Some Few Things For Me  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 
Google
 
Web www.nairaland.com
Sections: TV/Movies (2) Music/Radio (2) Celebrities Job Talk Jobs/Vacancies (2) Career Talk Romance Books Politics Sports Fashion Travel
Health Schooling Religion General(2) Business Webmaster Programming Computers Phones Cars & Trucks

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.