Class Main
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- Main
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible,javax.swing.RootPaneContainer,javax.swing.WindowConstants
public class Main extends javax.swing.JFrameThis class is the class that contains the main part of the code.- Author:
- RedNeath
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JTextFieldageFieldThis field will be modified by the user to determine the age of the character.private javax.swing.JLabelageLabelThis label is to be displayed just under the previous one.private javax.swing.JPanelagePanelThis panel will be a GridLayout that will contain the ageLabel and ageField on one and only line.private AppListenerappLisThis listener will be triggered when the playButton or languageButton will be activated.private javax.swing.JButtoncomputeButtonThis button will start the calculation with the numbers entered by the user.private javax.swing.JLabeldataLabelThis label will be displayed centered at the top of the window.private javax.swing.JTextFieldfirstMagicPowerFieldThis field will display the result of the calculation for the first magic.private javax.swing.JLabelfirstMagicPowerLabelThis label is to be displayed at the top left corner of the result section.private javax.swing.JPanelfirstMagicPowerPanelThis panel will be a GridLayout that will contain the firstMagicPowerLabel and firstMagicPowerField on one and only line.private java.awt.DimensionminSizeThis attribute is the minimum size for the window.private javax.swing.JTextFieldpotentialFieldThis field will be modified by the user to determine the magic potential of the character.private javax.swing.JLabelpotentialLabelThis label contains the text to display at the top left corner of the data section.private javax.swing.JPanelpotentialPanelThis panel will be a GridLayout that will contain the potentialLabel and potentialField on one and only line.private javax.swing.JLabelresultLabelThis label contains the result of the execution.private javax.swing.JTextFieldsecondMagicPowerFieldThis field will display the result of the calculation for the second magic.private javax.swing.JLabelsecondMagicPowerLabelThis label is to be displayed just under the previous one, in the same section.private javax.swing.JPanelsecondMagicPowerPanelThis panel will be a GridLayout that will contain the secondMagicPowerLabel and secondMagicPowerField on one and only line.-
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description Main()This builder creates an instance of a Main object and initialises its content.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JTextFieldgetAgeField()This getter returns the age field attribute.javax.swing.JButtongetComputeButton()This getter returns the compute button attribute.javax.swing.JTextFieldgetFirstMagicPowerField()This getter returns the first magic power field attribute.javax.swing.JTextFieldgetPotentialField()This getter returns the magic potential field attribute.javax.swing.JTextFieldgetSecondMagicPowerField()This getter returns the second magic power field attribute.static voidmain(java.lang.String[] args)This is the heart of the RNG app.-
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
dataLabel
private javax.swing.JLabel dataLabel
This label will be displayed centered at the top of the window.
-
potentialLabel
private javax.swing.JLabel potentialLabel
This label contains the text to display at the top left corner of the data section.
-
ageLabel
private javax.swing.JLabel ageLabel
This label is to be displayed just under the previous one.
-
resultLabel
private javax.swing.JLabel resultLabel
This label contains the result of the execution.
-
firstMagicPowerLabel
private javax.swing.JLabel firstMagicPowerLabel
This label is to be displayed at the top left corner of the result section.
-
secondMagicPowerLabel
private javax.swing.JLabel secondMagicPowerLabel
This label is to be displayed just under the previous one, in the same section.
-
potentialField
private javax.swing.JTextField potentialField
This field will be modified by the user to determine the magic potential of the character.
-
ageField
private javax.swing.JTextField ageField
This field will be modified by the user to determine the age of the character.
-
firstMagicPowerField
private javax.swing.JTextField firstMagicPowerField
This field will display the result of the calculation for the first magic.
-
secondMagicPowerField
private javax.swing.JTextField secondMagicPowerField
This field will display the result of the calculation for the second magic.
-
computeButton
private javax.swing.JButton computeButton
This button will start the calculation with the numbers entered by the user.
-
appLis
private AppListener appLis
This listener will be triggered when the playButton or languageButton will be activated.
-
potentialPanel
private javax.swing.JPanel potentialPanel
This panel will be a GridLayout that will contain the potentialLabel and potentialField on one and only line.
-
agePanel
private javax.swing.JPanel agePanel
This panel will be a GridLayout that will contain the ageLabel and ageField on one and only line.
-
firstMagicPowerPanel
private javax.swing.JPanel firstMagicPowerPanel
This panel will be a GridLayout that will contain the firstMagicPowerLabel and firstMagicPowerField on one and only line.
-
secondMagicPowerPanel
private javax.swing.JPanel secondMagicPowerPanel
This panel will be a GridLayout that will contain the secondMagicPowerLabel and secondMagicPowerField on one and only line.
-
minSize
private java.awt.Dimension minSize
This attribute is the minimum size for the window.
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
This is the heart of the RNG app. Igniting it will start up the program.- Parameters:
args- Arguments entered in the terminal (not used).
-
getPotentialField
public javax.swing.JTextField getPotentialField()
This getter returns the magic potential field attribute.- Returns:
- potentialField.
-
getAgeField
public javax.swing.JTextField getAgeField()
This getter returns the age field attribute.- Returns:
- ageField.
-
getFirstMagicPowerField
public javax.swing.JTextField getFirstMagicPowerField()
This getter returns the first magic power field attribute.- Returns:
- firstMagicPowerField.
-
getSecondMagicPowerField
public javax.swing.JTextField getSecondMagicPowerField()
This getter returns the second magic power field attribute.- Returns:
- secondMagicPowerField.
-
getComputeButton
public javax.swing.JButton getComputeButton()
This getter returns the compute button attribute.- Returns:
- computeButton.
-
-