17
Department of Computer Science and Engineering Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics Programming Frame No. of Questions : 4 Duration : 10 min 1. Identify the type of interface in the given picture. 2. Identify the Container and Component in the given picture. ANSWER: K2 K3 2 2

Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

  • Upload
    others

  • View
    4

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1

Unit No. & Name : 5& Event Driven Programming

Topic Name : Graphics Programming Frame

No. of Questions : 4 Duration : 10 min

1. Identify the type of interface in the given picture.

2. Identify the Container and Component in the given picture.

ANSWER:

K2

K3

2

2

Page 2: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 2

3. The three software parts of a GUI program are:

A. Windows, Buttons, Mice

B. GUI Components, Graphics, Code

C. GUI Components, Event Listeners, Application Code

D. Frames, Code, Events

4. What is the one component that nearly all GUI programs will have?

A. Frame

B. Mouse

C. Monitor

D. Button

Container:

Component:

ANSWER:

K2

ANSWER:

K1

1

1

Page 3: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 3

Topic Name : Graphics Programming-components

No. of Questions : 4 Duration : 10 min

1. What is a container object in GUI programming?

A. A container is another name for an array or vector.

B. A container is any class that is made up of other classes.

C. A container is a primitive variable that contains the actual data.

D. A container is an object like a Frame that has other GUI components placed inside of it.

2. What is it called when a program is written to respond to the button clicks, menu

selections, and other actions of the user in whatever order the user does them?

A. Event-driven programming.

B. Action-driven programming.

C. User-driven programming.

D. Mouse-driven programming

3. Usually GUI programs are written by using existing software components provided in a

toolkit. The Java toolkit used in this chapter is the:

A. GUI toolkit

B. Abstract Windowing Toolkit

C. Graphics Event Toolkit

D. Java Enhancement Toolkit

ANSWER: K1

ANSWER:

K1

ANSWER:

K1

1

1

1

Page 4: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 4

4. Which is the container that doesn't contain title bar and MenuBars but it can have other

components like button, textfield etc?

A. Window

B. Frame

C. Panel

D. Container

Topic Name : Graphics Programming-Working with 2D-Shapes

No. of Questions : 4 Duration : 10 min

1. Identify the names of 2D shapes in the given picture.

ANSWER:

K1

K2

1

3

Page 5: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 5

2. Which is the container that doesn't contain title bar and MenuBars but it can have other

components like button, textfield etc?

A. Window

B. Frame

C. Panel

D. Container

3. Draw the graphics coordinate system of java sub-windowing system in the display area.

(Hint: starting coordinate, ending coordinate)

4. How many standard colors are provided by the class java.awt.Color.

A. 10

B. 12

C. 13

D. 14

ANSWER:

K2

K3

ANSWER:

K1

1

2

1

Page 6: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 6

Topic Name : Event handling-Event handlers

No. of Questions : 4 Duration : 15 min

1. Find out answer for the given picture.

?

?

EVENT

PRODU

CING

OBJECT

EVENT

HANDLING

OBJECT

ANSWER:

K3

2

Page 7: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 7

2. Identify the type of event handling occurred in the given picture.

ANSWER:

K2

3

Page 8: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 8

3. Write the sequence order of occurrence of event.

ANSWER:

K2

2

Page 9: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 9

4. What is an event in delegation event model used by Java programming language?

A. An event is an object that describes a state change in a source.

B. An event is an object that describes a state change in processing.

C. An event is an object that describes any change by the user and system.

D. An event is a class used for defining object, to create events.

Topic Name : Adapter class-actions

No. of Questions : 4 Duration : 10 min

1. What is a listener in context to event handling?

A. A listener is a variable that is notified when an event occurs.

B. A listener is a object that is notified when an event occurs.

C. A listener is a method that is notified when an event occurs.

D. None of the mentioned.

2. Event class is defined in which of these libraries?

A. java.io

B. java.lang

D. java.net

E. java.util

ANSWER:

K1

ANSWER:

K1

ANSWER:

K2

1

1

1

Page 10: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 10

3. Which of these classes is super class of all the events?

A. EventObject

B. EventClass

C. ActionEvent

D. ItemEvent

4. Which of these events will be notified if scroll bar is manipulated?

A. ActionEvent

B. ComponentEvent

C. AdjustmentEvent

D. WindowEvent

Topic Name : Mouse events-AWT event hierarchy

No. of Questions : 4 Duration : 15 min

1. What is the name of the given hierarchy?

ANSWER:

K1

ANSWER:

K1

K2

1

1

2

Page 11: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 11

2. Compare Java AWT vs Java Swing

Java AWT Java Swing

ANSWER:

K3

4

Page 12: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 12

3. Identify the GUI components involved in the following registration form.

4. What is the relationship between an event-listener interface and an event-adapter class?

ANSWER:

K5

ANSWER: K3

2

2

Page 13: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 13

Topic Name : Introduction to swing-layout management

No. of Questions : 4 Duration : 10 min

1. Write the X and Y coordinate in the given picture?

2. Write the AWT and SWING in the respective place of the given picture.

K2

K2

2

3

Page 14: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 14

3. Which of these events will be notified if scroll bar is manipulated?

A. ActionEvent

B. ComponentEvent

C. AdjustmentEvent

D. WindowEvent

4. Which of these methods are used to register a keyboard event listener?

A. KeyListener()

B. addKistener()

C. addKeyListener()

D. eventKeyboardListener()

Topic Name : Swing Components

No. of Questions : 4 Duration : 10 min

1. Write the name of the given AWT component.

ANSWER:

K1

ANSWER:

K1

K2

1

1

2

Page 15: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 15

2. Write the name of the given AWT component.

3. Write the name of the given AWT component.

K2

K2

Answer

Answer

2

2

Page 16: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 16

4. Write the name of the given AWT component.

Topic Name : Swing Components

No. of Questions : 4 Duration : 10 min

1. Write the name of the given AWT component.

K2

Answer

Answer

Answer

Answer

K2

2

2

Page 17: Unit No. & Name : 5& Event Driven Programming Topic Name ... · Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 1 Unit No. & Name : 5& Event Driven Programming Topic Name : Graphics

Department of Computer Science and Engineering

Workbook /CS8392/SNS COLLEGE OF ENGINEERING Page 17

2. Write the name of the given AWT component.

3. Write the name of the AWT components in the given picture

4. Which of these methods are used to register a mouse motion listener?

A. addMouse()

B. addMouseListener()

C. addMouseMotionListner()

D. eventMouseMotionListener()

Answer

Answer

K2

K1

K2

Answer

2

2

1