Professional Documents
Culture Documents
Page 1 of 3
SECTION A: (THIS SECTION IS COMPULSORY) (40 MARKS)
1.1 Demonstrate your understanding of Action Event listeners, Layouts and other swing
components by creating jframe form with three buttons, a textfield and a label namely
counter. If one clicks counting up button the textfield should count up on every click. If
you click counting down it will start counting down from where the other button left. It
should also set the texfield to zero if reset is clicked as shown from Fig 1.1 below:
Fig 1.1
NB. All swing components and listeners are added manually. Do not use drag and drop on
this question otherwise marks will be heavily deducted. This applies to this question only
(40)
2.1 Using MySQL create database Members with a table memberData of a newly created
stokvel. The organiser should be able to enter member information such as (Name,
Surname, DateOfBirth, ID andContact number) of the members.
Using Java, create frame that will be used to enter member information. The Frame should
have a button and textfields. Each textfield should have a label. You should also be able to
delete a member from the database. Hence the frame should have two panels separating
insertion and deletion of members
Note: you can use drag and drop to create frames (30)
3.1 Write a Socket-based Java tcp client-server in which the sever program responds to client
messages as follows: When it receives a message from a client, it simply converts the
message into all uppercase letters and sends back the same to the client. Write both client
and server programs demonstrating this. Use a textfield to enter the message and a
textarea to display the message from the server and a button to send.
Page 2 of 3
QUESTION FOUR (30 MARKS)
4.1 Write a java program to accept the details of Teacher (TId, Name, Address) from the user
and insert it into the Database using servlets and jsp or html. The program should the able
to pop up a message “successfully added” when the details are added. (30)
TOTAL: 100 MARKS
Page 3 of 3