Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 INF160 IS Development Environments AUBG, COS dept Lecture 04 Title: Computer Applications (Extract from Syllabus)

Similar presentations


Presentation on theme: "1 INF160 IS Development Environments AUBG, COS dept Lecture 04 Title: Computer Applications (Extract from Syllabus)"— Presentation transcript:

1 1 INF160 IS Development Environments AUBG, COS dept Lecture 04 Title: Computer Applications (Extract from Syllabus)

2 2 Lecture Contents: §Program – definition/description §Application – definition/description §Categories of applications §Demo programs/applications

3 3 Demo Programs: Group name:Test160aHelloWorld Console Applications: §Test160aHelloWorldVB §Test160aHelloWorldCPP §Test160aHelloWorldC# §Test160aHelloWorldJava

4 4 Demo Programs: Group name:Test160eGUI1 GUI Applications: §Test160eGUI1VB §Test160eGUI1CPP §Test160eGUI1C# §Test160eGUI1Java

5 5 Demo Programs: Group name:Test160eGUI2 GUI Applications: §Test160eGUI2VB §Test160eGUI2CPP §Test160eGUI2C# §Test160eGUI2Java

6 6 Demo Programs: Group name:Test160eGUI3 GUI Applications: Java Applets §Test160eGUI3Java

7 7 Program – definition/description §Program: An organized list of instructions that, when executed, causes the computer to behave in a predetermined manner. §A program is like a recipe. It contains a list of ingredients (called variables) and a list of directions (called statements) that tell the computer what to do with the variables. The variables can represent numeric data, text, or graphical images. §Without programs, computers are useless.

8 8 Application – definition/description §Application: A program or a group of programs designed for end users. §Application software can be divided into two general classes: l Systems software l Application software. for details, open next 2 slides

9 9 Application – definition/description §Systems software consists of low-level programs that interact with the computer at a very basic level. This includes: §Operating Systems components, § Compilers or Language Processors, § Uutilities for managing computer resources.

10 10 Application – definition/description §In contrast, application software (also called end-user programs) includes: §Data Base programs, §Word processors, §Spreadsheets etc. §Figuratively speaking, applications software sits on top of systems software because it is unable to run without the operating system and system utilities.

11 11

12 12 Enterprise application §Enterprise application, or §Enterprise software, or §Enterprise Application Software (EAS) are all commonly used phrases i.e. synonyms to describe applications -- or software -- that a business would use to assist the organization in solving enterprise problems.

13 13 Categories of applications – primitive elementary classified §Console Applications §Windows GUI Applications §Web based (Internet) Applications

14 14 Categories of applications – more precise classification §Most IDEs come with a package of wizards that generate starting code for wide variety of applications §Console Applications §Windows GUI Applications §Web based (Internet) Applications §Services §Class libraries  Other special applications

15 15 Categories of applications – more precise classification §Console Applications l Run in a command prompt l And are text – only l Reading from the keyboard l Writing to the screen

16 16 Categories of applications – more precise classification §Windows GUI Applications l Are graphical applications l Use mouse and keyboard for generating events l Use Windows controls such as labels, text boxes, buttons, check boxes, radio buttons etc.

17 17 Categories of applications – more precise classification §Web based (Internet) Applications l Run on a Web server l When a particular URL is loaded l Send HTML as response to a request from a waiting browser

18 18 Categories of applications – more precise classification §Services l Applications that run in the background l And respond to requests l But have no any visual user interface

19 19 Categories of applications – more precise classification §Class libraries l Are collections of code that can be called by other code. l Static libraries (.lib,.a) l Dynamic libraries (.dll)

20 20 You can create several different types of programs using C#. For example,.NET console application running on Windows..NET graphical user interface (GUI) application running on Windows (desktop applications). ASP.NET web application running on Internet Information Services (IIS).

21 21C# Programming: From Problem Analysis to Program Design21 Types of Applications Developed with C# §Web applications §Windows graphical user interface (GUI) applications §Console-based applications §Class libraries and stand-alone components (.dlls) §Smart device applications §Services

22 22C# Programming: From Problem Analysis to Program Design22 Types of Applications Developed with Java §Java programs may be applications or applets. §Applications are standalone programs, similar to.NET Console applications and/or Windows based GUI applications. §Applets are similar to applications, but they do not run as standalone programs. §- Instead, applets adhere to a set of conventions that lets them run within a Java-compatible browser (client-side). §- You can only run an applet from an HTML page.

23 23 Java Programming: From Problem Analysis to Program Design, 4e INTRO to Graphical User Interface (GUI) Components §Computing Process models l I P O l Client Server §JAVA I-P-O Applications classified: l Console applications Input data, output data displayed in MSDOS window l Windowed applications Using dialog boxes for input/output (class JOptionPane and methods) l Windows based GUI applications Using Swing class library components: windows, labels, text fields, buttons etc.

24 24 Java Programming: From Problem Analysis to Program Design, 4e INTRO to Graphical User Interface (GUI) Components §Drawbacks/disadvantages of l Console applications l Dialog boxes based windowed applications §Suppose, the user/developer wants the program to display all input data and output data in one pane or window or dialog box §Java calls such a dialog box GUI or simply UI

25 25 Java Programming: From Problem Analysis to Program Design, 4e Graphical User Interface (GUI) Components §Advantages of using GUI: l View inputs and outputs simultaneously l One graphical window l Input values typed in any order l Change input values in window l Click on buttons to get output

26 26 Java Programming: From Problem Analysis to Program Design, 4e Graphical User Interface (GUI) Components §Terminology: §Frame l Title bar System supported icons Title l Content pane Components – labels, text fields, buttons etc

27 27 Web based (Internet) Applications §C§C

28 28 Web Applications C# Programming: From Problem Analysis to Program Design28 Figure 1-14 Web application written using C#

29 29C# Programming: From Problem Analysis to Program Design29 Web Applications ( continued ) §C# was designed with the Internet applications in mind §Can quickly build applications that run on the Web with C# l Using Web Forms: part of ASP.NET

30 30 Windows GUI Applications §C§C

31 31C# Programming: From Problem Analysis to Program Design31 Windows Applications §Applications designed for the desktop §Designed for a single platform §Use classes from System.Windows.Form §Applications can include menus, pictures, drop-down controls, buttons, text boxes, and labels §Use drag-and-drop feature of Visual Studio

32 32C# Programming: From Problem Analysis to Program Design32 Windows Applications ( continued ) Figure 1-15 Windows application written using C#

33 33 Console Applications §C§C

34 34C# Programming: From Problem Analysis to Program Design34 Console Applications §Normally read input data from the keyboard §Display text on the command console §Easiest to create l Simplest approach to learning software development l Minimal overhead for input and output of data

35 35 Demo Programs: Console Applications:

36 36 Demo Programs: Group name:Test160aHelloWorld Console Applications: §Test160aHelloWorldVB l Source text l Demo execution

37 37 Demo Programs: Group name:Test160aHelloWorld Console Applications: §Test160aHelloWorldCPP

38 38 Demo Programs: Group name:Test160aHelloWorld Console Applications: §Test160aHelloWorldC#

39 39 Demo Programs: Group name:Test160aHelloWorld Console Applications: §Test160aHelloWorldJava

40 40 Demo Programs: GUI Applications:

41 41 Demo Programs: Group name:Test160eGUI1 GUI Applications: §Test160eGUI1VB §Test160eGUI2VB

42 42 Demo Programs: Group name:Test160eGUI1 GUI Applications: §Test160eGUI1CPP §Test160eGUI2CPP

43 43 Demo Programs: Group name:Test160eGUI1 GUI Applications: §Test160eGUI1C# §Test160eGUI2C#

44 44 Demo Programs: Group name:Test160eGUI1 GUI Applications: §Test160eGUI1Java §Test160eGUI2Java

45 45 Java Demo Programs: GUI Applications: Pure empty frame displayed §PureFrame.java

46 46 Java Demo Programs: GUI Applications: Frame includes: 3 labels, 3 text boxes, 2 buttons §Proben14.java

47 47 Demo Programs: JAVA Applets:

48 48 Demo Programs: Group name:Test160eGUI3 GUI Applications: Java Applets §Test160eGUI3Java

49 49 Demo Programs: Applets: Pure empty frame displayed using AppletViewer utility §WelcomeApplet.java

50 50 Demo Programs: Applets: Pure empty frame displayed using Web browser utility §WelcomeApplet.java §WelcomeApplet.html

51 51 Demo Programs: Applets: Frame includes 2 labels, 2 textfields and displayed using AppletViewer utility §TempConvertApplet.java

52 52 Demo Programs: Applets: Frame includes 2 labels, 2 textfields and displayed using Web browser utility §TempConvertApplet.java §TempConvertApplet.html

53 53 Thank You For Your Attention!

54 54 Java Programming, Fifth Edition54 Introducing Applets § Applets l Java programs called from within another application l Frequently run from a Web page l Display as rectangular area l Can respond to user-initiated events Behaviors come from Java class named JApplet

55 55 Java Programming, Fifth Edition55 Introducing Applets (continued) § Similar to Java application l.java file extension Compile into bytecode using the javac command l Saved with.class extension l Can contain: Methods you define Variables and constants Decisions, loops, and arrays GUI elements

56 56 Introducing Applets (continued) §Different from a Java application Descend from the JApplet class l Run from another application Do not use the java command to execute an applet Do not contain a main() method l Do not set a default close operation l Cannot delete, read, or create files on the user’s system l Cannot run any other program on the user’s system Java Programming, Fifth Edition56

57 57 Understanding the JApplet Class  Import JApplet l import javax.swing.JApplet; §JApplet Swing class §Skeletal structure of a typical Applet Java Programming, Fifth Edition57 import java.awt.Graphics; import javax.swing.JApplet; public class WelcomeApplet extends JApplet { }

58 58 Running an Applet §Run applet from a document usually in HTML §HTML, or Hypertext Markup Language l Simple language used to create Web pages for the Internet l Contains many commands §Run an applet l In a Web browser l Applet Viewer appletviewer command Java Programming, Fifth Edition58

59 59 Java Programming, Fifth Edition59 Writing an HTML Document to Host an Applet §When you create an applet l Write applet in Java Save with. java file extension Compile applet into bytecode using javac command l Write HTML document Includes statement to call compiled Java class l Load HTML document into a Web browser Or run Applet Viewer program

60 60 Java Programming, Fifth Edition60 Writing an HTML Document to Host an Applet (continued) §Web browser l Program allows display of HTML documents l Often contains Java applets §Untrusted code l Carries possibility of doing harm l Applet code not trusted §Sandbox l Safe area in which applet code can run

61 61 Java Programming, Fifth Edition61 Writing an HTML Document to Host an Applet (continued) §Run applet from within HTML document §Three object tag attributes l code Name of compiled applet l width l height

62 62 Java Programming, Fifth Edition62 Writing an HTML Document to Host an Applet (continued) §Pixels l Control size of applet Set with width and height l Tiny dots of light Make up image on video monitor  Tag set and Use instead of tag Better to use tag

63 63 Java Programming, Fifth Edition63 Creating a JApplet Containing an init() Method  JApplet class methods l Invoked by Web browser when browser runs applet l public void init() l public void start() l public void paint() l public void stop() l public void destroy()

64 64 Creating a JApplet Containing an init() Method (continued) Java Programming, Fifth Edition64

65 65 Java Programming, Fifth Edition65 Understanding the JApplet Life Cycle §Applets are popular l Easy to use in Web pages  JApplet class l Contains methods automatically called by browser init() start() stop() destroy()

66 66 Java Programming, Fifth Edition66 Understanding the JApplet Life Cycle (continued)  init() method Executes when Web page containing a JApplet loaded Or when running appletviewer command  start() method Executes after init() method l Executes again every time applet becomes active after it has been inactive

67 67 Java Programming, Fifth Edition67 Understanding the JApplet Life Cycle (continued)  stop() method l Invoked when user leaves Web page  destroy() method l Called when user closes browser or Applet Viewer Releases any resources JApplet might have allocated  Every JApplet has the same life cycle outline

68 68 Understanding the JApplet Life Cycle (continued) Java Programming, Fifth Edition68

69 69Java Programming: From Problem Analysis to Program Design, 4e69 Differences Between Applets and GUI Applications §Applets l Class extends JApplet l No main method l Uses init method l Displayed by HTML l Sets title in HTML l Size set in HTML l Applet closes when HTML doc closes §GUI applications l class extends JFrame l Invokes main method l Uses constructors l Uses method setVisible l Uses setTitle method l Uses method setSize l Closes with Exit button


Download ppt "1 INF160 IS Development Environments AUBG, COS dept Lecture 04 Title: Computer Applications (Extract from Syllabus)"

Similar presentations


Ads by Google