Write a java swing program that opens a window


Problem

Write a Java Swing program that opens a window in which any number of snakes move. Each snake has its own length hand moves randomly in one of the four cardinal directions. This direction is maintained as long as the snake's head is up. Every Snake has its own fixed head length. The head length is of course less than or equal to the overall length of the snake. New queues can be created and queues that have already been created can be deleted via a menu. For this purpose, each gets at the production snake a name. When deleting, the names of all snakes are displayed. The selected queue is then deleted. The speed of all snakes should be set using a slider. The simulation should be stopped and restarted via a "Start/Stop" button. The program should be able to be terminated both via a menu item and via the close button of the window. In both cases, a security prompts after exiting. The exact program can be seen in the attached video (see above). The dialogs presented are suggestions, you can use them Implement dialogs differently as long as the presented functionality is available. The following points are included in the evaluation:

1. Your program conforms to the MVC pattern, have you used data structures sensibly, i.e. use doubly linked lists and no arrays, iterate over the list elementsments by means of an iterator or incorrectly access the list elements by means of an index, associate the names of the Snakes with the snakes in a hashmap or red black tree and don't just iteratively search a list by name a snake.

2. Do yo_ur dialogs check incorrect entries (e.g. negative values for the queue lengths, is the head longer than the entire queue length, snake names occur several times),

3. Does your program have a start screen where you can select the size of the playing field, your program will be terminated correctly, i.e. all threads will be terminated correctly.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a java swing program that opens a window
Reference No:- TGS03212977

Expected delivery within 24 Hours