0% found this document useful (0 votes)
21 views

Lab06 Event Base Progamming (Manual)

Uploaded by

Wasif Abbasi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Lab06 Event Base Progamming (Manual)

Uploaded by

Wasif Abbasi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Lab 06: Event Base Programming

Capital University of Science and Technology Islamabad


Software Engineering Program, Department of Computing
Faculty of Computer Science

Lab Manual for Software Architecture & Design


Lab 06: Event Base Programming

1
Lab 06: Event Base Programming

TABLE OF CONTENTS

1. INTRODUCTION 3

2. RELEVANT LECTURE READING 4

3. ACTIVITY TIME BOXING 4

4. OBJECTIVE OF THE EXPERIMENT 4

5. CONCEPT MAP 4

5.1. Create Project in Netbeans IDE 4

5.2. Create First Java Program 6

5.3. Event Handling 7

6. HOMEWORK BEFORE LAB 9

7. TOOLS AND PROCEDURE. 10

7.1. Tools 10

7.2. Setting up to use Net beans 10

8. WALKTHROUGH TASKS 10

9. PRACTICE TASKS 12

9.1. Practice Task 1 12

9.2. Practice Task 2 16

10. Evaluation Task (Unseen) 12

11. FURTHER READING 12

2
Lab 06: Event Base Programming

Lab 06: Event Base Programming

1. Introduction

The intent of defining architecture is not to be complete, but to cover the breadth of the
organization. Similarly, to how we define software architecture, we can talk about
architectural views of the business. Each of these views contains an architecturally
significant subset of what would be a complete definition. A set of views could be:

1. Business process view—includes and outlines the key business processes of the
business, those that are the reason the business exist.
2. Organization structure view—outlines the key roles and responsibilities in the
business, as well as their grouping.
3. Culture view—expresses a vision of the organization’s culture, and defines the
mechanisms put in place to encourage that culture.
4. Human resource aspects view—discusses the mechanisms put in place to maintain and
develop the skill set of your staff.
5. Domain view (optional)—for organizations that handle a complex set of information, it
is often useful to define key mechanisms and patterns to be applied to those information
structures. In simple cases, this may already be clear from the organization structure
view.

The purposes of business modeling are:

• To understand the structure and the dynamics of the organization in which a system is to
be deployed (the target organization).
• To understand current problems in the target organization and identify improvement
potentials.
• To ensure that customers, end users, and developers have a common understanding of
the target organization.
• To derive the system requirements needed to support the target organization.

To achieve these goals, the business modeling discipline describes how to develop a vision
of the new target organization, and based on this vision define the processes, roles, and
responsibilities of that organization in a business use-case model and a business object
model.

Complementary to these models, the following artifacts are developed:

• Supplementary Business Specification


• Glossary

The business modeling discipline is related to other disciplines, as follows:

3
Lab 06: Event Base Programming

• The Requirements discipline uses business models as an important input to


understanding requirements on the system.
• The Analysis & Design discipline uses business entities as an input to identifying
entity classes in the design model.
• The Environment discipline develops and maintains supporting artifacts, such as
the Business-Modeling Guidelines.

2. Relevant Lecture Reading


https://sceweb.uhcl.edu/helm/RationalUnifiedProcess/

3. Activity Time Boxing

Tas
k Activity Name Activity time Total Time
No.
Setting up to use Enterprise
6.2 30 min 30 min
Architect
6.3 Walkthrough Tasks 65 min 65min
As per time specified for
7 Practice Tasks 45 min
each task
25 min for each assigned
8 Evaluation Task (Unseen) 50 min
task

4. Objective of the Experiment


Before proceeding to the logical design of how the software application will work, it is
important to investigate and define its behavior as black box. System Behavior is the
description of what a system does, without explaining how it does it. One part of
that description is system sequence diagram. In this lab learn about basic concepts of SSD
and how to make this on Enterprise Architecture.

5. Concept Map

5.1. Create Project in Netbeans IDE

Follow given steps to create java project on netbeans.

4
Lab 06: Event Base Programming

5
Lab 06: Event Base Programming

5.2. Create First Java Program

6
Lab 06: Event Base Programming

5.3 Event Handling

Changing the state of an object is known as an event.

o For example, click on button, dragging mouse etc.


o The java.awt.event package provides many event classes and Listener interfaces for
event handling.

Some example of events in java are

o Mouseclicked
o MouseEntered
o MouseExited
o KeyPressed
o Etc.

Example of event handling

1. Create java project in netbeans


2. Create a Jframe class in java solution or package
3. Drag and drop a button and label into Jframe
4. Right click on button and choose

Events->Action->ActionPerformed

5. You can see a function is generated inside code with contents as

6. Create a project as described in start of lab


7. Right click on source package folder and add new package: GUI

7
Lab 06: Event Base Programming

8. Choose Jframe and name it as: MyEventDemoFrame

9. Drag and drop a button and labels into Jframe


a. Name buton as buttonDemo
b. Name label as: labelDemo
c. Double click on button and you will see a newly generated method as:

8
Lab 06: Event Base Programming

d. Write following code inside method and run the program

10. Once program is executed, click on button and output appear as

6. Homework before Lab


It is assumed that the user is both familiar and comfortable with the following prior to
solving practice tasks.
▪ Business glossary
▪ Business rules
▪ Business vision
▪ Business use case Model
▪ Business architecture document
▪ Business object model
▪ Supplementary business specifications
▪ Organization unit
▪ Business actor
▪ Business entity
▪ Business worker
▪ Business use case realization
You should be familiar with above terms before you can start business modeling on any
project. This lab is designed specially to revise all the core and important concepts and
notations of Unified Modeling Language (UML) that are going to be used in business
modeling.

9
Lab 06: Event Base Programming

7. Tools and Procedure.

7.1. Tools
▪ UML 2.0 Notations
▪ Enterprise Architect 12.

8. Walkthrough Tasks
1. Drag and drop a table from swing controller menu
2. Name table as tableItems
3. Populate table from some dummy data
4. Once you click on any row of the table, the content should appear on label
5. Example Prototype

6. Drag and drop a table from swing controller menu


7. Name table as tableItems
8. Populate table from some dummy data
a. Declare DefaultTableModel object (predefined type)
b. Add rows to DefaultTableModel object
c. Add records to DEfaultTableModelObject
d. Make DefaultTableModel object as part of tableItems

10
Lab 06: Event Base Programming

9. Create mouseClick event on table as following

10. Write following code inside mouse click event

11. Run your code and click on any row

11
Lab 06: Event Base Programming

9. Practice Tasks

9.1. Practice Task 1: Repeat the walk through task

9.2. Practice Task 2: Given by instructor during lab

10. Evaluation Task (Unseen)

Given by Teacher in lab

11. Further Reading

12

You might also like