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
-
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?
-
Apple Inc., under the leadership of Steve Jobs, has been a huge success over the past few years, with new products such as iPhone and iPad received enthusiastically by consumers. The firm's stock...
-
Find the area between the curve y = 1 / x 2 and the x-axis and between x = 1 and x = 3.
-
A large company has the opportunity to select one of seven projects-A, B, C, D, E, F, G-or choose the null (donothing) alternative. Each project requires a single initial investment as shown in the...
-
Gator Co. invested $1,000,000 in Demo Co. for 25% of its outstanding stock. Demo Co. pays out 40% of net income in dividends each year.InstructionsUse the information in the following T-account for...
-
You have been assigned to develop a data warehouse for a credit card company.The data source for the data warehouse will be a relational database consisting of four tables as specified below: Account...
-
The owner of Blue Ridge Hot Tubs, Howie Jones, has asked for your assistance in analyzing how the feasible region and solution to his production problem might change in response to changes in various...
-
The personnel manager of a firm wants to compare the job satisfaction level of the employees among the firms Finance, Purchase, and Sales departments. A battery of questions are administered to...
-
During 2012, Starbucks Coffees common stock had been selling for between $30 and $60. Its most recent earnings per share was $1.73, and the firm was expected to pay a dividend of $0.68. The companys...
-
Determine whether the geometric series is convergent or divergent. 20(0.55)n-1 n = 1 convergent Odivergent If it is convergent, find its sum. (If the quantity diverges, enter DIVERGES.) Need Help?...
-
Suppose you wish to buy a house costing $200,000. You will put a down payment of 20% of the purchase price and borrow the rest from a bank for 30 years at a fixed rate r compounded monthly. If you...
-
Three former college classmates decided to open a store near campus to sell wireless equipment to students. They created a public company, The Wire, and issued stock to interested investors. They...
-
You have two investments that have positive net present values and are financially feasible. Your boss wants you to make a recommendation on which one of the two to invest in given different useful...
-
Are a communitys expectations from schools realistic ? Justify
-
Consider the following cash flows in Table P5.5. (a) Calculate the payback period for each project. (b) Determine whether it is meaningful to calculate a payback period for project D. (c) Assuming...
-
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...
-
Draw a block diagram for the feedback control of a liquid-level system, which consists of a valve with a control knob (0\%-100\%) and a liquid-level sensor. Clearly label essential components and...
-
A control system is represented using the block diagram shown in Figure 10.59. Sketch the root locus with respect to the proportional control gain K. Determine all the values of \(K\) for which the...
-
Roughly sketch the root locus with respect to \(K\) for the equation of \(1+K L(s)=0\) and the following choices for \(L(s)\). Make sure to give the asymptotes, arrival or departure angles, and...
Organizational Behaviour And Work A Critical Introduction 2nd Edition - ISBN: 0199261415 - Free Book
Study smarter with the SolutionInn App