File Edit View Navigate Code Refactor Build Run Tools Git Window Help lab-10-gui-lists-ug2057pz Lab 10 Questions.md...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
File Edit View Navigate Code Refactor Build Run Tools Git Window Help lab-10-gui-lists-ug2057pz Lab 10 Questions.md Project O Commit Pull Requests Structure AGGIH~~~NAMNHS 55 G F G F FFGDN Bookmarks 17 18 19 20 21 22 23 24 25 26 | 28 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 MD Main.java X Storage.java Lab 10 Questions.md X ## Task 1: Set up JList Models MD The GUI has two JLists - one for the names of places the user wishes to go to `wishList`, and names of places the user has visited, `visitedList`. These JLists should be lists of Strings. Add the generic type to the two JLists in `WishlistGUI.java` Create and assign a DefaultListModel of Strings for both lists. ## Task 2: Add a new place Add an event listener to the `addButton` JButton. When this button is clicked, read the text entered in `newPlaceNameTextField`. Java_Auto_Grader_10 - Lab 10 Questions.md Add Configuration... If the text is blank for example, empty, or just spaces, then don't do anything. Don't add anything to the `wishList`. If the text is not blank, add the new place to the wishlist model, to add it to the `wishList` JList. Clear the text in newPlace NameTextField`. E**Important!** You must use the `showMessageDialog` method to show a message dialog or the tests will fail. ## Task 3: Marking a place visited Visited! Delete The program should not accept duplicate names. If the place name is already in the `wishList`, then display an alert dialog using the `showMessageDialog` method provided f For this program, you can assume two place names in different cases are the same place. So your program should NOT permit "new york" if "New York" is already in the list. Add a JPopupMenu to the `wishList`. It will have two menu items with this text, Git: The JMenuItems should have the exact text "Visited!" and "Delete". When the user right-clicks on a place and selects "Visited!" the place should be removed from the `wishList` and added to the `visitedList`. TODO Problems Terminal Profiler Dependencies Git Download pre-built shared indexes: Reduce the indexing time and CPU load with pre-built JDK and Maven library shared indexes // Alwa... (39 minutes ago) 58F Cloudy Build > 104:33 CRLF UTF-8 4 spaces main 4:58 PM 5/6/2022 1 Event Log X 2 Database Maven File Edit View Navigate Code Refactor Build Run Tools Git Window Help lab-10-gui-lists-ug2057pz Lab 10 Questions.md Project O Commit Pull Requests K H. Structure > Bookmarks 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 MD MD Main.java X Storage.java Lab 10 Questions.md X ## Task 6: Saving to files Add an event listener to `saveQuitButton` JButton. Add an event handler to the `saveQuitButton` JButton. 58F Cloudy When this button is clicked, call the `Main.quit()` method with a list of places in the `wishList` and a list of places in the `visitedList`. `Main.quit()` expects two lists of Strings as arguments. You'll need to build these lists (for example, ArrayList or LinkedList) of wish list and visited place names. Next, in your `saveQuitButton` event handler in the GUI, call `dispose()` to close the GUI window and end the program. In Storage.java, finish the `writeListToFile` method. Main's `quit` method calls `writeListToFile` once for each list. In `Storage.writeListToFile` write the list of String places to a file, one String per line. Write the lines in the same order as they are displayed in the JList. Overwrite the data in any existing files. Java_Auto_Grader_10 - Lab 10 Questions.md Add Configuration... Use the try-with-resources style of exception handling. The Storage.java `writeListToFile` method should NOT declare it throws any exceptions. ## Task 7: Loading Saved Places Finish the `readListFromFile` method in Storage.java. This method is called by the main method when the program is launched. Write code to read all the Strings from the file given by the filename argument. Add each String to a List, and return the List. Use the try-with-resources style of exception handling. The Storage.java `writeListToFile` method should NOT declare it throws any exceptions. Git: Git TODO Problems Terminal Profiler Dependencies Download pre-built shared indexes: Reduce the indexing time and CPU load with pre-built JDK and Maven library shared indexes // Always ... (44 minutes ago) Build If the filename is not found, or if there are any other IOException thrown, return an empty list. This will allow your program to work with no errors if one or both of the > In WishListGUI.java, the constructor is called with a list of `wishListPlaces`, and a list of `visitedPlaces`. In the constructor, use these lists to add places to the W So, when the program starts, it will read lists of places from file. It will display places read from file in the JLists. When user saves and quits, all the places in the X 70:1 CRLF UTF-8 4 spaces main 5:03 PM 5/6/2022 1 Event Log 2 Database Maven File Edit View Navigate Code Refactor Build Run Iools Git Window Help lab-10-gui-lists-ug2057pz Lab 10 Questions.md Project Commit Pull Requests H. Structure Bookmarks 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 MD Main.java X Storage.java Lab 10 Questions.md X The JMenuItems should have the exact text "Visited!" and "Delete". MD ## Task 4: Deleting a WishList Place When the user right-clicks on a place and selects "Visited!" the place should be removed from the `wishList` and added to the `visitedList`. You added a JPopupMenu for the `wishList` for Task 3. For this task, implement the Delete menu item. When the user right-clicks and selects "Delete" from the menu, remove the place from the `wishList`. Do not show any dialogs, or ask for confirmation. Just remove the place from the `wishlist`. ## Task 5: Deleting a Visited Place Add a JPopupMenu to the `visitedList`. This menu has one item Delete Java_Auto_Grader_10 - Lab 10 Questions.md Add Configuration... Use this exact text for the JMenuItem. When the user right-clicks and selects "Delete" from the menu, remove the place from the `visitedList`. Do not show any dialogs, or ask for confirmation. Just remove the place from the `visitedList`. ## Task 6: Saving to files Add an event listener to `sa QuitButton` JButton. Add an event handler to the `saveQuitButton` JButton. Git: TODO Problems Terminal Profiler Build Dependencies Git Download pre-built shared indexes: Reduce the indexing time and CPU load with pre-built JDK and Maven library shared indexes // Always ... (47 minutes ago) 58F Cloudy 5 70:1 CRLF UTF-8_4 spaces & main I 1 Event Log 5:06 PM 5/6/2022 > X 2 Database Maven File Edit View Navigate Code Refactor Build Run Tools Git Window Help lab-10-gui-lists-ug2057pz Lab 10 Questions.md Project O Commit Pull Requests Structure AGGIH~~~NAMNHS 55 G F G F FFGDN Bookmarks 17 18 19 20 21 22 23 24 25 26 | 28 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 MD Main.java X Storage.java Lab 10 Questions.md X ## Task 1: Set up JList Models MD The GUI has two JLists - one for the names of places the user wishes to go to `wishList`, and names of places the user has visited, `visitedList`. These JLists should be lists of Strings. Add the generic type to the two JLists in `WishlistGUI.java` Create and assign a DefaultListModel of Strings for both lists. ## Task 2: Add a new place Add an event listener to the `addButton` JButton. When this button is clicked, read the text entered in `newPlaceNameTextField`. Java_Auto_Grader_10 - Lab 10 Questions.md Add Configuration... If the text is blank for example, empty, or just spaces, then don't do anything. Don't add anything to the `wishList`. If the text is not blank, add the new place to the wishlist model, to add it to the `wishList` JList. Clear the text in newPlace NameTextField`. E**Important!** You must use the `showMessageDialog` method to show a message dialog or the tests will fail. ## Task 3: Marking a place visited Visited! Delete The program should not accept duplicate names. If the place name is already in the `wishList`, then display an alert dialog using the `showMessageDialog` method provided f For this program, you can assume two place names in different cases are the same place. So your program should NOT permit "new york" if "New York" is already in the list. Add a JPopupMenu to the `wishList`. It will have two menu items with this text, Git: The JMenuItems should have the exact text "Visited!" and "Delete". When the user right-clicks on a place and selects "Visited!" the place should be removed from the `wishList` and added to the `visitedList`. TODO Problems Terminal Profiler Dependencies Git Download pre-built shared indexes: Reduce the indexing time and CPU load with pre-built JDK and Maven library shared indexes // Alwa... (39 minutes ago) 58F Cloudy Build > 104:33 CRLF UTF-8 4 spaces main 4:58 PM 5/6/2022 1 Event Log X 2 Database Maven File Edit View Navigate Code Refactor Build Run Tools Git Window Help lab-10-gui-lists-ug2057pz Lab 10 Questions.md Project O Commit Pull Requests Structure AGGIH~~~NAMNHS 55 G F G F FFGDN Bookmarks 17 18 19 20 21 22 23 24 25 26 | 28 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 MD Main.java X Storage.java Lab 10 Questions.md X ## Task 1: Set up JList Models MD The GUI has two JLists - one for the names of places the user wishes to go to `wishList`, and names of places the user has visited, `visitedList`. These JLists should be lists of Strings. Add the generic type to the two JLists in `WishlistGUI.java` Create and assign a DefaultListModel of Strings for both lists. ## Task 2: Add a new place Add an event listener to the `addButton` JButton. When this button is clicked, read the text entered in `newPlaceNameTextField`. Java_Auto_Grader_10 - Lab 10 Questions.md Add Configuration... If the text is blank for example, empty, or just spaces, then don't do anything. Don't add anything to the `wishList`. If the text is not blank, add the new place to the wishlist model, to add it to the `wishList` JList. Clear the text in newPlace NameTextField`. E**Important!** You must use the `showMessageDialog` method to show a message dialog or the tests will fail. ## Task 3: Marking a place visited Visited! Delete The program should not accept duplicate names. If the place name is already in the `wishList`, then display an alert dialog using the `showMessageDialog` method provided f For this program, you can assume two place names in different cases are the same place. So your program should NOT permit "new york" if "New York" is already in the list. Add a JPopupMenu to the `wishList`. It will have two menu items with this text, Git: The JMenuItems should have the exact text "Visited!" and "Delete". When the user right-clicks on a place and selects "Visited!" the place should be removed from the `wishList` and added to the `visitedList`. TODO Problems Terminal Profiler Dependencies Git Download pre-built shared indexes: Reduce the indexing time and CPU load with pre-built JDK and Maven library shared indexes // Alwa... (39 minutes ago) 58F Cloudy Build > 104:33 CRLF UTF-8 4 spaces main 4:58 PM 5/6/2022 1 Event Log X 2 Database Maven File Edit View Navigate Code Refactor Build Run Tools Git Window Help lab-10-gui-lists-ug2057pz Lab 10 Questions.md Project O Commit Pull Requests K H. Structure > Bookmarks 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 MD MD Main.java X Storage.java Lab 10 Questions.md X ## Task 6: Saving to files Add an event listener to `saveQuitButton` JButton. Add an event handler to the `saveQuitButton` JButton. 58F Cloudy When this button is clicked, call the `Main.quit()` method with a list of places in the `wishList` and a list of places in the `visitedList`. `Main.quit()` expects two lists of Strings as arguments. You'll need to build these lists (for example, ArrayList or LinkedList) of wish list and visited place names. Next, in your `saveQuitButton` event handler in the GUI, call `dispose()` to close the GUI window and end the program. In Storage.java, finish the `writeListToFile` method. Main's `quit` method calls `writeListToFile` once for each list. In `Storage.writeListToFile` write the list of String places to a file, one String per line. Write the lines in the same order as they are displayed in the JList. Overwrite the data in any existing files. Java_Auto_Grader_10 - Lab 10 Questions.md Add Configuration... Use the try-with-resources style of exception handling. The Storage.java `writeListToFile` method should NOT declare it throws any exceptions. ## Task 7: Loading Saved Places Finish the `readListFromFile` method in Storage.java. This method is called by the main method when the program is launched. Write code to read all the Strings from the file given by the filename argument. Add each String to a List, and return the List. Use the try-with-resources style of exception handling. The Storage.java `writeListToFile` method should NOT declare it throws any exceptions. Git: Git TODO Problems Terminal Profiler Dependencies Download pre-built shared indexes: Reduce the indexing time and CPU load with pre-built JDK and Maven library shared indexes // Always ... (44 minutes ago) Build If the filename is not found, or if there are any other IOException thrown, return an empty list. This will allow your program to work with no errors if one or both of the > In WishListGUI.java, the constructor is called with a list of `wishListPlaces`, and a list of `visitedPlaces`. In the constructor, use these lists to add places to the W So, when the program starts, it will read lists of places from file. It will display places read from file in the JLists. When user saves and quits, all the places in the X 70:1 CRLF UTF-8 4 spaces main 5:03 PM 5/6/2022 1 Event Log 2 Database Maven File Edit View Navigate Code Refactor Build Run Tools Git Window Help lab-10-gui-lists-ug2057pz Lab 10 Questions.md Project O Commit Pull Requests K H. Structure > Bookmarks 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 MD MD Main.java X Storage.java Lab 10 Questions.md X ## Task 6: Saving to files Add an event listener to `saveQuitButton` JButton. Add an event handler to the `saveQuitButton` JButton. 58F Cloudy When this button is clicked, call the `Main.quit()` method with a list of places in the `wishList` and a list of places in the `visitedList`. `Main.quit()` expects two lists of Strings as arguments. You'll need to build these lists (for example, ArrayList or LinkedList) of wish list and visited place names. Next, in your `saveQuitButton` event handler in the GUI, call `dispose()` to close the GUI window and end the program. In Storage.java, finish the `writeListToFile` method. Main's `quit` method calls `writeListToFile` once for each list. In `Storage.writeListToFile` write the list of String places to a file, one String per line. Write the lines in the same order as they are displayed in the JList. Overwrite the data in any existing files. Java_Auto_Grader_10 - Lab 10 Questions.md Add Configuration... Use the try-with-resources style of exception handling. The Storage.java `writeListToFile` method should NOT declare it throws any exceptions. ## Task 7: Loading Saved Places Finish the `readListFromFile` method in Storage.java. This method is called by the main method when the program is launched. Write code to read all the Strings from the file given by the filename argument. Add each String to a List, and return the List. Use the try-with-resources style of exception handling. The Storage.java `writeListToFile` method should NOT declare it throws any exceptions. Git: Git TODO Problems Terminal Profiler Dependencies Download pre-built shared indexes: Reduce the indexing time and CPU load with pre-built JDK and Maven library shared indexes // Always ... (44 minutes ago) Build If the filename is not found, or if there are any other IOException thrown, return an empty list. This will allow your program to work with no errors if one or both of the > In WishListGUI.java, the constructor is called with a list of `wishListPlaces`, and a list of `visitedPlaces`. In the constructor, use these lists to add places to the W So, when the program starts, it will read lists of places from file. It will display places read from file in the JLists. When user saves and quits, all the places in the X 70:1 CRLF UTF-8 4 spaces main 5:03 PM 5/6/2022 1 Event Log 2 Database Maven File Edit View Navigate Code Refactor Build Run Iools Git Window Help lab-10-gui-lists-ug2057pz Lab 10 Questions.md Project Commit Pull Requests H. Structure Bookmarks 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 MD Main.java X Storage.java Lab 10 Questions.md X The JMenuItems should have the exact text "Visited!" and "Delete". MD ## Task 4: Deleting a WishList Place When the user right-clicks on a place and selects "Visited!" the place should be removed from the `wishList` and added to the `visitedList`. You added a JPopupMenu for the `wishList` for Task 3. For this task, implement the Delete menu item. When the user right-clicks and selects "Delete" from the menu, remove the place from the `wishList`. Do not show any dialogs, or ask for confirmation. Just remove the place from the `wishlist`. ## Task 5: Deleting a Visited Place Add a JPopupMenu to the `visitedList`. This menu has one item Delete Java_Auto_Grader_10 - Lab 10 Questions.md Add Configuration... Use this exact text for the JMenuItem. When the user right-clicks and selects "Delete" from the menu, remove the place from the `visitedList`. Do not show any dialogs, or ask for confirmation. Just remove the place from the `visitedList`. ## Task 6: Saving to files Add an event listener to `sa QuitButton` JButton. Add an event handler to the `saveQuitButton` JButton. Git: TODO Problems Terminal Profiler Build Dependencies Git Download pre-built shared indexes: Reduce the indexing time and CPU load with pre-built JDK and Maven library shared indexes // Always ... (47 minutes ago) 58F Cloudy 5 70:1 CRLF UTF-8_4 spaces & main I 1 Event Log 5:06 PM 5/6/2022 > X 2 Database Maven File Edit View Navigate Code Refactor Build Run Iools Git Window Help lab-10-gui-lists-ug2057pz Lab 10 Questions.md Project Commit Pull Requests H. Structure Bookmarks 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 MD Main.java X Storage.java Lab 10 Questions.md X The JMenuItems should have the exact text "Visited!" and "Delete". MD ## Task 4: Deleting a WishList Place When the user right-clicks on a place and selects "Visited!" the place should be removed from the `wishList` and added to the `visitedList`. You added a JPopupMenu for the `wishList` for Task 3. For this task, implement the Delete menu item. When the user right-clicks and selects "Delete" from the menu, remove the place from the `wishList`. Do not show any dialogs, or ask for confirmation. Just remove the place from the `wishlist`. ## Task 5: Deleting a Visited Place Add a JPopupMenu to the `visitedList`. This menu has one item Delete Java_Auto_Grader_10 - Lab 10 Questions.md Add Configuration... Use this exact text for the JMenuItem. When the user right-clicks and selects "Delete" from the menu, remove the place from the `visitedList`. Do not show any dialogs, or ask for confirmation. Just remove the place from the `visitedList`. ## Task 6: Saving to files Add an event listener to `sa QuitButton` JButton. Add an event handler to the `saveQuitButton` JButton. Git: TODO Problems Terminal Profiler Build Dependencies Git Download pre-built shared indexes: Reduce the indexing time and CPU load with pre-built JDK and Maven library shared indexes // Always ... (47 minutes ago) 58F Cloudy 5 70:1 CRLF UTF-8_4 spaces & main I 1 Event Log 5:06 PM 5/6/2022 > X 2 Database Maven
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
(20 points)Write a program that prompts the user to input five decimal numbers. The program should then add the five decimal numbers, convert the sum to the nearest integer, and print the result....
-
Ayayai Company prepares its statement of cash flows using the direct method for operating activities. For the year ended December 31, 2024, Ayayai Company reports the following: Sales on account...
-
What is the cofactor of an entry of a matrix? How are cofactors used to find the determinant of the matrix?
-
Following are condensed income statements for Uncle Bill's Home Improvement Center for the years ended December 31, 2017 and 2016: Uncle Bill was concerned about the operating results for 2017 and...
-
On September 14, 2022, Jay purchased a passenger automobile that is used 75 percent in his business. The automobile has a basis for depreciation purposes of $48,000, and Jay uses the accelerated...
-
Identify each of the following as an example of a perceived pressure (P), perceived opportunity (O), or rationalization (R) in the fraud triangle: 1. Job dissatisfaction 2. Greed. 3. "It's for a good...
-
The popularity of Southwestern University's football program under its new coach Phil Flamm surged in each of the 5 years since his arrival at the Stephenville, Texas, college. (See Southwestern...
-
We have the following information about five different shares: Shares: 1. expected return: 5% standard deviation for return: 10% 2. expected return: 10% standard deviation for return: 20% 3. expected...
-
The bar codes above represent locations in a warehouse. How many units would be left in each location? If you picked 250 units from location 00000113774360000 If you picked 250 units from location 00...
-
Hannaford Enterprises reported earnings before interest, taxes, depreciation and amortization (EBITDA) of $ 500 million in 2017. The firm had depreciation of $80 million and reported capital...
-
Update Knowledge of the Events Industry. ASSESSMENT INSTRUCTIONS While being observed by your assessor, you are to use information identified and opportunities to update knowledge of the events...
-
C. Write C++ code for a while loop that reads positive integers and computes their sum. It stops when the sum reaches the value of 50 or more. Once the loop stops, the number of integers read will be...
-
A woman is standing at a railroad crossing for a track that runs east and west. As she faces the track, east is to her right and west is to her left. Two trains on the track some distance apart are...
-
how do you download the program? name = input('What is your name? ') age = int(input('How old are you? ')) from datetime import datetime current_year = datetime.now().year birth_year = current_year -...
-
Melissa Jones is nurse manager of a 40-bed, long-term care unit that is essentially a small nursing home contained within Community Hospital. The unit is almost always fully occupied. A number of the...
-
Your forensic laboratory came up with three new sets of features for discriminating between items in a population of interest: these three sets of features are called Set of Features 1, Set of...
-
A 20-cm-square vertical plate is heated to a temperature of 30oC and submerged in glycerin at 10oC. Calculate the heat lost from both sides of the plate.
-
On September 14, 2012, Jay purchased a passenger automobile that is used 75 percent in his accounting business. The automobile has a basis for depreciation purposes of $35,000, and Jay uses the...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Frank, age 35, and Joyce, age 34, are married and file a joint income tax return for 2012. Their salaries for the year total $83,000 and they have taxable interest income of $4,000. They have no...
-
__________________ and __________________ are lowered to increase the camber of the wings and provide greater lift and control at slow speeds.
-
If the failure of a structure causes a loss of control of the aircraft or leads to a catastrophic structural collapse, the structure is classified as __________________ structure.
-
Wing sweepback is designed to delay or alleviate shock induced separation of airflow and improves aerodynamic performance.
Study smarter with the SolutionInn App