Solved

help learing JAVA

Posted on 2011-09-19
8
265 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Weekend adv creator 3 36
jar file executable 12 51
Arrays.asList  VS  ArrayList 4 54
Unhandled exception type Exception 18 28
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 …
The viewer will learn how to implement Singleton Design Pattern in Java.

805 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