Solved

help learing JAVA

Posted on 2011-09-19
8
266 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 212
Java exception bubble up 2 21
How to configure empty element in XML Document parser? 15 35
Crystal Reports Licensing Questions 4 34
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

809 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