You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we need to use 'if' statements to perform Actions. In the future, we should be able to separate Actions from Components, and also provide enum Actions for direct use, similar to the concept of STATUS_CODE.
Current Action Class:
packagesrc.Actions;
importjavax.swing.*;
importjava.awt.event.*;
importsrc.Utils.StatusCode;
publicclassMenuItemActionextendsJMenuimplementsActionListener {
publicMenuItemAction() { }
publicvoidactionPerformed(ActionEvente) {
if (e.getActionCommand().equals("About XML Editor")) {
aboutAction(e);
} elseif (e.getActionCommand().equals("Quit (Control + Q)")) {
exitAction(e);
}
}
privatevoidaboutAction(ActionEvente) {
Stringmessage = "Hello World! This is a simple XML Editor.";
JOptionPane.showMessageDialog(null, message);
}
privatevoidexitAction(ActionEvente) {
System.exit(StatusCode.EXIT);
}
}
The text was updated successfully, but these errors were encountered:
uml-editor/src/Components/MenuBar.java
Line 39 in dfbd793
Currently, we need to use 'if' statements to perform Actions. In the future, we should be able to separate Actions from Components, and also provide
enum
Actions for direct use, similar to the concept ofSTATUS_CODE
.Current Action Class:
The text was updated successfully, but these errors were encountered: