-1

I'm trying to code java using atom, how do I fix the below error? I would really appreciate some help. some links to other cute tutorials can help too.

it says

Testing.java:23: error: cannot find symbol label.setText = "Testing"; ^ symbol: variable setText location: variable label of type JLabel Testing.java:24: error: cannot find symbol frame.addComponents(label); ^ symbol: method addComponents(JLabel) location: variable frame of type JFrame Testing.java:32: error: cannot find symbol frame.setVisibility(true); ^ symbol: method setVisibility(boolean) location: variable frame of type JFrame 3 errors [Finished in 0.507s]

how do I fix this? here are the necessary lines of code

label.setText = "Testing"; (1st error line)
frame.addComponents(label); (2nd error line)
frame.setVisibility(true); (3rd error line)
  • The best fix is to read a basic introductory Java textbook since you're guessing at some pretty important fundamentals, and learning by guessing is not a sound strategy. – Hovercraft Full Of Eels Jan 15 '20 at 02:43

1 Answers1

0

If you took a look at the javadoc for JLabel, you'd see that you should actually be doing:

label.setText("Testing");

Also, it should be frame.setVisible(true)... where are you getting your info from?

sleepToken
  • 1,866
  • 1
  • 14
  • 23