Solved

help learing JAVA

Posted on 2011-09-19
8
264 Views
Last Modified: 2012-05-12
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.
0
Comment
Question by:ajdratch
8 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 36561876
They recommedn to change not the variable name but the contenst of the text of the label
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36561883
i guess that is the label of the field rather than the  name
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36561895
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
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36561908
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:

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 47

Expert Comment

by:for_yan
ID: 36561942

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)


0
 
LVL 14

Expert Comment

by:nishant joshi
ID: 36561943
you first learn what is oops and kearn c# first this might helps in feature also..
0
 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
ID: 36561945
I meant:
On the right side is the conteents of the text of the lable or JTextFiled (blanks for JTextfIleds of course)
0
 

Author Closing Comment

by:ajdratch
ID: 36563215
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(regularPay));
overtimePayField.setText(" " + nfOverTime.format(overTimePay));
totalField.setText(" " + nfTotal.format(total));
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
micro services vs rest web services 16 87
object oriented programming comparison 5 57
javap not working 8 39
use lov values 2 37
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now