music word's ppt

Upload: dinesh-jain

Post on 05-Apr-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Music Word's PPT

    1/18

  • 7/31/2019 Music Word's PPT

    2/18

    PROJECT DETAIL

    PROJECT NAME : CHAT SERVER

    LANGUAGE : J2SE,jdk1.5

    TOOLS : J CREATER, NOTEPAD++

    MEMBERS : 3

    MENTOR : KAMAL DEEP(Project Coordinator)

  • 7/31/2019 Music Word's PPT

    3/18

    DEPLOYMENT

    BUSINESS LOGIC : JAVA FRAMEWORK,AWT

    GRAPHICS,EVENTHANDLING

    SERVER :LOCALHOST

  • 7/31/2019 Music Word's PPT

    4/18

    It is made completely on JAVA technologies like AWT,Socket Programming, File Handling, etc. AWT is usedhere for the design of the interface i.e. the easy touse n navigate GUI interface. Socket Programming

    used here is for opening the port for data to be writtenby clients (ChatClient.jar) and reading the data (Byother client). File Handling is used here is for storingthe information that are needed in the course of theexecution of data (data.properties, server.properties)

    like proxy details, room details, last login, host details,etc.

    INTRODUCTION :-

  • 7/31/2019 Music Word's PPT

    5/18

    AWTEvent

    Font

    FontMetrics

    Component

    Graphics

    Object Color

    Canvas

    Button

    TextComponent

    Label

    List

    CheckBoxGroup

    CheckBox

    Choice

    Container Panel Applet

    Frame

    Dialog FileDialog

    Window

    TextField

    TextArea

    MenuComponent MenuItem

    MenuBar

    Menu

    Scrollbar

    LayoutManager

    GUI Class Hierarchy (AWT)

  • 7/31/2019 Music Word's PPT

    6/18

    66

    GRAPHICS

    One of the most important features of Java isits ability to draw graphics.

    We can write Java applets that can draw lines,figures of different shapes, images, and text indifferent fonts, styles, and colours.

    Every applet has its own area on the screenknown as canvas, where it creates display.

    Java coordinate system has the origin (0,0) in

    the upper-left corner. Positive x values are tothe right and +ve y values to the bottom. Thevalues of (x,y) are in pixels.

  • 7/31/2019 Music Word's PPT

    7/18

    What is an Event?

    GUI components communicate with the rest ofthe applications through events.

    The source of an event is the component thatcauses that event to occur.

    The listener of an event is an object that

    receives the event and processes itappropriately.

  • 7/31/2019 Music Word's PPT

    8/18

    Handling Events

    Every time the user types a character or clicksthe mouse, an event occurs.

    Any object can be notified of any particularevent.

    To be notified for an event,

    The object has to be registered as an event

    listener on the appropriate event source.

    The object has to implement the appropriateinterface.

  • 7/31/2019 Music Word's PPT

    9/18

    Three Steps of Event Handling

    1 Prepare to accept eventsimport package java.awt.event

    2 Start listening for eventsinclude appropriate methods

    3 Respond to events

    implement appropriate abstract method

  • 7/31/2019 Music Word's PPT

    10/18

    Types of Events Below, are some of the many kinds of

    events, swing components generate.

    Act causing Event Listener Type

    User clicks a button, pressesEnter, typing in text field

    ActionListener

    User closes a frame WindowListener

    Clicking a mouse button, whilethe cursor is over a component

    MouseListener

  • 7/31/2019 Music Word's PPT

    11/18

    Types of Events (contd..)

    Act causing Event Listener Type

    User moving the mouse over acomponent

    MouseMotionListener

    Component becomes visible ComponentListener

    Table or list selection changes ListSelectionListener

  • 7/31/2019 Music Word's PPT

    12/18

    Adapter Classes

    Time consuming to define all interface methods WindowListener has seven methods

    What if we only want to use one?

    Required to define all methods in interface

    Adapter class implements an interface

    Does anyone recognize a design pattern here?

    Default implementation ({ }, empty body) for all methods

    You then extend adapter class,

    overriding methods for events you care about, such as

    windowClosing. Has "is a" relationship with interface

    WindowAdapter is a WindowListener

    MouseAdapter is a MouseListener

  • 7/31/2019 Music Word's PPT

    13/18

    Execute ChatServer.jar.

    Click on StartServer button.

    Server and starting it

  • 7/31/2019 Music Word's PPT

    14/18

    LOGIN

  • 7/31/2019 Music Word's PPT

    15/18

    client application of CHAT SERVER

  • 7/31/2019 Music Word's PPT

    16/18

    THE WAY OF CHATTING

  • 7/31/2019 Music Word's PPT

    17/18

    PRIVATE CHATTING

  • 7/31/2019 Music Word's PPT

    18/18

    SELECT ROOMS