I have a couple simple lines of code, one of which is giving me trouble.
Code:
JTextField txtDisplay = new JTextField();
txtDisplay.setHorizontalAlignment(JTextField.RIGHT);
The text field is created fine, but configuring the alignment is giving trouble. If you see the trouble with my code, please let me know.
The definition for setHorizontalAlignment is:
public void setHorizontalAlignment(int alignment)
Here is my error:
calculator/calculator.java [12:1] <identifier> expected
txtDisplay.setHorizontalAlignment(JTextField.RIGHT);
-------------------------------------^
1 error
Errors compiling calculator