Java Menu Class Documentation

Where the Class is Being Defined

While defining a class is pretty much self-explanatory, here is where it is defined in the menu:

public class Menu {
    
    // code here

}
   

as well as

public class MenuJFrame extends JFrame implements ActionListener {
    
    // code here

}
   

Where the Instance of the Class is being Defined

frame = new JFrame(title);

as well as

new MenuJFrame("Menu");

Where the Object is Calling a Method

frame.setVisible(true);

and

m.addActionListener(this);

Where the Object is Mutating Data

MenuJFrame.hashes +=  "<font color=" + COLORS[random] + ">" + hash + "</font>";

and

message.setText(msg);

Console vs. GUI

The console and GUI are similar in that both of them allow the user to interact with the code in some way (no duh). With the console, the user can input whatever they want into the terminal/prompt and view the output of their input. Similarly, in the GUI, the user can click on buttons and see how clicking a different button each time changes the output of the program.

The console and GUI are also very different in many ways. For example, as mentioned earlier, the GUI menu allows users to click on buttons and is overall more user-interactive. In contrast, the console menu does not allow the user to do this, rather the user has to type in their input in order to get their desired output. Furthermore, the code for the GUI menu uses GUI elements (no duh) such as JFrame, JMenuBar, JMenu, and JLabel, while the console menu mainly uses a lot of print statements and switch and case statements.