a main application called Project1.java, and a GUI (that extends JFrame) called WordGUI.java. The main program should open a file called “input.txt” which will contain words, one per line. As the words are read from the file, they should be displayed in the GUI as follows: The GUI should have a grid layout of two rows (row 0 and row 1) and three columns (column 0, 1 and 2). All words that start with an ‘A’ or ‘a’ should be displayed in row 0, column 0. All words that start with an ‘E’ or ‘e’ should be displayed in row 0, column 1. Likewise for words starting with ‘I’ or ‘I’ in row 0 column 2, with ‘O’ or’o’ in row 1 column 0, with ‘U’ or ‘u’ in row 1 column 1, and the rest of the words in row 1, column 2. The input file Each line of the input file will contain a word. An example of the input file would be: This is an example input ———————– needs 2 files:: Project1.java WordGUI.java —————– input.txt is:: This is an input file to off used for project 1 in Computer Science The word are to be divided into six

The main objective of this program is to read words from a file called “input.txt” and display them in a graphical user interface (GUI) using a grid layout. The GUI will have two rows and three columns, with each word being placed in the appropriate cell based on its starting letter.

To achieve this, we will need two main files: “Project1.java” which will serve as the main application, and “WordGUI.java” which will extend the JFrame class to create the GUI.

In the main program, we will start by opening the “input.txt” file. This file should contain words, where each word is placed on a separate line. We will read each word from the file and then display it in the GUI based on its starting letter. Specifically, words starting with ‘A’ or ‘a’ will be placed in row 0, column 0, words starting with ‘E’ or ‘e’ will be placed in row 0, column 1, words starting with ‘I’ or ‘i’ will be placed in row 0, column 2, words starting with ‘O’ or ‘o’ will be placed in row 1, column 0, words starting with ‘U’ or ‘u’ will be placed in row 1, column 1, and all other words will be placed in row 1, column 2.

The GUI itself will use a grid layout with two rows and three columns. This layout will ensure that each word is placed in the correct position. We will use JLabels to display the words in each cell of the grid layout. By updating the text of these labels, we can easily display the words as they are read from the file.

As an example, let’s consider the input file “input.txt” which contains the words “apple”, “elephant”, “igloo”, “orange”, “umbrella”, and “banana”. The program will read each word from the file and display them in the GUI as follows:

– “apple” will be displayed in row 0, column 0
– “elephant” will be displayed in row 0, column 1
– “igloo” will be displayed in row 0, column 2
– “orange” will be displayed in row 1, column 0
– “umbrella” will be displayed in row 1, column 1
– “banana” will be displayed in row 1, column 2

By organizing the words in this manner, it becomes easier for the user to locate and identify words based on their starting letter. Additionally, this program can be easily extended to handle larger input files or additional categories of words.

Overall, this program demonstrates the use of file input/output and GUI layout management to create a user-friendly word display interface.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer