Solved

help learing JAVA

Posted on 2011-09-19
8
263 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
Comment Utility
They recommedn to change not the variable name but the contenst of the text of the label
0
 
LVL 40

Expert Comment

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

Expert Comment

by:for_yan
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 47

Expert Comment

by:for_yan
Comment Utility

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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
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…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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:

772 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

12 Experts available now in Live!

Get 1:1 Help Now