BCA Semester 6 – Advanced Java Programming – Unit 1: GUI Programming (12Hrs)
Comprehensive questions and detailed answers for Unit 1: GUI Programming (12Hrs). Perfect for exam preparation and concept clarity.
Why do we need a top-level container like JFrame to write Java programs with GUI? How can we display two-dimensional objects in Java?
Explain JTextField and JTextArea components of the Java Swing library.
Write a GUI application to find the sum and difference of two integer numbers. Use two text fields for input and a third text field for output. Your program should display the sum if the user presses the mouse and the difference if the user releases the mouse.
Why do we use Panels while creating GUI applications in Java? Explain the components of the event handling model in Java.
What are adapter classes? What is the benefit of using adapter classes in Java while creating events in GUI programs? Explain with an example.
Write short notes on (Any Two):
a) 2D shapes in swing
b) MouseEvent and MouseListener
c) Session tracking
Why do we need to use Layout managers while creating GUI application in Java? Explain the key interfaces required to develop any database application using Java. Also, write a program to display the records from the table Students who have got distinction and have a major subject Data science. Assume that the Student table is in the database College and contains the columns Rollno, Name, Level, Division and Major.
What is the role of Event Listener in event handling? List different event listeners provided by Java.
What is KeyEvent? Explain with a proper example.
Write short notes on (any two):
a) Adapter classes
b) CORBA
c) Life cycle of a servlet
How a frame can be created in Java? Explain. Write a program to create a GUI application in Java that identifies the smaller and greater number between two input numbers taken through two text fields and displays the result in a label. If the user presses the mouse it should display the smaller number and if the user releases the mouse it should display the greater number.
What is the use of WindowEvent? List different methods of WindowListener interface with its uses.
How can you display images in GUI using Java? Explain.
Write short notes on (Any two):
a) JMenuBar
b) Session handling in Servlet
c) Marshalling and Unmarshalling of arguments in RMI
Sample Questions
Explain JTextField and JTextArea components of the Java Swing library.
Write a GUI application to find the sum and difference of two integer numbers. Use two text fields for input and a third text field for output. Your program should display the sum if the user presses
Why do we use Panels while creating GUI applications in Java? Explain the components of the event handling model in Java.
What are adapter classes? What is the benefit of using adapter classes in Java while creating events in GUI programs? Explain with an example.
And more questions available on this page.