Chapter 16 JavaFX UI Controls and Multimedia

Slides:



Advertisements
Similar presentations
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 17 Creating User Interfaces.
Advertisements

What is a Dialog box? A Dialog box is a window or “form” that contains other child windows or “controls” that have a specific appearances and pre-defined.
Controls & Widgets. Overview General controls & widgets Switch Button Dial Latch Slider Handle Physical only Jog dial Joystick Track ball Digital only.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved. 1 Chapter 16 JavaFX UI Controls and Multimedia.
1 Chapter 13 Creating User Interfaces. 2 Objectives F To create graphical user interfaces with various user-interface components: JButton, JCheckBox,
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 16 Creating User Interfaces.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 15 Creating User.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L03 (Chapter 15) Creating.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L04 (Chapter 15) Creating.
1 Creating User Interfaces. 2 Motivations A graphical user interface (GUI) makes a system user-friendly and easy to use. Creating a GUI requires creativity.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 3 Tariq Aziz and Kevin Jones.
Compunet Corporation Programming with Visual Basic.NET GUI Chapter 3 Week 13 Tariq Aziz and Kevin Jones.
Adobe Forms THE FORM ELEMENT PANEL. Creating a form using the Adobe FormsCentral is a quick and easy way to distribute a variety of forms including surveys.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
Visual Basic Chapter 1 Mr. Wangler.
Slider A Slider Lets the user graphically select a value By sliding a knob within a bounded interval Can show both major tick marks and minor ones A listener.
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 13 Creating User.
Chapter 8: Writing Graphical User Interfaces Visual Basic.NET Programming: From Problem Analysis to Program Design.
GUI development with Matlab: GUI Front Panel Components 1 GUI front panel components In this section, we will look at -GUI front panel components -Programming.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
Graphical User Interfaces 2 Tonga Institute of Higher Education.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
1 Chapter Ten Using Controls. 2 Objectives Learn about Controls How to create a Form containing Labels How to set a Label’s Font How to add Color to a.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Java Applets: GUI Components, Events, Etc. Ralph Westfall June, 2010.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 15 Creating User.
CHAPTER:07 JAVA IDE PROGRAMMING-II Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
William H. Bowers – Using Controls Cooper 26.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
Creating User Interfaces Chapter 13 CSCI CSCI 1302 – Creating User Interfaces2 Outline Introduction Common Features of Swing GUI Components Buttons.
Java Programming, Second Edition Chapter Thirteen Understanding Swing Components.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
GUI Controls for Input Design Introduction –Most new applications being developed today include a GUI. This approach is influenced by a new trend in.
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
EECS 1510: Introduction to object-Oriented Programming in Java
Lecture 8:Event Driven Programming Michael Hsu CSULA.
Section §16.1 Introduction  So far, we have kept our UI simple, in order to demonstrate how to create a UI at all, and how to connect its elements.
Graphical User Interface Concepts - Part 1 Session 08 Mata kuliah: M0874 – Programming II Tahun: 2010.
3.02 APPLY PROPERTIES ASSOCIATED WITH THE CONTROLS Computer Programming I.
Visual Basic.NET Windows Programming
Lecture 8:Event Driven Programming
Computing with C# and the .NET Framework
Topics Graphical User Interfaces Using the tkinter Module
Chapter Topics 15.1 Graphical User Interfaces
Chapter 8: Writing Graphical User Interfaces
Chapter 16 JavaFX UI Controls and Multimedia
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
User Forms.
Chap 7. Building Java Graphical User Interfaces
Chapter 16 JavaFX UI Controls and Multimedia
GUI Using Python.
Graphical User Interfaces -- Introduction
Chapter 7 Creating User Interfaces
Recall: Timeline Class
Chapter 13 Creating User Interfaces
Chapter 15: GUI Applications & Event-Driven Programming
Visual C# - GUI and controls - 1
The University of Texas – Pan American
Chapter 17 Creating User Interfaces
Chapter 16 JavaFX UI Controls and Multimedia
Chapter 17 Creating User Interfaces
CMPE212 – Reminders Assignment 5, a JavaFX GUI, due next Friday.
Week 2: WINDOWS PROGRAMMING
Presentation transcript:

Chapter 16 JavaFX UI Controls and Multimedia

Frequently Used UI Controls Prefixes lbl, bt, chk, rb, tf, pf, ta, cbo, lv, scb, sld, and mp are used to name reference variables for Label, Button, CheckBox, RadioButton, TextField, PasswordField, TextArea, ComboBox, ListView, ScrollBar, Slider, and MediaPlayer

Using JavaFX UI Controls: https://docs.oracle.com/javase/8/javafx/user-interface-tutorial/ui_controls.htm#JFXUI336

Labeled A label is a display area for a short text, a Node, or both. It is often used to label other controls (usually text fields) Label and Button share many common properties. These common properties are defined in the Labeled class A graphic or text or both can be placed in Labeled

Label LabelWithGraphic Run

ButtonBase & Button A button triggers an event when clicked. JavaFX provides regular buttons, toggle buttons, check boxes & radio buttons. The common features of these buttons are defined in ButtonBase & Labeled

Example: Button ButtonDemo Run

CheckBox A CheckBox is used for the user to make a selection. Like Button, CheckBox inherits all the properties such as onAction, text, graphic, alignment, graphicTextGap, textFill, contentDisplay from ButtonBase and Labeled

Example: CheckBox CheckBoxDemo Run

RadioButton Radio buttons, also known as option buttons, enable us to choose a single item from a group of choices. In appearance radio buttons resemble check boxes, but check boxes display a square that is either checked or blank, whereas radio buttons display a circle that is either filled (if selected) or blank (if not selected)

Example: RadioButton RadioButtonDemo Run

TextField A TextField can be used to enter or display a string TextField is a subclass of TextInputControl

Example: TextField TextFieldDemo Run

A TextArea enables the user to enter multiple lines of text

Example: TextArea DescriptionPane TextAreaDemo Run

ComboBox A combo box, also known as a choice list or drop-down list, contains a list of items from which the user can choose

Example: ComboBox This example lets users view an image and a description of a country's flag by selecting the country from a combo box ComboBoxDemo Run

ListView A ListView is a component that performs basically the same function as a combo box, but it enables the user to choose a single value as well as multiple values

Example: ListView This program lets users select countries in a list and displays the flags of the selected countries in the labels ListViewDemo Run

ScrollBar A ScrollBar is a control that enables the user to select from a range of values. The scrollbar appears in two styles: horizontal, vertical

Properties: ScrollBar

Example: ScrollBar This example uses horizontal and vertical scrollbars to control a message displayed on a panel. The horizontal scrollbar is used to move the message to the left or the right, and the vertical scrollbar to move it up and down ScrollBarDemo Run

Slider Slider is similar to ScrollBar, but Slider has more properties and can appear in many forms

Example: Slider Rewrite of the preceding ScrollBar example using the Slider to control a message displayed on a panel SliderDemo Run

Case Study: Bounce Ball Listing 15.17 gives a program that displays a bouncing ball. We can add a Slider to control the speed of the ball movement BounceBallSliderDemo Run

Case Study: TicTacToe

Case Study: TicTacToe (cont.) Run

Media We can use the: Media class to obtain the source of the media, the MediaPlayer class to play and control the media, and the MediaView class to display the video JavaFX supports: MP3, AIFF, WAV, and MPEG-4 audio formats FLV and MPEG-4 video formats

MediaPlayer The MediaPlayer class plays and controls the media with properties such as autoPlay, currentCount, cycleCount, mute, volume, and totalDuration

MediaView The MediaView class is a subclass of Node that provides a view of the Media being played by a MediaPlayer. The MediaView class provides the properties for viewing the media

Example: Media, MediaPlayer & MediaView This example displays a video in a window. We can use the: play/pause button to play or pause the video rewind button to restart the video slider to control the volume of the audio http://www.eclipsecat.com/sites/default/files/small.mp4 MediaDemo Run

Case Study: Flags & Anthems This program displays a nation’s flag and plays its anthem FlagAnthem Run