Archive for the 'Java' Category

Java - Javascript Basics 01Lisa Spurlin

Tuesday, February 7th, 2006

Script adds simple or sophisticated interactivity to a Web site, enhancing the user’s experience. Like any programming language, you need to understand the building blocks before you can start programming.

Start at the Beginning

Browsers know to interpret Web pages as HTML because of the tags. Since JavaScript is contained inside an HTML document, it needs to be set apart with the tags.




Don’t forget that last tag! Abrowser will try and interpret the whole HTML page as JavaScript, until it comes to that closing tag. Without it, the page will generate unsightly errors and not load properly.

Comment, Comment, Comment

Commenting code allows you, or someone else looking at it, to understand what’s occuring in the code. Commenting can be done in both single and multi-line variations:

// single line comments

/* multi-line
comments */

But what about the HTML comment inside the script tags. That exists so older browsers that don’t understand JavaScript won’t try and interpret it. Otherwise, the code will render the page as HTML, resulting in the page displaying incorrectly.

Defining Variables

JavaScript, like all programming languages, uses variables to store information. These variables can store numbers, strings, variables that have been previously defined, and objects. For example:

Numeric: var x = 0;
String: var y = “hello”;
Variables: var z = x + y;
Object: var myImage = new Image();

Strings MUST contain “” around the word or phrase. Otherwise the JavaScript will interpret it as a number. Numbers and previously defined variables, likewise, should not have “” unless you want that number to be treated as a string.

Ex: var x = hello ** wrong

Variables that store numbers and strings can be combined in a new variable. However, if anything is combined with a string, it is automatically be treated as a string.

Ex: var y = “1″;
var z = “2″;
var a = y + z;

The variable “a” in this instance is “12″ not 3, since the two strings were combined together as text, not added like numbers. This would be true even if y = 1.

Making a Statement

Notice the semi-colons (;) at the end of each line of code? The semi-colon denotes the end of that particular statement. While JavaScript can sometimes be forgiving if you don’t include the semi-colon at the end of each statement, it’s good practice to remember to do so. Otherwise, you might not remember to put it there when you really need it.

Alert! Alert!

Alerts are one of the greatest functions in JavaScript. They not only pass information on to visitors, but help you when you’re trying to hunt down a bug in your code.

Examples of alerts

alert(”this is a string”);
creates an alert that will contain the text”this is a string”

alert(x)
creates an alert that will contain the value defined in variable x (make sure that variable x is defined before calling it)

alert(”the number is ” + x);
-creates an alert that will combine text and the value in x.

It Can Do Math Too?

JavaScript wouldn’t be much of a programming language if it couldn’t do simple math. While there are dozens of complex, built-in math functions, here are the basic symbols you’ll need to know:

addition +
subtraction -
multiplication *
division /
greater than >
less than <
greater than or equal >=
less than or equal < =

What “If” Statements

“If” statements are often used to compare values. If the statement is true, a set of instructions enclosed in {} executes. Comparisons like this are done using the following symbols:

equals ==
not equal !=

In the example below, you can see how an “if” statement is used to determine text that displays in an alert window. Copy and paste the following script into an HTML page to see it at work.

Notice how the instructions for each statement (both the “if” and “else”) are enclosed in {}(curly brackets). All curly brackets must have a beginning and ending, just like HTML tags. If a curly bracket is missing the JavaScript will return an error, so be sure to proof your code.

________________________________________
This document is provided for informational purposes only, and i-Netovation.com makes no warranties, either expressed or implied, in this document. Information in this document is subject to change without notice. The entire risk of the use or the results of the use of this document remains with the user. The example companies, organizations, products, people, and events depicted herein are fictitious. No association with any real company, organization, product, person, or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, wit hout the express written permission of i-Netovation.com.

If you believe that any of these documents, related materials or any other i-Netovation.com content materials are being reproduced or transmitted without permission, please contact: violation@i-netovation.com.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

Start at the Beginning

Browsers know to interpret Web pages as HTML because of the tags. Since JavaScript is contained inside an HTML document, it needs to be set apart with the tags.




Don’t forget that last tag! Abrowser will try and interpret the whole HTML page as JavaScript, until it comes to that closing tag. Without it, the page will generate unsightly errors and not load properly.

Comment, Comment, Comment

Commenting code allows you, or someone else looking at it, to understand what’s occuring in the code. Commenting can be done in both single and multi-line variations:

// single line comments

/* multi-line
comments */

But what about the HTML comment inside the script tags. That exists so older browsers that don’t understand JavaScript won’t try and interpret it. Otherwise, the code will render the page as HTML, resulting in the page displaying incorrectly.

Defining Variables

JavaScript, like all programming languages, uses variables to store information. These variables can store numbers, strings, variables that have been previously defined, and objects. For example:

Numeric: var x = 0;
String: var y = “hello”;
Variables: var z = x + y;
Object: var myImage = new Image();

Strings MUST contain “” around the word or phrase. Otherwise the JavaScript will interpret it as a number. Numbers and previously defined variables, likewise, should not have “” unless you want that number to be treated as a string.

Ex: var x = hello ** wrong

Variables that store numbers and strings can be combined in a new variable. However, if anything is combined with a string, it is automatically be treated as a string.

Ex: var y = “1″;
var z = “2″;
var a = y + z;

The variable “a” in this instance is “12″ not 3, since the two strings were combined together as text, not added like numbers. This would be true even if y = 1.

Making a Statement

Notice the semi-colons (;) at the end of each line of code? The semi-colon denotes the end of that particular statement. While JavaScript can sometimes be forgiving if you don’t include the semi-colon at the end of each statement, it’s good practice to remember to do so. Otherwise, you might not remember to put it there when you really need it.

Alert! Alert!

Alerts are one of the greatest functions in JavaScript. They not only pass information on to visitors, but help you when you’re trying to hunt down a bug in your code.

Examples of alerts

alert(”this is a string”);
creates an alert that will contain the text”this is a string”

alert(x)
creates an alert that will contain the value defined in variable x (make sure that variable x is defined before calling it)

alert(”the number is ” + x);
-creates an alert that will combine text and the value in x.

It Can Do Math Too?

JavaScript wouldn’t be much of a programming language if it couldn’t do simple math. While there are dozens of complex, built-in math functions, here are the basic symbols you’ll need to know:

addition +
subtraction -
multiplication *
division /
greater than >
less than <
greater than or equal >=
less than or equal < =

What “If” Statements

“If” statements are often used to compare values. If the statement is true, a set of instructions enclosed in {} executes. Comparisons like this are done using the following symbols:

equals ==
not equal !=

In the example below, you can see how an “if” statement is used to determine text that displays in an alert window. Copy and paste the following script into an HTML page to see it at work.

Notice how the instructions for each statement (both the “if” and “else”) are enclosed in {}(curly brackets). All curly brackets must have a beginning and ending, just like HTML tags. If a curly bracket is missing the JavaScript will return an error, so be sure to proof your code.

________________________________________
This document is provided for informational purposes only, and i-Netovation.com makes no warranties, either expressed or implied, in this document. Information in this document is subject to change without notice. The entire risk of the use or the results of the use of this document remains with the user. The example companies, organizations, products, people, and events depicted herein are fictitious. No association with any real company, organization, product, person, or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, wit hout the express written permission of i-Netovation.com.

If you believe that any of these documents, related materials or any other i-Netovation.com content materials are being reproduced or transmitted without permission, please contact: violation@i-netovation.com.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

ABOUT THE AUTHOR

(C) Copyright 2002. Lisa Spurlin

Java - Just What is Java?

Tuesday, February 7th, 2006

>

Java is a highly portable computer programming language. “Portable” is a term used to describe programs that can be run in many different computing environments and on many different “platforms” (MS Windows, Apple’s Mac OS, Solaris, and Linux are all examples of “platforms”)

It is Java’s portability that makes it such an intriguing technology. To give you an example of how this portability relates to real world features and benefits, let’s say you have a program that is written in Java such as a web browser. Normally, with a web browser application, the user is bound to the settings for the browser application and the configuration of the machine that they are using it on. So, at the office, the machine on Joe User’s desktop has one set of bookmarks, plug ins, security setting, etc. Joe’s machine at home will most likely have a different set of bookmarks, plug ins and settings. Now, let’s say Joe want to have a more consistent experience with the computers that he uses everyday. Joe could install a Java-based browser on removable writable media (such as a floppy diskette, pen drive, zip disk or CDRW) and carry his browser with him (with all the settings, bookmarks and plug ins in tow as well!)

Java is not only portable, but it is also widely known, and does not need to be interpreted (like PHP, Java script and some other and other languages). Java also does not have to be compiled on the machine it will be run on. Java can be compiled once and run in its binary form on many systems. Although there are other languages out there that are extremely portable, there are few that could stand up to Java’s “compile once, run everywhere” functionality. Java is truly a useful and feature rich programming language and is used to program many software programs on the market today.

About the Author

James Hunt has spent 15 years as a professional writer and researcher covering stories that cover a whole spectrum of interest. Read more at www.best-in-java.com

Java - An Easy Way to Develop JAVA Enterprise Applications

Tuesday, February 7th, 2006

An Easy Way to Develop JAVA Enterprise Applications

 by: Qurrat Mahmood

Research bears that less than 70 percent of development projects are actually completed, and more than half come in late and over budget. AlachiSoft TierDeveloper is a Rapid Application Development tool that helps Software Developers do better, more creative, and useful work by reducing redundant hand coding. No run time fees, No server-CPU fees, and no development fees charged by AlachiSoft. Customers only pay for developer licenses.

For a free evaluation please visit: http://www.alachisoft.com/redirect_page.php?source=articlecity.com&dest=http://www.alachisoft.com/download.htm

TierDeveloper quickly designs, generates and deploys the middle-Tier data objects in hours or days at most. This is the biggest area of saving in a software project when you use TierDeveloper. TierDeveloper 3.0 includes full integration support for Microsoft VS.Net 2003. TierDeveloper map data objects to tables along with custom attribute selection. Specify custom hooks, web services, multiple database connections, and parent/child relationships.

For Java and J2EE developers, TierDeveloper is now tightly integrated with BEA webLogic 7.1/8.1 and Jboss 3.2.x and added database support for MySQL will give Developers working in different environments more flexibility. New Oracle optimization includes the ability to generate .NET components using Oracle Native Data Provider for .NET.

Follow five easy steps to Rapid Development with TierDeveloper 3.0 (for more details, visit http://www.alachisoft.com/five_steps.htm)

  1. Have your database ready
  2. Identify your Applications database interaction
  3. Create TierDeveloper Project
  4. Generate and run 50% of your application instantly
  5. Develop remaining 50% of your application

If you want to gain greater productivity, quality and consistency, while cutting costs at the same time then use TierDeveloper, It reduce the time intensive phases of the project development and software testing with a significant cost reduction.

Related links

Visit our website http://www.alachisoft.com/redirect_page.php?source=articlecity.com&dest=http://www.alachisoft.com

For TierDeveloper time saving analysis please visit: http://www.alachisoft.com/redirect_page.php?source=articlecity.com&dest=http://www.alachisoft.com/time_savings.htm

About The Author

AlachiSoft TierDeveloper is a Rapid Application Development tool that helps Software Developers do better, more creative, and useful work by reducing redundant hand coding. No run time fees, No server-CPU fees, and no development fees charged by AlachiSoft.

Java - New Customizable JavaScript Menu for Web Applications

Tuesday, February 7th, 2006

>

Minsk, Belarus, October 11, 2005 – Software development company Scand released its new product - dhtmlxMenu v1.0. This JavaScript menu enables web developers to design and edit a simple DHTML menu in a very convenient way.

dhtmlxMenu has cross-browser support, so it can be used for sites and web applications that are supposed to run under different OS. The menu is compatible with all main web browsers for Windows, Linux, Unix and Mac OS.

This JavaScript menu has XML support that gives possibility to build menus dynamically from XML file or database. Any complex menu structure can be generated using a simple XML code. Menu appearance can be easily changed dynamically without requiring the web page to be reloaded. Powerful client-side API allows changing the menu state “on-the-fly” with external JavaScript code.

dhtmlxMenu is highly customizable. This JavaScript component provides an easy way to create pop-up or drop down menus of any configuration. dhtmlxMenu can also be used as a right-click context menu.

Skinable design allows web developer to change visual appearance of the menu so it matches different styles, e.g. Windows or Mac OS style. This DHTML menu also has such useful feature as vertical scrolling of items. Above all, the menu has high functional stability and performance.

dhtmlxMenu v1.0 is free for non-commercial use (GNU General Public License - GPL) and can be downloaded from JavaScript Menu Homepage. In order to use dhtmlxMenu in commercial projects, there is a possibility to purchase the Commercial license ($49 - 3 months of support period).

About Scand LLC
Scand LLC is software development company based in Belarus (Eastern Europe). The company delivers offshore outsourcing software development services supplied by the best quality, timeliness and creativity. Scand LLC offers some advanced ready to use Java applets and JavaScript components that are available for download on Scand Website.

About the Author

Ivan Petrenko
Scand LLC
Masherova 27
Minsk, Belarus
http://www.scbr.com
products@scand.com