SlideShare une entreprise Scribd logo
1  sur  18
UNIT 1
JAVAFX 2.0
JavaFX Fundamentals
 The JavaFX 2.0 API is Java’s next generation GUI toolkit for
developers to build rich cross-platform applications.
 JavaFX 2.0 is based on a scene graph paradigm as opposed to the
traditional inmediate mode style rendering.
 Before the creation of JavaFX, the development of rich Internet
applications involved the gathering of many separate libraries and
APIs to achieve highly functional applications.
 These separate libraries include Media, UI controls, Web, 3D, and 2D
APIs.
 Because integrating these APIs together can be rather difficult, the
talented engineers at Sun Microsystems (now Oracle) created a new
set of JavaFX libraries that rool up all the same capabilities under
one roof.
 JavaFX 2.0 is a pure Java (language) API that allows developers to
leverage existing Java libraries and tools.
Installing Required Sotware
 You’ll need to install the following software in
order to get started with JavaFX:
– Java 7 JDK or greater
– JavaFX 2.0 SDK
– Neteans IDE 7.1 or greater
(http://download.oracle.com/javafx/2.0/system_requi
rements/jfxpub-system_requirements.htm)ñ
Creating a new Application
First Steps
 JavaFX applications extend the javafx.application..Application class. The Application
class provides application life cycle functions such as launching and stopping during
runtime.
 In our main() method’s entry point we launch the JavaFX application by simply passing in
the command line arguments to the Application.launch() method.
 Once the application is in a ready state, the framework internals will invoke the start()
method to begin.
 When the start() method is invoked, a JavaFX javafx.stage.Stage object is available for
the developer to use and manipulate.
public void start(Stage primaryStage) {
primaryStage.setTitle("Conceptos JavaFX 2.0");
Group root = new Group();
Scene scene = new Scene(root, 300, 250, Color.WHITE);
primaryStage.setScene(scene);
primaryStage.show();
}
First Steps
 Analogy with a theatre:
– Scene and Stage: There are one or many scenes, and all scenes are performed on a
stage.
 Stage is equivalent to an application window.
 Scene is a content pane capable of holding zero-to-many Node objects.
 A Node is a fundamental base class for all scene graph nodes to be rendered.
 Similar to a tree data structure, a scene graph will contain children nodes by using a
container class Group.
public void start(Stage primaryStage) {
primaryStage.setTitle("Conceptos JavaFX 2.0");
Group root = new Group();
Scene scene = new Scene(root, 300, 250, Color.WHITE);
primaryStage.setScene(scene);
primaryStage.show();
}
First Steps
 Once the child nodes have been added, we set the primaryStage’s (Stage)
scene and call the show() method on the Stage object to show the JavaFX
window.
public void start(Stage primaryStage) {
primaryStage.setTitle("Conceptos JavaFX 2.0");
Group root = new Group();
Scene scene = new Scene(root, 300, 250, Color.WHITE);
primaryStage.setScene(scene);
primaryStage.show();
}
Drawing Text
 To draw text in JavaFX you will be creating a javafx.scene.text.Text
node to be placed on the scene graph (javafx.scene.Scene).
Text text = new Text(100,100,"JavaFX 2.0");//Create a Text node.
//new Text(posX,posY,text to write)
root.getChildren().add(text); //Add a node in the tree.
Text Properties (I)
Rotation
 In the method setRotate(), we have
to specify the rotation angle (in degrees)
Text text = new Text(100,100,"JavaFX 2.0");//Create a Text node.
text.setRotate(45);
root.getChildren().add(text); //Add a node in the tree.
Text Properties (II)
Font. In each Text node you can create and set the font to be rendered onto the
scene grah.
Text text = new Text(105,50, "JavaFX 2.0");
Font f1 = Font.font("Serif", 30);
text.setFont(f1);
Creating Menus (I)
 Menus are standard ways on windowed platform applications to allow users to select
options.
 First, we create an instance of a MenuBar that will contain one to many menu (MenuItem)
objects.
 Secondly, we create menu (Menu) objects that contain one-to-many menu item
(MenuItem) objects and other Menu objects making submenus.
 Third, we create menu items to be added to Menu objects, such as menu (MenuItem).
MenuBar menuBar = new MenuBar(); //Creating a menubar
Menu menu = new Menu(“File”); //Creating first menu
MenuItem menuitem=new MenuItem(“New”); //Creating first item
menu.getItems().add(menuitem); //adding item to menu
menuBar.getMenus().add(menu); //adding menu to menubar
root.getChildren().add(menuBar); //adding menubar to the
//stage
Creating Menus (II)
 For adding an action when you select a menu Item:
menuitem.setOnAction(new EventHandler<ActionEvent>() {
public void handle(ActionEvent t) {
//action
}
});
Creating Menus (III). Example
MenuBar menuBar = new MenuBar();
Menu menu = new Menu("Opcion de Menú");
MenuItem menuitem1=new MenuItem("Opcion 1");
MenuItem menuitem2=new MenuItem("Opcion 2");
menuitem1.setOnAction(new EventHandler<ActionEvent>() {
public void handle(ActionEvent t) {
System.out.println("Opcion 1");
}
});
menuitem2.setOnAction(new EventHandler<ActionEvent>() {
public void handle(ActionEvent t) {
System.out.println("Opcion 2");
}
});
menu.getItems().add(menuitem1);
menu.getItems().add(menuitem2);
menuBar.getMenus().add(menu);
root.getChildren().add(menuBar);
Creating Menus (III). Example
Button (I)
 For adding a button:
 For adding a button with a description text:
 For adding an action for the button:
Button button1 = new Button();
Button button1 = new Button(“Description”);
button1.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
//action
}
});
Button (II)
 For setting the position of the button in the scene layout:
button1.setLayoutX(90);
button1.setLayoutY(150);
Button with images
 We can create a button with a description and a image:
 The ImageView class is a graph node (Node) used to display an already loaded
javafx.scene.image.Image object.
 Using the ImageView node will enable you to crete
special effects on the image to be displayed without
manipulating the physical Image.
Image img = new Image(getClass().getResourceAsStream("fuego.jpg"));
ImageView imgv= new ImageView(img);
imgv.setFitWidth(40); //We set a width for the image
imgv.setFitHeight(40); //We set a height for the image
Button boton1 = new Button("Generar Incendio",imgv);
Label (I)
 For adding a label:
Label l1 = new Label(“Label Description”);
l1.setLayoutX(90); //Setting the X position
l1.setLayoutY(60); //Setting the Y position
root.getChildren().add(l1);

Contenu connexe

Tendances

Advance Java Programming (CM5I) 2.Swing
Advance Java Programming (CM5I) 2.SwingAdvance Java Programming (CM5I) 2.Swing
Advance Java Programming (CM5I) 2.SwingPayal Dungarwal
 
"Android" mobilių programėlių kūrimo įvadas #3
"Android" mobilių programėlių kūrimo įvadas #3"Android" mobilių programėlių kūrimo įvadas #3
"Android" mobilių programėlių kūrimo įvadas #3Tadas Jurelevičius
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentNuvole
 
Advance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingAdvance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingPayal Dungarwal
 
UIAutomatorでボット作ってみた
UIAutomatorでボット作ってみたUIAutomatorでボット作ってみた
UIAutomatorでボット作ってみたakkuma
 
Using Weka from Windows prompt
Using Weka from Windows promptUsing Weka from Windows prompt
Using Weka from Windows promptAlessio Villardita
 
Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2PRN USM
 
A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014Matthias Noback
 
AWT Packages , Containers and Components
AWT Packages , Containers and ComponentsAWT Packages , Containers and Components
AWT Packages , Containers and ComponentsSohanur63
 

Tendances (13)

Advance Java Programming (CM5I) 2.Swing
Advance Java Programming (CM5I) 2.SwingAdvance Java Programming (CM5I) 2.Swing
Advance Java Programming (CM5I) 2.Swing
 
Lesson 4
Lesson 4Lesson 4
Lesson 4
 
Creating Alloy Widgets
Creating Alloy WidgetsCreating Alloy Widgets
Creating Alloy Widgets
 
"Android" mobilių programėlių kūrimo įvadas #3
"Android" mobilių programėlių kūrimo įvadas #3"Android" mobilių programėlių kūrimo įvadas #3
"Android" mobilių programėlių kūrimo įvadas #3
 
Chapter 03: Eclipse Vert.x - HTTP Based Microservices
Chapter 03: Eclipse Vert.x - HTTP Based MicroservicesChapter 03: Eclipse Vert.x - HTTP Based Microservices
Chapter 03: Eclipse Vert.x - HTTP Based Microservices
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven Development
 
Advance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingAdvance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handling
 
UIAutomatorでボット作ってみた
UIAutomatorでボット作ってみたUIAutomatorでボット作ってみた
UIAutomatorでボット作ってみた
 
Using Weka from Windows prompt
Using Weka from Windows promptUsing Weka from Windows prompt
Using Weka from Windows prompt
 
GUI JAVA PROG ~hmftj
GUI  JAVA PROG ~hmftjGUI  JAVA PROG ~hmftj
GUI JAVA PROG ~hmftj
 
Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2
 
A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014
 
AWT Packages , Containers and Components
AWT Packages , Containers and ComponentsAWT Packages , Containers and Components
AWT Packages , Containers and Components
 

En vedette (9)

FPJUCE - Capitulo2
FPJUCE - Capitulo2FPJUCE - Capitulo2
FPJUCE - Capitulo2
 
Unidad o informatica
Unidad o informaticaUnidad o informatica
Unidad o informatica
 
Tema1
Tema1Tema1
Tema1
 
Tema3
Tema3Tema3
Tema3
 
Tema4
Tema4Tema4
Tema4
 
Lenguajes para definir transformaciones
Lenguajes para definir transformacionesLenguajes para definir transformaciones
Lenguajes para definir transformaciones
 
3 interfaces clases_abstractas_herencia_polimorfismo
3 interfaces clases_abstractas_herencia_polimorfismo3 interfaces clases_abstractas_herencia_polimorfismo
3 interfaces clases_abstractas_herencia_polimorfismo
 
Presentacion Java
Presentacion JavaPresentacion Java
Presentacion Java
 
Java orientado a objetos
Java orientado a objetosJava orientado a objetos
Java orientado a objetos
 

Similaire à Unit 1 informatica en ingles

UNIT 5-JavaFX Event Handling, Controls and Components.pdf
UNIT 5-JavaFX Event Handling, Controls and Components.pdfUNIT 5-JavaFX Event Handling, Controls and Components.pdf
UNIT 5-JavaFX Event Handling, Controls and Components.pdfSakkaravarthiS1
 
Java Program Photo Viewer1. Write an app called viewer that will .pdf
Java Program Photo Viewer1. Write an app called viewer that will .pdfJava Program Photo Viewer1. Write an app called viewer that will .pdf
Java Program Photo Viewer1. Write an app called viewer that will .pdfbhim1213
 
L0020 - The Basic RCP Application
L0020 - The Basic RCP ApplicationL0020 - The Basic RCP Application
L0020 - The Basic RCP ApplicationTonny Madsen
 
Java AWT and Java FX
Java AWT and Java FXJava AWT and Java FX
Java AWT and Java FXpratikkadam78
 
The java swing_tutorial
The java swing_tutorialThe java swing_tutorial
The java swing_tutorialsumitjoshi01
 
Selenium interview questions and answers
Selenium interview questions and answersSelenium interview questions and answers
Selenium interview questions and answerskavinilavuG
 
Spring hibernate tutorial
Spring hibernate tutorialSpring hibernate tutorial
Spring hibernate tutorialRohit Jagtap
 
Titanium Appcelerator - Beginners
Titanium Appcelerator - BeginnersTitanium Appcelerator - Beginners
Titanium Appcelerator - BeginnersAmbarish Hazarnis
 
Aspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAlfa Gama Omega
 

Similaire à Unit 1 informatica en ingles (20)

UNIT 5-JavaFX Event Handling, Controls and Components.pdf
UNIT 5-JavaFX Event Handling, Controls and Components.pdfUNIT 5-JavaFX Event Handling, Controls and Components.pdf
UNIT 5-JavaFX Event Handling, Controls and Components.pdf
 
Java Program Photo Viewer1. Write an app called viewer that will .pdf
Java Program Photo Viewer1. Write an app called viewer that will .pdfJava Program Photo Viewer1. Write an app called viewer that will .pdf
Java Program Photo Viewer1. Write an app called viewer that will .pdf
 
JavaFX ALA ppt.pptx
JavaFX ALA ppt.pptxJavaFX ALA ppt.pptx
JavaFX ALA ppt.pptx
 
L0020 - The Basic RCP Application
L0020 - The Basic RCP ApplicationL0020 - The Basic RCP Application
L0020 - The Basic RCP Application
 
Java AWT and Java FX
Java AWT and Java FXJava AWT and Java FX
Java AWT and Java FX
 
The java swing_tutorial
The java swing_tutorialThe java swing_tutorial
The java swing_tutorial
 
The java rogramming swing _tutorial for beinners(java programming language)
The java rogramming swing _tutorial for beinners(java programming language)The java rogramming swing _tutorial for beinners(java programming language)
The java rogramming swing _tutorial for beinners(java programming language)
 
Selenium interview questions and answers
Selenium interview questions and answersSelenium interview questions and answers
Selenium interview questions and answers
 
From Swing to JavaFX
From Swing to JavaFXFrom Swing to JavaFX
From Swing to JavaFX
 
6 swt programming
6 swt programming6 swt programming
6 swt programming
 
Ios - Introduction to platform & SDK
Ios - Introduction to platform & SDKIos - Introduction to platform & SDK
Ios - Introduction to platform & SDK
 
Swing
SwingSwing
Swing
 
To-Do App With Flutter: Step By Step Guide
To-Do App With Flutter: Step By Step GuideTo-Do App With Flutter: Step By Step Guide
To-Do App With Flutter: Step By Step Guide
 
Swings in java
Swings in javaSwings in java
Swings in java
 
28 awt
28 awt28 awt
28 awt
 
Eclipse Tricks
Eclipse TricksEclipse Tricks
Eclipse Tricks
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 
Spring hibernate tutorial
Spring hibernate tutorialSpring hibernate tutorial
Spring hibernate tutorial
 
Titanium Appcelerator - Beginners
Titanium Appcelerator - BeginnersTitanium Appcelerator - Beginners
Titanium Appcelerator - Beginners
 
Aspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_cs
 

Plus de Marisa Torrecillas

Plus de Marisa Torrecillas (20)

Unidad 0 (nueva) español
Unidad 0 (nueva) españolUnidad 0 (nueva) español
Unidad 0 (nueva) español
 
Unit 2 english
Unit 2  englishUnit 2  english
Unit 2 english
 
Unidad 2(español)
Unidad 2(español)Unidad 2(español)
Unidad 2(español)
 
Unit 1 english
Unit 1 englishUnit 1 english
Unit 1 english
 
Unidad 1 (español)
Unidad 1 (español)Unidad 1 (español)
Unidad 1 (español)
 
Unit 0 english
Unit 0  englishUnit 0  english
Unit 0 english
 
Unidad 2. creación_de_un_escenario_de_simulación_con_jav afx_español
Unidad 2. creación_de_un_escenario_de_simulación_con_jav afx_españolUnidad 2. creación_de_un_escenario_de_simulación_con_jav afx_español
Unidad 2. creación_de_un_escenario_de_simulación_con_jav afx_español
 
Unidad 2. creación_de_un_escenario_de_simulación_con_jav afx
Unidad 2. creación_de_un_escenario_de_simulación_con_jav afxUnidad 2. creación_de_un_escenario_de_simulación_con_jav afx
Unidad 2. creación_de_un_escenario_de_simulación_con_jav afx
 
Unit i informatica en ingles
Unit i informatica en inglesUnit i informatica en ingles
Unit i informatica en ingles
 
Unidad 2(español)
Unidad 2(español)Unidad 2(español)
Unidad 2(español)
 
Unidad 1 (español)
Unidad 1 (español)Unidad 1 (español)
Unidad 1 (español)
 
Contrastive essay
Contrastive essayContrastive essay
Contrastive essay
 
Ed and –ing clauses
Ed and –ing clausesEd and –ing clauses
Ed and –ing clauses
 
Information and techonology texts
Information and techonology textsInformation and techonology texts
Information and techonology texts
 
Plan de autoproteccion
Plan de autoproteccionPlan de autoproteccion
Plan de autoproteccion
 
Unidad o informatica en ingles
Unidad o informatica en inglesUnidad o informatica en ingles
Unidad o informatica en ingles
 
PRESENT PERFECT VS PAST SIMPLE IN ENGLISH
PRESENT PERFECT VS PAST SIMPLE IN ENGLISHPRESENT PERFECT VS PAST SIMPLE IN ENGLISH
PRESENT PERFECT VS PAST SIMPLE IN ENGLISH
 
First aids 3
First aids 3First aids 3
First aids 3
 
Fr señales de seguridad
Fr señales de seguridadFr señales de seguridad
Fr señales de seguridad
 
éCrans fr definitif
éCrans fr  definitiféCrans fr  definitif
éCrans fr definitif
 

Dernier

Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsRommel Regala
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxElton John Embodo
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 

Dernier (20)

LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World Politics
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docx
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 

Unit 1 informatica en ingles

  • 2. JavaFX Fundamentals  The JavaFX 2.0 API is Java’s next generation GUI toolkit for developers to build rich cross-platform applications.  JavaFX 2.0 is based on a scene graph paradigm as opposed to the traditional inmediate mode style rendering.  Before the creation of JavaFX, the development of rich Internet applications involved the gathering of many separate libraries and APIs to achieve highly functional applications.  These separate libraries include Media, UI controls, Web, 3D, and 2D APIs.  Because integrating these APIs together can be rather difficult, the talented engineers at Sun Microsystems (now Oracle) created a new set of JavaFX libraries that rool up all the same capabilities under one roof.  JavaFX 2.0 is a pure Java (language) API that allows developers to leverage existing Java libraries and tools.
  • 3. Installing Required Sotware  You’ll need to install the following software in order to get started with JavaFX: – Java 7 JDK or greater – JavaFX 2.0 SDK – Neteans IDE 7.1 or greater (http://download.oracle.com/javafx/2.0/system_requi rements/jfxpub-system_requirements.htm)ñ
  • 4. Creating a new Application
  • 5. First Steps  JavaFX applications extend the javafx.application..Application class. The Application class provides application life cycle functions such as launching and stopping during runtime.  In our main() method’s entry point we launch the JavaFX application by simply passing in the command line arguments to the Application.launch() method.  Once the application is in a ready state, the framework internals will invoke the start() method to begin.  When the start() method is invoked, a JavaFX javafx.stage.Stage object is available for the developer to use and manipulate. public void start(Stage primaryStage) { primaryStage.setTitle("Conceptos JavaFX 2.0"); Group root = new Group(); Scene scene = new Scene(root, 300, 250, Color.WHITE); primaryStage.setScene(scene); primaryStage.show(); }
  • 6. First Steps  Analogy with a theatre: – Scene and Stage: There are one or many scenes, and all scenes are performed on a stage.  Stage is equivalent to an application window.  Scene is a content pane capable of holding zero-to-many Node objects.  A Node is a fundamental base class for all scene graph nodes to be rendered.  Similar to a tree data structure, a scene graph will contain children nodes by using a container class Group. public void start(Stage primaryStage) { primaryStage.setTitle("Conceptos JavaFX 2.0"); Group root = new Group(); Scene scene = new Scene(root, 300, 250, Color.WHITE); primaryStage.setScene(scene); primaryStage.show(); }
  • 7. First Steps  Once the child nodes have been added, we set the primaryStage’s (Stage) scene and call the show() method on the Stage object to show the JavaFX window. public void start(Stage primaryStage) { primaryStage.setTitle("Conceptos JavaFX 2.0"); Group root = new Group(); Scene scene = new Scene(root, 300, 250, Color.WHITE); primaryStage.setScene(scene); primaryStage.show(); }
  • 8. Drawing Text  To draw text in JavaFX you will be creating a javafx.scene.text.Text node to be placed on the scene graph (javafx.scene.Scene). Text text = new Text(100,100,"JavaFX 2.0");//Create a Text node. //new Text(posX,posY,text to write) root.getChildren().add(text); //Add a node in the tree.
  • 9. Text Properties (I) Rotation  In the method setRotate(), we have to specify the rotation angle (in degrees) Text text = new Text(100,100,"JavaFX 2.0");//Create a Text node. text.setRotate(45); root.getChildren().add(text); //Add a node in the tree.
  • 10. Text Properties (II) Font. In each Text node you can create and set the font to be rendered onto the scene grah. Text text = new Text(105,50, "JavaFX 2.0"); Font f1 = Font.font("Serif", 30); text.setFont(f1);
  • 11. Creating Menus (I)  Menus are standard ways on windowed platform applications to allow users to select options.  First, we create an instance of a MenuBar that will contain one to many menu (MenuItem) objects.  Secondly, we create menu (Menu) objects that contain one-to-many menu item (MenuItem) objects and other Menu objects making submenus.  Third, we create menu items to be added to Menu objects, such as menu (MenuItem). MenuBar menuBar = new MenuBar(); //Creating a menubar Menu menu = new Menu(“File”); //Creating first menu MenuItem menuitem=new MenuItem(“New”); //Creating first item menu.getItems().add(menuitem); //adding item to menu menuBar.getMenus().add(menu); //adding menu to menubar root.getChildren().add(menuBar); //adding menubar to the //stage
  • 12. Creating Menus (II)  For adding an action when you select a menu Item: menuitem.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { //action } });
  • 13. Creating Menus (III). Example MenuBar menuBar = new MenuBar(); Menu menu = new Menu("Opcion de Menú"); MenuItem menuitem1=new MenuItem("Opcion 1"); MenuItem menuitem2=new MenuItem("Opcion 2"); menuitem1.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { System.out.println("Opcion 1"); } }); menuitem2.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { System.out.println("Opcion 2"); } }); menu.getItems().add(menuitem1); menu.getItems().add(menuitem2); menuBar.getMenus().add(menu); root.getChildren().add(menuBar);
  • 15. Button (I)  For adding a button:  For adding a button with a description text:  For adding an action for the button: Button button1 = new Button(); Button button1 = new Button(“Description”); button1.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent t) { //action } });
  • 16. Button (II)  For setting the position of the button in the scene layout: button1.setLayoutX(90); button1.setLayoutY(150);
  • 17. Button with images  We can create a button with a description and a image:  The ImageView class is a graph node (Node) used to display an already loaded javafx.scene.image.Image object.  Using the ImageView node will enable you to crete special effects on the image to be displayed without manipulating the physical Image. Image img = new Image(getClass().getResourceAsStream("fuego.jpg")); ImageView imgv= new ImageView(img); imgv.setFitWidth(40); //We set a width for the image imgv.setFitHeight(40); //We set a height for the image Button boton1 = new Button("Generar Incendio",imgv);
  • 18. Label (I)  For adding a label: Label l1 = new Label(“Label Description”); l1.setLayoutX(90); //Setting the X position l1.setLayoutY(60); //Setting the Y position root.getChildren().add(l1);