Write a menu driven program that either accepts words and their meanings, or displays the list of words in lexicographical order (i.e. as in a dictionary). When an entry is to be added to the dictionary you must first enter the word as one string, and then enter the meaning as separate string. A word may have more than one meaning, and may be entered at separate times. When this occurs, place each successive meaning on a separate line. This new meaning must be preceded by a dash. For example, if you enter the following words and with their meanings in the following order: Library, School, Cup, and School, then your output should be a display as shown in the Figure 1 below.

Cup – a container from which we drink.

Library – a collection of books

School – a place of learning

- any group of fish

Figure 1.

One more requirement, from time to time words become obsolete. When this happens, such word must be removed from the dictionary. Your program must account for this also.

Use the JOptionPane class to enter the information.

Use the concept of linked list to carryout this exercise. You will need at minimum the following classes:

* A WordMeaning class that hold the name of a word and its meaning.
* A WordMeaningNode class that creates the node of information and its link field.
* A WordList class that creates and maintain a linked list of words and their meanings.
* A Dictionary class that test your classes.

For the output, the program should produce two scrollable lists:

* The current list of words and their meanings, and
* The list of the deleted words. You need not list the meanings, just the words.

The best way to get answers for this type of projects is to go as far as you can, and ask specific questions for directions, or for debugging information.

You have submitted information as though we are a homework service, which we are not.

If you break up your problem into smaller pieces, showing your efforts in between, you are likely to get help.

I suggest you start with your pseudocode, or actual coding, depending on your habit, or what you're instructed to do. Post what you have for answers when you get stuck.

Excellent, hope to hear from you soon!

To implement this menu-driven program, we can follow the steps outlined below:

1. Create a class called `WordMeaning` that will hold the name of a word and its meaning. This class will have a constructor that takes a word and its meaning as parameters.

```java
public class WordMeaning {
private String word;
private String meaning;

public WordMeaning(String word, String meaning) {
this.word = word;
this.meaning = meaning;
}

// Include necessary getters and setters
}
```

2. Create a class called `WordMeaningNode` that will represent a node in our linked list. This class will have fields for the word meaning and a link to the next node.

```java
public class WordMeaningNode {
private WordMeaning wordMeaning;
private WordMeaningNode next;

public WordMeaningNode(WordMeaning wordMeaning) {
this.wordMeaning = wordMeaning;
this.next = null;
}

// Include necessary getters and setters
}
```

3. Create a class called `WordList` that will create and maintain a linked list of words and their meanings. This class will have methods to add words, display the list, and remove obsolete words.

```java
import javax.swing.JOptionPane;

public class WordList {
private WordMeaningNode head;
private WordMeaningNode deletedWords;

public WordList() {
this.head = null;
this.deletedWords = null;
}

public void addWordMeaning(String word, String meaning) {
WordMeaning newWordMeaning = new WordMeaning(word, meaning);
WordMeaningNode newNode = new WordMeaningNode(newWordMeaning);

if (head == null) {
head = newNode;
} else {
WordMeaningNode currentNode = head;
while (currentNode.getNext() != null) {
currentNode = currentNode.getNext();
}
currentNode.setNext(newNode);
}
}

public void displayCurrentList() {
StringBuilder list = new StringBuilder();

WordMeaningNode currentNode = head;
while (currentNode != null) {
list.append(currentNode.getWordMeaning().getWord()).append(" - ").append(currentNode.getWordMeaning().getMeaning()).append("\n");
currentNode = currentNode.getNext();
}

JOptionPane.showMessageDialog(null, list.toString(), "Current List", JOptionPane.INFORMATION_MESSAGE);
}

public void displayDeletedWords() {
StringBuilder list = new StringBuilder();

WordMeaningNode currentNode = deletedWords;
while (currentNode != null) {
list.append(currentNode.getWordMeaning().getWord()).append("\n");
currentNode = currentNode.getNext();
}

JOptionPane.showMessageDialog(null, list.toString(), "Deleted Words", JOptionPane.INFORMATION_MESSAGE);
}

public void removeObsoleteWord(String word) {
WordMeaningNode currentNode = head;
WordMeaningNode prevNode = null;

while (currentNode != null) {
if (currentNode.getWordMeaning().getWord().equalsIgnoreCase(word)) {
if (prevNode != null) {
prevNode.setNext(currentNode.getNext());
} else {
head = currentNode.getNext();
}

currentNode.setNext(deletedWords);
deletedWords = currentNode;

JOptionPane.showMessageDialog(null, "Word removed successfully.", "Remove Word", JOptionPane.INFORMATION_MESSAGE);
return;
}

prevNode = currentNode;
currentNode = currentNode.getNext();
}

JOptionPane.showMessageDialog(null, "Word not found.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
```

4. Create a class called `Dictionary` that tests the functionality of the classes.

```java
import javax.swing.JOptionPane;

public class Dictionary {
public static void main(String[] args) {
WordList wordList = new WordList();

while (true) {
String[] options = {"Add Word", "Display Current List", "Display Deleted Words", "Remove Obsolete Word", "Exit"};
int choice = JOptionPane.showOptionDialog(null, "Select an option:", "Dictionary", JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[0]);

switch (choice) {
case 0:
String word = JOptionPane.showInputDialog(null, "Enter the word:");
String meaning = JOptionPane.showInputDialog(null, "Enter the meaning:");
wordList.addWordMeaning(word, meaning);
break;
case 1:
wordList.displayCurrentList();
break;
case 2:
wordList.displayDeletedWords();
break;
case 3:
String obsoleteWord = JOptionPane.showInputDialog(null, "Enter the word to remove:");
wordList.removeObsoleteWord(obsoleteWord);
break;
case 4:
JOptionPane.showMessageDialog(null, "Exiting the program.", "Exit", JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
default:
JOptionPane.showMessageDialog(null, "Invalid choice.", "Error", JOptionPane.ERROR_MESSAGE);
break;
}
}
}
}
```

Note: This program uses JOptionPane for input/output. You may need to adjust the code to use a different method for input/output depending on your requirements.

To run the program, simply execute the `Dictionary` class. It will display a menu with options to add words, display the current list, display deleted words, remove obsolete words, or exit the program. Use the appropriate options to manipulate the dictionary as needed.