Docsity

Distributed Information Systems Lecture 7 - Practical Lecture6 Java Client, Lecture notes of Database Management Systems (DBMS)

Partial preview of the text

Download Distributed Information Systems Lecture 7 - Practical Lecture6 Java Client and more Lecture notes Database Management Systems (DBMS) in PDF only on Docsity!

Distributed InformationDistributed Information

Systems Systems

Markus A. Wolf & Elena I. Teodorescu^ Markus A. Wolf & Elena I. Teodorescu

Practical Lecture 6

Developing a Java Client

Practical Session Structure^ Practical Session Structure

Introduction

Building a business component

Building an admin GUI

Introducing .NET remoting

Creating a web service and clientwebsite

Developing a Java client

Learning Objectives^ Learning Objectives

  • Understand how to create proxies for a

web service in NetBeans

  • Create a standalone Java application that

makes calls on a web serviceimplemented in .NET, thus demonstratingcross-platform interoperability of webservices

Introduction^ Introduction

  • In this practical session we will:
    • Implement a GUI application that enables a

team leader to log in and see a list of tasksthat the project manager (administrator) hasassigned to them

Creating the Project

  • We will create a new project in NetBeans
    • Start NetBeans– Select

File -> New Project

  • From the

Categories

pane select

General

and

from the

Projects

pane select

Java

Application

Creating a Package

  • NetBeans will create a project structure• Let’s create a package for our application
    • Right-click on the

SourcePackages

folder and

select

New -> Java Package

Adding a JFrame

•^

Let’s add a userinterface file to thepackage^ – Right-click on the

newly created

ptsclient

package and select New -> JFrameForm…

  • Name the class

ClientFrame

and click

Finish

  • Creating the Project /
  • Creating the Project /
  • Adding a JFrame /

ClientFrame Design /

•^

Open the ClientFrame class in Design view

-^

From the

Palette

pane (Swing category) drag

the following controls onto the form:^ – 3 JLabels with text set to

Username, Password

and

Your projects

  • 1 JTextField– 1 JPasswordField– 1 JButton– 1 JTextArea

ClientFrame Design /

•^

Rename theJTextField you addedto

txtUsername

  • Right-click on

jTextField

in the

Inspector pane andselect

Change

Variable Name…

  • Enter

txtUsername

as

the new name

ClientFrame Design /

•^

When completed, the form should look like this:

Functionality

•^

The only functionality we will implement is thatwhen the button is pressed the access detailsare checked and, on successful authentication,the list of projects that the team leader isworking on is displayed

-^

We will have three methods:^ – Event handling method called when the button is

pressed

  • authenticate, which performs the authentication– showProjects, which extracts the project information

and displays in in the text area