J2ME Screen Hierarchy Displayable ScreenCanvas FormAlertListTextbox.

Slides:



Advertisements
Similar presentations
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advertisements

HTML Forms. collect information for passing to server- side processes built up from standard widgets –text-input, radio buttons, check boxes, option lists,
MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee.
BA1 MIDP GUI BA2 Displayable hierarki Displayable ScreenCanvas TextBoxAlertFormList GameCanvas.
MIDP GUI Displayable hierarki Displayable ScreenCanvas TextBoxAlertFormList GameCanvas JEM1/jrt.
Department of Computer Science & Engineering
CSCI 6962: Server-side Design and Programming Input Validation and Error Handling.
Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
JavaScript Forms Form Validation Cookies. What JavaScript can do  Control document appearance and content  Control the browser  Interact with user.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Chapter 7 © 2001 by Addison Wesley Longman, Inc. 1 Chapter 7 Sebesta: Programming the World Wide Web.
Java Programming, 3e Concepts and Techniques Chapter 3 Manipulating Data Using Methods.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Chapter 15 Strings String::Concat String::CompareTo, Equals, == If( string1 == S”Hello”) String1->Equals(S”Hello”) String1->CompareTo(S”Hello”) CompareTo.
Introduction CIS 136 Building Mobile Apps 1. What did we do Software review 2.
1 Chapter 5: Introduction To Form Builder. 2 Forms  Why Do We Use Form Builder?  Why Don’t We Use SQL Only?!
Detecting Changes  ItemStateListener interface – detect changes in internal state of an Item  new selection made in a ChoiceGroup  adjusted value of.
Center for Earned Value Management wInsight – “How to Use” Guide
Forms, Validation Week 7 INFM 603. Announcements Try placing today’s example in htdocs (XAMPP). This will allow you to execute examples that rely on PHP.
VIDEOOPTIONS PIPE LIST PIPE INFO CAMERAS STATUS SLIDER.
CST JavaScript Validating Form Data with JavaScript.
PROG Mobile Java Application Development PROG Mobile Java Application Development Event Handling Creating Menus.
4-Sep-15 HTML Forms Mrs. Goins Web Design Class. Parts of a Web Form A Form is an area that can contain Form Control/Elements. Each piece of information.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Abstract Data Types (ADTs) and data structures: terminology and definitions A type is a collection of values. For example, the boolean type consists of.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - Welcome Application: Introduction to C++
Execution Environment for JavaScript " Java Script Window object represents the window in which the browser displays documents. " The Window object provides.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 12 lcdui Rob Pooley
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 13 lcdui and OXO Rob Pooley
Using Client-Side Scripts to Enhance Web Applications 1.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Exceptions. Exception Abnormal event occurring during program execution Examples –Manipulate nonexistent files FileReader in = new FileReader("mumbers.txt“);
Mark Dixon 1 09 – Java Servlets. Mark Dixon 2 Session Aims & Objectives Aims –To cover a range of web-application design techniques Objectives, by end.
Programming Mobile Applications with Android September, Albacete, Spain Jesus Martínez-Gómez.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
1 HTML Forms
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 17 – Flag Quiz Application Introducing One-Dimensional.
1 CSC 221: Computer Programming I Fall 2004 Lists, data access, and searching  ArrayList class  ArrayList methods: add, get, size, remove  example:
Lecture 10 JavaScript: DOM and Dynamic HTML Boriana Koleva Room: C54
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.
Two Forms Please use speaker notes for additional information!
GUI development with Matlab: GUI Front Panel Components GUI development with Matlab: Other GUI Components 1 Other GUI components In this section, we will.
>> PHP: Insert Query & Form Processing. Insert Query Step 1: Define Form Variables Step 2: Make DB Connection Step 3: Error Handling Step 4: Define the.
User Interface Components Lecture # 5 From: interface-elements.html.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
Swing - 2 Session 13. Swing - 2 / 2 of 38 Objectives (1) Discuss trees and tables Discuss progress bars Discuss MVC architecture Describe menus.
CHAPTER 6 LESSON B Creating Custom Forms. Lesson B Objectives  Suppress default system messages  Create alerts and messages to provide system feedback.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 2 – Welcome Application Introduction to Graphical.
Exceptions. Exception  Abnormal event occurring during program execution  Examples Manipulate nonexistent files FileReader in = new FileReader("mumbers.txt“);
Prof. amr Goneid, AUC1 CSCE 110 PROGRAMMING FUNDAMENTALS WITH C++ Prof. Amr Goneid AUC Part 15. Dictionaries (1): A Key Table Class.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
Overview Project 2 JFileChooser StringTokenizers Vectors/arrays.
Cosc 5/4735 Voice Actions Voice Interactions (API 23+)
Java Threads 1 1 Threading and Concurrent Programming in Java Threads and Swing D.W. Denbo.
CHAPTER 8 Multimedia 1. Using Multimedia ❖ Multimedia: the combination of text, sound, and video to express an idea or convey a message. ❖ Podcasts: a.
1 Visa IntelliLink Spend Management Navigation as a Cardholder Training Deck.
1 Chapter 6: Creating Oracle Data Block Forms. 2 Forms  Application with a graphical user interface that looks like a paper form  Used to insert, update,
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Topics Graphical User Interfaces Using the tkinter Module
User Interface Components
Data Validation and Protecting Workbook
J2ME User Interface I.
Bootstrap Components Reusable components built to provide iconography, dropdowns, input groups, navigation, alerts, and much more.
AWT Components and Containers
Supplier name / number appears ACTIONS:
Topics Graphical User Interfaces Using the tkinter Module
Lab 03 – Linked List.
Presentation transcript:

J2ME Screen Hierarchy Displayable ScreenCanvas FormAlertListTextbox

Form  A screen that contains arbitrary items  Selected methods: int append(Image img) int append(Item item) int append(String str) void insert(int itemNum, Item item) void delete(int itemNum) void deleteAll() Item get(int itemNum) void set(int itemNum, Item item) void setItemStateListener(ItemStateListener iListener) int size()

List  A screen that represents selection of choices  Types of List  List.MULTIPLE – selection of multiple options (checkboxes)  List.EXCLUSIVE – single-option selection only (radiobuttons) – selection is triggered via a command  List.IMPLICIT – single-option selection only – selection is triggered implicitly (List.SELECT_COMMAND)

IMPLICIT EXCLUSIVE MULTIPLE (SUN WTK Emulator)

IMPLICIT EXCLUSIVE MULTIPLE (Nokia S60 Emulator)

List  Creating Lists (List API) List(String title, int listType)  creates new, empty List, specifying its title and the type of the list List(String title, int listType, String[] stringElements, Image[] imageElements)  creates new List, specifying its title, the type of the List, and an array of Strings and Images to be used as its initial contents  best image width/height for List element Image Icon:  16x16 (WTK emulator)  57x41 (Nokia S60 3rd Ed FP 2 Emulator)  … –your phone? Display d = Display.getDisplay(this); int biw = d.getBestImageWidth(Display.LIST_ELEMENT); int bih = d.getBestImageHeight(Display.LIST_ELEMENT);

List  Selected methods int append(String stringPart, Image imagePart) -- append an element to the List void delete(int index) -- delete the element at the given index Image getImage(int index) -- gets the Image part of the given element String getString(int index) -- gets the String part of the given element int getSelectedFlags(boolean[] choices) -- returns the state of all elements (use with List.MULTIPLE) int getSelectedIndex() -- returns the index of an element in the List that is selected (use with List.IMPLICIT, List.EXCLUSIVE)

List Example  Creating List List payMethod = new List(“Payment method”, List.EXCLUSIVE); payMethod.append(“Credit Card”, null); payMethod.append(“PayPal”, null); payMethod.append(“Bank Acct”, null); okCmnd = new Command(“OK”, Command.OK, 1); payMethod.addCommand(okCmnd); payMethod.setCommandListener(...);  Processing Selection (in CommandListener) void commandAction(Command c, Displayable d) { if (c == okCmnd && d == payMethod) { int index = payMethod.getSelectedIndex(); if (index == CCARD) { }

List Appearance  Control with void setFitPolicy(int policy)  Choice.TEXT_WRAP_ON – long list items shown on multiple lines  Choice.TEXT_WRAP_OFF – truncate long list items to fit on one line  Choice.TEXT_WRAP_DEFAULT – use default policy (e.g. truncate with …)

Lab Exercise  Create an application that demonstrates the three types of List screen

Images  MIDP implementations required to support PNG format  Place image files in project resource folder – res/  Loading images Image logo = null; try { logo = Image.createImage(“/gburg.png”); } catch (IOException e) {... handle exception... }

Alert Screen  Intended for showing notification messages  Creating Alerts Alert(String title, String alertText, Image alertImage, AlertType alertType)  constructs a new Alert object with the given title, content, image, and type.  Alert types – WARNING, ERROR, INFO, CONFIRMATION  Screen sequencing and alerts Form receipt = new Form(“Receipt Details”); Alert confirm = new Alert(“Finished”, “The order is submitted!”, null, CONFIRMATION); Display.setCurrent(confirm, receipt);

Alert("ERROR Type", "Error condition notification!", null, AlertType.ERROR)

Alert("WARNING Type", "Warning condition notification!", null, AlertType.WARNING)

Alert("INFO Type", "Information message!", null, AlertType.INFO)

Alert("CONFIRMATION Type", "Confirm to proceed!", null, AlertType.CONFIRMATION)

Alert Screen  Selected methods Image getImage() -- gets the Image used in the Alert Gauge getIndicator() -- gets the activity indicator for this Alert String getString() -- gets the text string used in the Alert AlertType getType() – gets the type of the Alert int getTimeout() -- gets the time this Alert will be shown void setTimeout(int t) -- sets the time this Alert will be shown

Gauges  Used to show progress or get user input  Types of gauges  interactive – get user input (e.g. sliders)  non-interactive, continuous – show operation is executing  non-interactive, incremental – show progress (app should increment)

Gauges  Used to show progress or get user input  Types of gauges  interactive – get user input (e.g. sliders)  non-interactive, continuous – show operation is executing  non-interactive, incremental – show progress (app should increment) Gauge g1 = new Gauge("Interactive", true, 10, 5); Gauge g2 = new Gauge("Non-Interactive, Continuous", false, Gauge.INDEFINITE, Gauge.CONTINUOUS_RUNNING); Gauge g3 = new Gauge("Non-Interactive, Incremental", false, Gauge.INDEFINITE, Gauge.INCREMENTAL_UPDATING);