0% found this document useful (0 votes)
73 views

Java Swing Checklist Exercise

The document provides requirements for developing a Java Swing checklist application. It specifies that the application should allow users to add items to a checklist using a text field and button, mark items as complete using checkboxes, and clear completed items with another button. Layout managers should be used to organize the GUI components. Basic error handling and bonus challenges of saving, custom rendering, and multiple lists are also outlined.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views

Java Swing Checklist Exercise

The document provides requirements for developing a Java Swing checklist application. It specifies that the application should allow users to add items to a checklist using a text field and button, mark items as complete using checkboxes, and clear completed items with another button. Layout managers should be used to organize the GUI components. Basic error handling and bonus challenges of saving, custom rendering, and multiple lists are also outlined.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Java Swing Checklist Exercise

Objective:

Develop a Java Swing application that provides a checklist functionality. Users should be able to add
items to the checklist, mark items as complete, and clear completed items.

Requirements:

1. Create the Main Frame:

 Use JFrame to create the main window of the application.

2. Add Input Field and Buttons:

 Include a JTextField for entering new checklist items.

 Add a JButton for adding items to the checklist.

 Add another JButton to clear completed items.

3. Checklist Display:

 Use a JList or DefaultListModel to display the checklist items.

 Each item in the checklist should have a checkbox (JCheckBox) to mark it as complete.

4. Adding Items:

 When the user enters text into the JTextField and clicks the add button, the item should
be added to the checklist.

5. Marking Items as Complete:

 Allow users to mark items as complete by checking the corresponding checkbox.

6. Clearing Completed Items:

 When the user clicks the clear button, remove all items that are marked as complete
from the checklist.

7. Layout Management:

 Use layout managers such as BorderLayout and FlowLayout to organize components in


the GUI.

8. Error Handling:

 Include basic error handling, such as not allowing empty items to be added to the
checklist.

Bonus Challenges:
1. Save and Load:
 Implement functionality to save the checklist to a file and load it when the application
starts.

2. Custom Rendering:

 Customize the look of checklist items, perhaps changing the color or font of completed
items.

3. Multiple Lists:

 Allow users to create multiple checklists and switch between them.

You might also like