Assignment 1_Testing_RegNo_<fv18727>
a) Add a word to the list (the word to be added is provided in a text field at the bottom of the
application).
In order to simplify the task I have decided to create Panels for each section i.e a TopPanel for the
Buttons, a MiddlePanel for the LABEL output and a BottomPanel for the user TextInput and RGB
input. I have done this by creating three different methods that return the panels accordingly.
Later to add each of this panel to a mainPanel in the main method.
I have also created a class Operations that consists of different methods that provide corresponding
features; public boolean validate(String w) - checks if the input string is a valid word and returns true for
valid and false otherwise;
With the help of this method the program is able to identify if an input String is a valid word.
However, we would not see any effect if there wasn't an event handling, thus we implement an action
listener to respond to the user’s indication.
a) Add a word to the list (the word to be added is provided in a text field at the bottom of the
application).
In order to simplify the task I have decided to create Panels for each section i.e a TopPanel for the
Buttons, a MiddlePanel for the LABEL output and a BottomPanel for the user TextInput and RGB
input. I have done this by creating three different methods that return the panels accordingly.
Later to add each of this panel to a mainPanel in the main method.
I have also created a class Operations that consists of different methods that provide corresponding
features; public boolean validate(String w) - checks if the input string is a valid word and returns true for
valid and false otherwise;
With the help of this method the program is able to identify if an input String is a valid word.
However, we would not see any effect if there wasn't an event handling, thus we implement an action
listener to respond to the user’s indication.