JavaMix

it`s all about JavaPrograming

http://javamix.net

Dear blog readers,

For providing  some better options to users i moved this JavaMix blog from wordpress to it`s own domain

 http://javamix.net
JavaMix Blog

you can find countinious updates here after afew days.

follow this blog   updates at twitter  http://twitter.com/javamixblog

thanks,

Katta Vijay

 

 

 

Written by katta vijay

November 6, 2009 at 11:20 pm

Posted in news, notice

Tagged with , , , ,

Read RSS feeds using JSP

<%@page contentType=”text/html”%>
<%@page pageEncoding=”UTF-8″%>

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
http://www.w3.org/TR/html4/loose.dtd”&gt;
<%@page import=”java.net.URL”%>
<%@page import=”javax.xml.parsers.DocumentBuilder”%>
<%@page import=”javax.xml.parsers.DocumentBuilderFactory”%>
<%@page import=” org.w3c.dom.CharacterData”%>
<%@page import=” org.w3c.dom.Document”%>
<%@page import=”org.w3c.dom.Element”%>
<%@page import=”org.w3c.dom.Node”%>
<%@page import=”org.w3c.dom.NodeList”%>
<%@page import=”java.lang.*”%>

<%

JavaMix Blog

String desc=null;
try
{
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
URL u = new URL(“http://feed43.com/eenadu.xml&#8221;);   // feed address
Document doc = builder.parse(u.openStream());
String title;
NodeList nodes = doc.getElementsByTagName(“item”);

for(int i=0;i<nodes.getLength();i++) {
Element element = (Element)nodes.item(i);
out.println(“Title: ” + getElementValue(element,”title”));
out.println(“Link: ” + getElementValue(element,”link”));
out.println(“Publish Date: ” + getElementValue(element,”pubDate”));
out.println(“author: ” + getElementValue(element,”dc:creator”));
out.println(“comments: ” + getElementValue(element,”wfw:comment”));
desc=getElementValue(element,”description”);
out.println(“description: ” + desc);
out.println();
out.println(” tested”);

}//for
}//try
catch(Exception ex) {
ex.printStackTrace();
}
%>
<%!
public String getElementValue(Element parent,String label) {
return getCharacterDataFromElement((Element)parent.getElementsByTagName(label).item(0));
}
public String getCharacterDataFromElement(Element e) {
try {
Node child = e.getFirstChild();
if(child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
}
}
catch(Exception ex) {

}
return ” “;
} //private String getCharacterDataFromElement

%>

Written by katta vijay

June 9, 2009 at 4:47 pm

Read RSS feeds by Using Java

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author vijay

*
*/
import java.net.URL;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.CharacterData;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class RSSReader {

private static RSSReader instance = null;

private RSSReader() {
}

public static RSSReader getInstance() {
if(instance == null) {
instance = new RSSReader();
}
return instance;
}

JavaMix Blog
public void writeNews() {
try {

DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
URL u = new URL(“http://pratyush.in/feed/rss&#8221;); // your feed url

Document doc = builder.parse(u.openStream());

NodeList nodes = doc.getElementsByTagName(“item”);

for(int i=0;i<nodes.getLength();i++) {

Element element = (Element)nodes.item(i);
System.out.println(“Title: ” + getElementValue(element,”title”));
System.out.println(“Link: ” + getElementValue(element,”link”));
System.out.println(“Publish Date: ” + getElementValue(element,”pubDate”));
System.out.println(“author: ” + getElementValue(element,”dc:creator”));
System.out.println(“comments: ” + getElementValue(element,”wfw:comment”));
System.out.println(“description: ” + getElementValue(element,”description”));
System.out.println();
}//for
}//try
catch(Exception ex) {
ex.printStackTrace();
}

}

private String getCharacterDataFromElement(Element e) {
try {
Node child = e.getFirstChild();
if(child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
}
}
catch(Exception ex) {

}
return “”;
} //private String getCharacterDataFromElement

protected float getFloat(String value) {
if(value != null && !value.equals(“”)) {
return Float.parseFloat(value);
}
return 0;
}

protected String getElementValue(Element parent,String label) {
return getCharacterDataFromElement((Element)parent.getElementsByTagName(label).item(0));
}

public static void main(String[] args) {
RSSReader reader = RSSReader.getInstance();
reader.writeNews();
}
}

Note: this is not my program, i copied from java forums, after success full running i feel that it may help for my blog reader. i don`t  have any rights on this program.

you can find original post @ http://forums.sun.com/thread.jspa?threadID=5275485

Written by katta vijay

June 4, 2009 at 12:55 pm

reading data from the .Doc file by using Apache POI api

this program simply explains how to read data from the MS wordfile(.DOC) line by line using Apache POI,

what is Apache POI and what is the need i already explain in previous post, you can find that post here

for executing this program we need to download Apache POI api and make jar files  in classpath.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package multidocument;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.extractor.WordExtractor;

/**
*
* @author vijay
*/
public class NewDocReader {
public static void main(String args[]) throws FileNotFoundException, IOException
{

File docFile=new File(“c:\\multi\\multi.doc”);   // file object was created
FileInputStream finStream=new FileInputStream(docFile.getAbsolutePath()); // file input stream with docFile
HWPFDocument doc=new HWPFDocument(finStream);// throws IOException and need to import org.apache.poi.hwpf.HWPFDocument;
WordExtractor wordExtract=new WordExtractor(doc); // import  org.apache.poi.hwpf.extractor.WordExtractor
String [] dataArray =wordExtract.getParagraphText();
// dataArray stores the each line from the document
for(int i=0;i<dataArray.length;i++)
{
System.out.println(“\n–“+dataArray[i]);
// printing lines from the array
}
finStream.close(); //closing fileinputstream
}
}

JavaMix Blog

Written by katta vijay

May 14, 2009 at 6:24 pm

Apache POI api for Java people

apache poi

apache poi

…it is one of the great tool from the Apache,
1st of all i want to write about what is POI?,why we need POI?.
what is POI?
“Poor Obfuscation Implementation”

why we need POI?
reading and writing files in Microsoft Office formats, such as Word, PowerPoint and Excel using Java.

when i was trying to read the data from the .doc files by normal datainputstream reader , i get some garbage data along with original data.

JavaMix Blog

then i startred searching for resolving this issue..at last i found that this API is very useful to work with microsoft formats.

i worked with only .doc file for  reading data line by line , in next post i will explain how to do that.

you can find more info regarding apache POI at WIKI and at apache project site .

Apache POI api  download from here.

Written by katta vijay

May 14, 2009 at 5:37 pm

inserting data into excel sheet using JExcel API

before going to use this post My strong advice to see this post first.

/* by using this program iam trying to insert data to the Excel sheet */

JavaMix Blog

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package excelsheetreading;

/**
*
* @author vijay
*/

// in this program iam going to write insert some data with out formatting like fonts and decimals.
import java.io.File;
import java.io.IOException;
import java.util.Date;
import jxl.*;
import jxl.write.*;
import jxl.write.Number;
class WriteBook
{
// now here iam trying to enter one name and number to the sheet “First Sheet”

public static void main(String args[]) throws IOException, WriteException
{
// STEP 1:
// the first step is to create a writable workbook using the factory method on the Workbook class.
WritableWorkbook workbook = Workbook.createWorkbook(new File(“C:/Documents and Settings/vijay/Desktop/test.xls”));
//test.xls is my work book
// STEP 2:
//
WritableSheet sheet = workbook.createSheet(“First Sheet”,0); // sheet name
//STEP 3:
//adding(inserting) name to the sheet at location (0,2)
Label label = new Label(0,2,”A label record”);
sheet.addCell(label);
//adding number to the sheet at location (1,2)
Number number = new Number(1,2,3.1459);
sheet.addCell(number);
//Step 4:
//close the all opened connections
workbook.write();
workbook.close();
}
}

// before running
//1. make sure that jxl.jar file in your classpath
//2. and check test.xls file is available
//3. finally dont open the test.xls file while running this program

Written by katta vijay

May 1, 2009 at 3:34 pm

Escape Characters in Java

  \n	New line
  \t    Tab
  \b	Backspace
  \r	Carriage return
  \f	Formfeed
  \\	Backslash
  \'	Single quotation mark
  \"	Double quotation mark
  \d	Octal
  \xd	Hexadecimal
  \ud	Unicode character

JavaMix Blog

Written by katta vijay

April 24, 2009 at 11:10 am

Posted in basics, J2SE

Tagged with , , , ,

finding system information/environment using Java

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package keyboardreader; // my package

/**
*
* @author vijay
* https://javamix.wordpress.com
*/
import java.util.*;
import javax.swing.*;
import java.awt.*;

public class SystemEnvironmentlook
{
private final static JTextArea output = new JTextArea();

public static void main( String args[] )
{
initGUI();

Map env = System.getenv();
Iterator iter = env.keySet().iterator();
while ( iter.hasNext() )
{
String key = iter.next();
output( String.format(“%s >>>> %s\n”, key, env.get(key)) );
}

System.out.println( “\n\n” );
}

public static void output( String str )
{
System.out.print( str );
output.append( str );
}

public static void initGUI()
{
output.setForeground( Color.WHITE );
output.setBackground( new Color(60,52,90) );

JFrame f = new JFrame( “System Environment -JavaMix” );
f.add( new JScrollPane(output), BorderLayout.CENTER );
f.setSize( 640, 700 );
f.setVisible( true );
}
}

OUTPUT:

USERPROFILE >>>> C:\Documents and Settings\vijay
PATHEXT >>>> .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
SystemDrive >>>> C:
TEMP >>>> C:\DOCUME~1\vijay\LOCALS~1\Temp
ProgramFiles >>>> C:\Program Files
Path >>>> C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.6.0_03\bin;C:\Documents and Settings\vijay\Desktop\final Data\Remote compiler\RemoteCompiler\build\classes\remotecompiler
HOMEDRIVE >>>> C:
PROCESSOR_REVISION >>>> 0f02
CLIENTNAME >>>> Console
USERDOMAIN >>>> UTS-SYSTEM09
ALLUSERSPROFILE >>>> C:\Documents and Settings\All Users
PROCESSOR_IDENTIFIER >>>> x86 Family 6 Model 15 Stepping 2, GenuineIntel
SESSIONNAME >>>> Console
TMP >>>> C:\DOCUME~1\vijay\LOCALS~1\Temp
LOGONSERVER >>>> \\UTS-SYSTEM09
CommonProgramFiles >>>> C:\Program Files\Common Files
=:: >>>> ::\
PROCESSOR_ARCHITECTURE >>>> x86
OS >>>> Windows_NT
FP_NO_HOST_CHECK >>>> NO
HOMEPATH >>>> \Documents and Settings\vijay
PROCESSOR_LEVEL >>>> 6
COMPUTERNAME >>>> UTS-SYSTEM09
windir >>>> C:\WINDOWS
SystemRoot >>>> C:\WINDOWS
NUMBER_OF_PROCESSORS >>>> 2
USERNAME >>>> vijay
ComSpec >>>> C:\WINDOWS\system32\cmd.exe
APPDATA >>>> C:\Documents and Settings\vijay\Application Data

note: this is not my program, iam just copied and edited & i don`t have any rights on this program any one can copy,edit.
JavaMix Blog

Written by katta vijay

April 22, 2009 at 12:34 pm

converting system date to required format

package automatedsms; // my package name

/**
*
* @author vijay
*/
import java.util.Calendar;
import java.text.SimpleDateFormat;

public class DateUtils {

JavaMix Blog

JavaMix Blog

public static String now(String dateFormat) {
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
return sdf.format(cal.getTime());

}

public static void main(String arg[]) {

// different date formats
System.out.println(DateUtils.now(“dd MMMMM yyyy”));   // calling now method with my required format
System.out.println(DateUtils.now(“yyyyMMdd”));
System.out.println(DateUtils.now(“dd.MM.yy”));
System.out.println(DateUtils.now(“MM/dd/yy”));
System.out.println(DateUtils.now(“yyyy.MM.dd G ‘at’ hh:mm:ss z”));
System.out.println(DateUtils.now(“EEE, MMM d, ”yy”));
System.out.println(DateUtils.now(“h:mm a”));
System.out.println(DateUtils.now(“H:mm:ss:SSS”));
System.out.println(DateUtils.now(“K:mm a,z”));
System.out.println(DateUtils.now(“yyyy.MMMMM.dd GGG hh:mm aaa”));

}

}

output:

21 April 2009
20090421
21.04.09
04/21/09
2009.04.21 AD at 12:43:20 GMT+05:30
Tue, Apr 21, ’09
12:43 PM
12:43:20:687
0:43 PM,GMT+05:30
2009.April.21 AD 12:43 PM

Written by katta vijay

April 21, 2009 at 7:13 am

installing comport api in windows

comm.jar should be placed in:

    %JAVA_HOME%/lib

    %JAVA_HOME%/jre/lib/ext

win32com.dll should be placed in:

    %JAVA_HOME%/bin

    %JAVA_HOME%/jre/bin

JavaMix Blog


    %windir%System32

javax.comm.properties should be placed in:

    %JAVA_HOME%/lib

    %JAVA_HOME%/jre/lib

practice programs:
https://javamix.wordpress.com/2009/03/25/serialport-communication-using-java/
https://javamix.wordpress.com/2009/01/21/sending-sms-using-serialport-communication-api/

Written by katta vijay

March 30, 2009 at 10:32 am

output comment and hiddencomment in JSP

output comment:

A comment that is sent to the client in the viewable page source.The JSP engine handles an output comment as uninterpreted HTML text, returning the comment in the HTML output sent to the client. You can see the comment by viewing the page source from your Web browser.
JavaMix Blog
JSP Syntax
<!– comment [ <%= expression %> ] –>

Example 1

<!– This is a commnet sent to client on
<%= (new java.util.Date()).toLocaleString() %>
–>

Displays in the page source:
<!– This is a commnet sent to client on March 28, 2009 –>


hiddencomment

A comments that documents the JSP page but is not sent to the client. The JSP engine ignores a hidden comment, and does not process any code within hidden comment tags. A hidden comment is not sent to the client, either in the displayed JSP page or the HTML page source. The hidden comment is useful when you want to hide or “comment out” part of your JSP page.

You can use any characters in the body of the comment except the closing –%> combination. If you need to use –%> in your comment, you can escape it by typing –%\>.
JSP Syntax
<%– comment –%>

Example:
<%–
Document   : commenttest
Created on : Mar 28, 2009, 11:48:27 AM
Author     : vijay
–%>

<%@page contentType=”text/html” pageEncoding=”UTF-8″%>
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
http://www.w3.org/TR/html4/loose.dtd”&gt;

<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>
<title>JSP Page</title>
</head>
<body>

<!– this is visible comment–>                          comment 1
<%– this comment is not visible  –%>          comment 2
<h1>Hello World!</h1>
</body>
</html>


output:

when you go for browser source code it will  displays the following :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <!-- this is visible comment-->       comment 1 only displays

        <h1>Hello World!</h1>
    </body>
</html>


Written by katta vijay

March 28, 2009 at 6:41 am

Posted in j2ee, Jsp, tips

Tagged with , , , ,

Reading data from Excel sheet using JExcel API

using Java we can read the data from Excel sheets by creating type1 driver , but here

we are taking help of JExcelapi we can able to read data directly from the Excel sheets.
steps to be follow:
step 1:
download JExcel api from here

JavaMix Blog

step2:

after downloading extract the zip file.
make jxl.jar available to your class path.

step 3:

create a Excel sheet with some data

step 4:

in this step we are reading data from the Excel sheet.

use the below java code:

/*

* To change this template, choose Tools | Templates

* and open the template in the editor.

*/

// this is main java program

//describes how to read from the .xls and displays

package excelsheetreading; // my package name

import java.io.File;

import java.io.IOException;

import java.util.Date;

import jxl.*;

import jxl.read.biff.BiffException;

/**

*

* @author vijay

*/

public class Main // main is my class name

{

/**

* @param args the command line arguments

*/

public static void main(String[] args) throws IOException, BiffException {

// TODO code application logic here

Workbook workbook = Workbook.getWorkbook(new File(“C:/Documents and Settings/vijay/Desktop/contacts.xls”));

// my excel sheet name is contacts, iam given the complete path.

Sheet sheet = workbook.getSheet(0); // iam reading data from the sheet1

// here iam reading the data of 1st column data up three cells

Cell a1 = sheet.getCell(0,0);

Cell b2 = sheet.getCell(0,1);

Cell c2 = sheet.getCell(0,2);

//getting  the data from cells

String stringa1 = a1.getContents();

String stringb2 = b2.getContents();

String stringc2 = c2.getContents();

//printing the data

System.out.println(“a1–>”+stringa1);

System.out.println(“b2–>”+stringb2);

System.out.println(“c3–>”+stringc2);

}

}

JavaMix Blog


Written by katta vijay

March 26, 2009 at 12:15 pm

serialport communication using Java

before going to execute this program read how to install comport api for windows

In java there is no inbuilt support to access serial or parallel ports, to over come this we are taking support of  Java communication API.

after downloading the java communication api extract the folder then you can get the following…
in Commapi folder we require
comm.jar

javax.comm.properties

win32com.dll

after getting these files perform following operations….

  • Copy file comm.jar in <JAVA_HOME>\jre\lib\ext
  • Copy file javax.comm.properties in <JAVA_HOME>\jre\lib
  • Copy file win32com.dll in <JAVA_HOME>\lib

now you can able to access the commport by Java programm.

The following example displays the available ports(serial and parallel ports) and their type:

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package keyboardreader;

/**
*
* @author vijay
*/

import javax.comm.*;
import java.util.Enumeration;

public class ListPorts {
public static void main(String args[]) {
Enumeration ports = CommPortIdentifier.getPortIdentifiers();
while (ports.hasMoreElements()) {
CommPortIdentifier port = (CommPortIdentifier) ports.nextElement();
String type;
switch (port.getPortType()) {
case CommPortIdentifier.PORT_PARALLEL:
type = “Parallel”;
break;
case CommPortIdentifier.PORT_SERIAL:
type = “Serial”;
break;
default: /// Shouldn’t happen
type = “Unknown”;
break;
}
System.out.println(port.getName() + “: ” + type);
}
}
}

output is like this :

COM1: Serial
COM2: Serial
LPT1: Parallel
LPT2: Parallel

Written by katta vijay

March 25, 2009 at 7:30 pm

finding the local host ip

package sampleprograms;
import java.io.*;
import java.net.*;

/**
*
* @author katta vijay
*/
public class Main {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here

try{
String ip =  InetAddress.getLocalHost().getHostAddress();
System.out.println(ip);
}catch(Exception e){
}
}

}
—————————————————-output is————————
10.0.0.223

Written by katta vijay

February 4, 2009 at 6:06 am

sending sms using serialport communication API

before going to execute this program read how to install comport api for windows

/*  this is the program used to send the message from javaprogram to the mobile phone */

/*

Note :- before using this porogram  first read the post “serialport communication using Java” by me in this blog.

*/

package sms; // it is my own package
import java.io.*;
import java.util.*;
import javax.comm.*;          //for accessing serialport

/**
*
* @author  katta vijay
*
*
*/
public class OwnPort {
static CommPortIdentifier portId;
static CommPortIdentifier saveportId;
static Enumeration        portList;
static  SerialPort           serialPort;
static OutputStream      outputStream;
static InputStream      inputStream;
static boolean        outputBufferEmptyFlag = false;
public static void main(String[] args) {
boolean           portFound = false;
String           defaultPort= “COM1”;
System.out.println(“Set default port to “+defaultPort);
portList = CommPortIdentifier.getPortIdentifiers();
while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
if (portId.getName().equals(defaultPort)) {
System.out.println(“Found port: “+defaultPort);
portFound = true;
// init reader thread
OwnPort op=new OwnPort();
op.initwritetoport();
}
}

}
if (!portFound) {
System.out.println(“port ” + defaultPort + ” not found.”);
}
}
public void initwritetoport()
{
System.out.println(“inside  initwriteport”);
String   s1=”at”;
String   s2=”\r\n”;
String   s3=”at+cmgf=1″;
String   s4=”at+cmgs=\”9966606454\””;
//         char[]   s5={‘”‘,’9′,’3′,’4′,’6′,’4′,’6′,’2′,’1′,’6′,’5’,'”‘};
String s6=”32“;
//         for(int i=0;i<s5.length;i++)
//         {
//          System.out.println(s5.toString());
//         }
//       System.out.println(“s6=”+s6);
String        messageString = “hey ee mesage GSM nunchi vachindi!”;

// get the outputstream
try {
serialPort = (SerialPort) portId.open(“SimpleReadApp”, 2000);
} catch (PortInUseException e) {}

try {
// set port parameters
serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
outputStream =serialPort.getOutputStream();
inputStream = serialPort.getInputStream();
}
catch (Exception e) {
e.printStackTrace();
}
try
{
System.out.println(“–1–“);
outputStream.write(s1.getBytes()); // AT command
//           System.out.println(s1.getBytes());
//           outputStream.wait(10000);
outputStream.write(s2.getBytes()); // enter
Thread.sleep(1000);  //sleeping thread
System.out.println(“–2–“);
//                outputStream.wait(1000);
outputStream.write(s3.getBytes());  //at+cmgf=1 command
//                outputStream.wait(1000);
outputStream.write(s2.getBytes()); //enter
Thread.sleep(1000);// thread sleeping
System.out.println(“–3–“);
//                outputStream.wait(1000);
outputStream.write(s4.getBytes()); //at+cmgs=”<mobilenumber>”
//                outputStream.wait(1000);
outputStream.write(s2.getBytes()); //enter
Thread.sleep(1000); //thread sleeping
System.out.println(“–4–“);
//                outputStream.wait(1000);
outputStream.write(messageString.getBytes()); // message
//                outputStream.wait(1000);
outputStream.write(s2.getBytes());
Thread.sleep(1000);
outputStream.write(s6.getBytes());
Thread.sleep(1000);
System.out.println(“–5–“);

//                outputStream.wait(1000);
byte[] readBuffer = new byte[23];
try
{
while (inputStream.available() > 0) {
int numBytes = inputStream.read(readBuffer);
//               System.out.println(numBytes);

// print data

String result  = new String(readBuffer);
System.out.println(“Read: “+result);
}
}
catch(Exception e)
{
e.printStackTrace();
}
outputStream.close();
serialPort.close();
}
catch(Exception e)
{

}

}
}

Written by katta vijay

January 21, 2009 at 5:50 pm

shutdown your system using Java program

// save all the open programs and files before you run this program

import java.io.*;
class Shutdown{
public static void main(String arg[]){
Runtime runtime = Runtime.getRuntime();
try{
Process proc = runtime.exec(“shutdown -s -t 0”);
System.exit(0);
}
catch(Exception e)
{
System.out.println(“e”);
}
}
}

Written by katta vijay

December 13, 2008 at 12:08 pm

javaFX

JavaFX is the Platform for New applications for a New World

JavaFX is here! Join us for the online event that will change the way you imagine, create and build Rich Internet Applications.
On December 4, 2008, visit javafx.com and see how JavaFX — an expressive, rich client platform — can help you create and deliver Rich Internet Applications (RIAs) with immersive media and content across all screens of your life. Come back to javafx.com on December 5 to see Jonathan Schwartz, CEO and President of Sun Microsystems, and Anil Gadre, EVP Application Platform Software, plus special guests from Sun’s JavaFX Vision Forum and Showcase.
Experience how JavaFX allows RIA developers to:
• build engaging visual experiences by expanding capabilities in Java

• break free from the browser with the power to deploy RIA on multiple screens

• integrate graphics, video, audio, animation and rich text easily and intuitively

• express yourself, across all screens of your life
Sign up for an SMS reminder, so you won’t miss all the action! For more information on JavaFX, please visit javafx.com.
If you have any questions or feedback, please send a message to sun-webevent@sun.com

Written by katta vijay

December 4, 2008 at 7:46 am

Posted in news

Tagged with , , , ,

welcome to my Java blog

hello freiends

this is my Java blog, you may seen no.of this kind of blogs but,

here iam going to present each concept and program clearly,and here iam going to present some collections

like some other good java resources,job openings,and many more..

this is presently what iam thinking to start this web blog, any way i hope

this will help for you.

this is simple complete java blog.

katta vijay

Written by katta vijay

October 2, 2008 at 7:07 pm

Posted in notice

Tagged with , , , ,