ajdratch
asked on
help learing JAVA
I am attempting to learn Java for a hobby (haven't written code in 15 years) I am using netbeans and found a good document on oracle.com to help get started however either I am missing the obvious or there is a problem with this site. I'm hoping someone can tell me how to get this to work.
The article is http://www.oracle.com/technetwork/java/netbeans-part1-142734.html#figure7. If you scroll down a bit it tells you to name the variable jlabel6, jlable7 and jlabel8 to ******
When I try that it says it is not a valid variable name. I would think that it needs to be variable name, not asterisks since it will be the results of a calculated field.
Any help for a beginner is very much appreciated.
The article is http://www.oracle.com/technetwork/java/netbeans-part1-142734.html#figure7. If you scroll down a bit it tells you to name the variable jlabel6, jlable7 and jlabel8 to ******
When I try that it says it is not a valid variable name. I would think that it needs to be variable name, not asterisks since it will be the results of a calculated field.
Any help for a beginner is very much appreciated.
They recommedn to change not the variable name but the contenst of the text of the label
i guess that is the label of the field rather than the name
Variable name in java can only start with letter and contain charcacters , distis and underscore
They are talking about the contesnt of the text of the lable this contents is data - struig and it can be blank, or asteriksk, or amny
printesd symnbols,
the name of the variables does not need to be changed at this point
They are talking about the contesnt of the text of the lable this contents is data - struig and it can be blank, or asteriksk, or amny
printesd symnbols,
the name of the variables does not need to be changed at this point
I think they misplace this remark, yuou cannot change jlablel to ****
To rename a component, right-click it in either the Design Editor or the Inspector and choose Change Variable Name. Change names for the following components:
To rename a component, right-click it in either the Design Editor or the Inspector and choose Change Variable Name. Change names for the following components:
This part
Variable Text
jLabel6 **********
jLabel7 **********
jLabel8 **********
jTextField1 [blank]
jTextField2 [blank]
is obviously jsut continuation of this part
Variable Text
jLabel1 Hours Worked:
jLabel2 Rate/ Hour ($):
jLabel3 Regular Pay:
jLabel4 Overtime Pay:
jLabel5 Total:
jButton1 Compute
On the left side is the conteents of the text of the lable or JTextFiled (blanks for JTextfIleds of course)
you first learn what is oops and kearn c# first this might helps in feature also..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It looks like they left out some information. I needed to name those variables according to the last lines of code
regularPayField.setText(" " + nfRegular.format(regularPa y));
overtimePayField.setText(" " + nfOverTime.format(overTime Pay));
totalField.setText(" " + nfTotal.format(total));
regularPayField.setText(" " + nfRegular.format(regularPa
overtimePayField.setText("
totalField.setText(" " + nfTotal.format(total));