Package com.nilhcem.fakesmtp.gui.info
Class PortTextField
java.lang.Object
java.util.Observable
com.nilhcem.fakesmtp.gui.info.PortTextField
- All Implemented Interfaces:
Observer
Text field in which will be written the desired SMTP port.
- Since:
- 1.0
- Author:
- Nilhcem
-
Constructor Summary
ConstructorsConstructorDescriptionCreates the port field object and adds a listener on change to alert the presentation model. -
Method Summary
Modifier and TypeMethodDescriptionget()
Returns the JTextField object.void
Sets the specified port in the text field only if this latter is notnull
.void
update
(Observable o, Object arg) Enables or disables the port text field.Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Constructor Details
-
PortTextField
public PortTextField()Creates the port field object and adds a listener on change to alert the presentation model.The default port's value is defined in the configuration.properties file.
Each time the port is modified, the port from theUIModel
will be reset.
-
-
Method Details
-
get
Returns the JTextField object.- Returns:
- the JTextField object.
-
setText
Sets the specified port in the text field only if this latter is notnull
.- Parameters:
portStr
- the port to set.
-
update
Enables or disables the port text field.When the element will receive an action from the
StartServerButton
object, it will enable or disable the port, so that the user can't modify it when the server is already launched.
-