setHorizontalAlignment(JTextField.CENTER)
.
Another similar change would be to make the text field uneditable by the
user. A call to setEditable(false)
would accomplish this.
Where should these calls go?
Design the user interface first. It would be easiest to always show the alarm time as a smaller display, with a check box or toggle button to turn it on and off.