Category Archives: Java

[JAVA] Check is number?


private boolean isNumber(String str){
	try {
		Integer.parseInt(str);
		return true;
	}catch(Exception e){
		return false;
	}
}



if(isNumber(str)){
  System.out.println("This is a number");
}else{
 System.out.println("This is not a number");
}

Posted in Java, Tech Note | Tagged , | Leave a comment

JAVA Reference site Collection

Posted in Java, Tech Note | Tagged , , | Leave a comment

Applet Tag

<applet code = “MyClass.class” width=200 height=200 codebase=’.’ archive=”></applet>

code : Contains the name of the applet Java class.

width : Contains the width in pixels of the rectangular area on the screen that will be used bythe applet.

height : Contains the height of the area to be used by the applet.

codebase : Specifies the root directory of your applet class relative to the location of theHTML file. For example, if the applet class is located in the sub-directory bin, specify“./bin” in the codebase attribute to avoid getting FileNotFoundException.

archive : Use this attribute to specify the location of the jar file if your multi-class applethas been deployed as one archive file, which can be created with the help of the jar programlocated in the bin directory of your Java install.

For HTML5 (Using Object tag)

<object type=’application/x-java-applet’ height=’300′ width=’550′>

<param name=’code’ value=’MyClass.class’ />

</object>

Param Tag

<applet code = “MyClass.class” width=200 height=200 codebase=’.’ archive=”>

/* Make it not using cache */

<param name=’cache_option’ value=’no’ />

/* Pass parameter to applet */

<param name=’val1′ value=’value_1′ />

</applet>

Posted in Java, Tech Note | Tagged , | Leave a comment

Java API

For Java SE 5

http://download.oracle.com/javase/1,5.0/docs/api/

For Java SE 6

http://download.oracle.com/javase/6/docs/api/

For Java SE 7

http://download.oracle.com/javase/7/docs/api/

Posted in Java, Tech Note | Leave a comment

Setting Editplus for Java

Link :

http://www-acad.sheridanc.on.ca/~jollymor/editplus.html

Posted in Java, Tech Note | Tagged , | Leave a comment

Install JDK for developing Java application

1. Download the latest JDK at http://www.oracle.com/technetwork/indexes/downloads/index.html

(Click Java SE under the Java tab, then you can see the JDK download link)

2. Install on your PC

I installed to C:\java\jdk1.7.0

3. Set Environment Variables

To set, go to Control Panel – System and Security – System – Advanced Tab – Click Environment Variables button.

– Path

Add your java bin path to CLASSPATH

(..);C:\java\jdk1.7.0\bin

– CLASSPATH

If you didn’t create before, It may not be in your System variables list,

then add CLASSPATH using New button..

.;C:\java\jdk1.7.0\lib\tools.jar

(Do not forget the dot(.) at first)

– JAVA_HOME

This is too, if you can not see in your list, just create it.

C:\java\jdk1.7.0

———— Ok, All setting has been completed.

Let’s test it whether Java is installed ok.

Open your Command Prompt.

and type Javac and press Enter key

and type java and press Enter key

If you can see the Javac help and java help then you are ready to develop Java Application!

Good Luck!

Posted in Java, Tech Note | Tagged , , | 2 Comments