April 11, 2009

Published April 11, 2009 by

Launch Default Browser, Mail Client or Desktop Applications to Open, Edit, Print Files from Java Application

The java.awt.Desktop class allows a Java application to launch associated applications registered on the native desktop to handle a URI or a file.Supported operations include:• launching the user-default browser to show a specified URI;• launching the user-default mail client with an optional mailto...
Read More

April 10, 2009

Published April 10, 2009 by

Turn On / Off Num Lock, Caps Lock, Scroll Lock Programmatically

Method setLockingKeyState(int keyCode, boolean on) of class Toolkit is used to on or off the locking key programmatically. It sets the state of the given locking key on the keyboard. Valid key codes are VK_CAPS_LOCK, VK_NUM_LOCK, VK_SCROLL_LOCK, and VK_KANA_LOCK.A sample Java program is given here which...
Read More
Published April 10, 2009 by

Representation of a Big Number Without Exponent

What is the maximum value of a double in Java? It is 1.7976931348623157E308, that means 1.7976931348623157 x 10 to the power 308. If we write System.out.println(Double.MAX_VALUE) in a Java program we can get this. Any big number in Java is shown with an exponent field naturally. What to do if we want to see all the digits (without the exponent) of a large number? Do you know, if we show...
Read More
Published April 10, 2009 by

Minimum and Maximum Values (Range) of Java Primitive Types

The minimum and maximum values of the Java primitive types (numbers only) are as below. This will help you to declare the appropriate numeric type for your variable.byte -128 to 127 short -32768 to 32767 int -2147483648 to 2147483647 long -9223372036854775808 to 9223372036854775807 float 1.4E-45 to 3.4028235E38 double 4.9E-324 to 1.7976931348623157E308 You can get the result from the following...
Read More