Вы находитесь на странице: 1из 2

1.

a) Write a program that reads two numbers from the user to perform integer division into
Num1 and Num2 variables. The division of Num1 and Num2 is displayed if they are
integers. If Num1 or Num2 were not an integer, the program would throw a Number
Format Exception. If Num2 were Zero, the program would throw an Arithmetic
Exception
b) Create an applet which contains two buttons. On click of a button, it should open a
frame. On click of second button, it should close the frame. The frame should contain a
login UI containing username and password.

2. a) Create a user defined exception.


b) Create an applet which contains three scrollbars. First scrollbar represents x-coordinate
axis, second scrollbar represents y-coordinate axis and third scrollbar is used for
increasing and decreasing the font size. A string is drawn on the applet and the above
three scrollbars should work on the string.

3. a) Write a program that creates 3 threads by extending Thread class. First thread displays
“Good Morning” every 1 sec, the second thread displays “Hello” every 2 seconds and the
third displays Welcome” every 3 seconds.
b) Create a frame which contains a button, textfield and three dropdowns. First dropdown
gives font-name, second dropdown gives font-style and third dropdown gives font-size.
On click of a button, the text in textfield is displayed on the frame taking its attributes
from the three dropdowns.

4. a) Write a program that correctly implements Producer Consumer problem using the
concept of Inter Thread Communication.
b) Write an Applet program to create a login window.

5. A) Develop an applet that receives an integer in one text field, and computes its factorial
Value and returns it in another text field, when the button named “Compute” is clicked.
B) Write a program to illustrate the following using Card Layout. The container has 5
buttons. The click on the buttons behaves in the following order.
1-> 3->4-> 5 ->2->3->1

6. A) Write a program that implements a simple client/server application. The client sends
data to a server. The server receives the data, uses it to produce a result, and then sends
the result back to the client. The client displays the result on the console.
B) Simulate traffic lights using threads.
7. A) Write a program that allows user to draw lines, rectangles and ovals (any one at a
time) with the location and size specified using mouse.
B) Write a JAVA program to retrieve the IP address of the system.
8. A) Write a program that illustrates all AWT controls.
B) From program (A) track the final status of all the AWT controls into the textarea,
when any event happens in the container.

9. A) Write a program to create a User Interface for a simple calculator. Use a grid layout to
arrange buttons for the digits and for the+, - ,*, % operations. Add a text field to display
the result.
B) Using program (A), activate the calculator to perform the calculations.

10. A) Write a program that simulates a traffic light. The program lets the user select one of
three lights: red, yellow, or green. When a radio button is selected, the light is turned on,
and only one light can be on at a time No light is on when the program starts
B) Write a simple client server program using User Interface for both client and the
server so that they perform chatting.

11. A) Write a program for handling mouse events with adapter classes.
B) Write a program to illustrate the use of URL class.

Вам также может понравиться