Showing posts with label java api. Show all posts
Showing posts with label java api. Show all posts

October 06, 2014

Bar code generator in java

How to generate bar code for each items in java

package com.proximotech.etrade.utils;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.Barcode;
import com.lowagie.text.pdf.Barcode128;
import com.lowagie.text.pdf.BarcodeEAN;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfWriter;

public class BarcodeCreator {

    public String barcodeToPdf() throws FileNotFoundException, DocumentException{

        Document document = new Document();
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(
            "lumina730.pdf"));
        document.open();

        PdfContentByte cb = writer.getDirectContent();
        BarcodeEAN codeEAN = new BarcodeEAN();
        codeEAN.setCode("1439112001143");
        Paragraph p = new Paragraph();
       
       
        // CODE 128
        document.add(new Paragraph("Barcode 128"));
        Barcode128 code128 = new Barcode128();
        code128.setCode("9112001 Deepak");
        document.add(code128.createImageWithBarcode(cb, null, null));

        document.add(p);
        document.close();
     
        return null;
    }
   
  public static void main(String[] javacode) throws Exception {
     
  }
}

http://javabelazy.blogspot.in/

July 11, 2014

Commodity sales graph in excel

How to create a graph in microsoft office excel

Create a new excel

Rename the first sheet to DATA

Data for Graph
Excel Data
Enter the following data to sheet1 (named as DATA)

Choose the type of data from insert tab in excel sheet

Type of graph available in MS Excel
choose the type of graph in excel
choose select data
Select Data for graph
Select Data

A window will be open

type the following to the textbox  " =DATA!$B$1:$E$7 " (where data is the sheet name, no need of double quotes)

A graph will be created, click on switch row/column

sales graph image
Sales commodity wise graph

The chart properties will be available in Layout tab

excel graph properties
Excel graph properties

You can add title , data label , align it etc etc.....


Excel graph
Author : +Shimjith

Description

If you are looking for sales commodity wise graph , then micro soft office excel package is a good option. you can choose what ever types of graphs. In addition to bar graph many options are there. you can easily switch from one graph to other one. you can switch the axis too, you can even customize where you want to keep your data series.

Java Graph API Documentation /


Similar posts


http://javabelazy.blogspot.in/

January 25, 2013

How to create/add facebook share button to your website

How to add a facebook share button to your blog/website

Description : add the following html tag to your website/blog and change the url


<a  class="free facebook apps" shareLink id="faceBookshare" href="http://www.facebook.com/sharer.php?u=http://javabelazy.blogspot.in/" title="share this post to your facebook timeline" >Facebook like box</a>


the above html code add a social networking link to your website

read more

facebook

Java Facebook API Documentations
Most used Java Facebook API

Description : To add google share button to your blog/website add the following html code and change the url


<div class="g-plus" data-action="share" data-annotation="bubble" data-href="http://javabelazy.blogspot.in/"></div>


http://belazy.blog.com/

October 14, 2012

Phone Number validation in java

Regular expression phone number validation in java

This example code is for phone number validation in java using regular expression and for internet protocol address validation in java


/**
 *
 * @author belazy
 * @version validates1.0
 */
public class Validator implements ValidaterInterface {


/**
 *
 * @see deeps
 * @param
 * @return boolean
 * Description : phone number validator
 * Date : Sep 19, 2007
 * Coded by : belazy
 */
public boolean phoneNumberValidator(String phoneNumber) {
        boolean isValid = false;
        String expression = "^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$";
        CharSequence inputStr = phoneNumber;
        Pattern pattern = Pattern.compile(expression);
        Matcher matcher = pattern.matcher(inputStr);
        if (matcher.matches()) {
            isValid = true;
        }
        return isValid;
    }

/**
 *
 * @see deeps
 * @param
 * @return boolean
 * Description : ip v4 validator
 * Date : Sep 19, 2007
 * Coded by : belazy
 */
public boolean ipaddressV4Validator(String ip) {
        String[] parts = ip.split("\\.");
        if (parts.length < 5) {
            for (String s : parts) {
                int i = Integer.parseInt(s);
                if (i < 0 || i > 255) {
                    return false;
                }
            }
        } else {
            return false;
        }
        return true;
    }


}



To trace the caller details in your java apps you can use true caller api

True caller API Documentation 


http://belazy.blog.com/

July 27, 2012

How to upload image file in java web application [java server page and servlets]

How to upload a Image file from jsp page to servlet 

This is a small example of java web application


 <form action="UserPicsServlet" enctype="multipart/form-data" method="post">
<table>
       <tbody>
<tr>
       <td><input name="filePath" type="file" /></td>
      
        </tr>
<tr></tr>
<tr>
        <td><input name="btnSubmit" type="submit" value="SAVE" /></td>
       <td><input name="btnSubmit" type="reset" value="Cancel" /></td>
       </tr>
</tbody></table>
</form>
Thanking you....

April 05, 2012

reCAPTCHA is a free




reCAPTCHA: The FREE anti-bot service that helps digitize books

reCAPTCHA is a free CAPTCHA service that protects your site against spam, malicious registrations and other forms of attacks where computers try to disguise themselves as a human;


link :: https://developers.google.com/recaptcha/

Using recaptcha with jsp/java

How to use recaptcha4j api


March 17, 2012

Operating system information in java

To get the operation system information in java

Source code


public class OpertingSystemInfo
{
public static void main(String[] args)
{
String nameOS = "os.name";
String versionOS = "os.version";
String architectureOS = "os.arch";
System.out.println("\n The information about OS");
System.out.println("\nName of the OS: " +
System.getProperty(nameOS));
System.out.println("Version of the OS: " +
System.getProperty(versionOS));
System.out.println("Architecture of THe OS: " +
System.getProperty(architectureOS));
}
}


How to get my computer details in java


If you searching for a third partyAPI that helps you to get other information than above
SIGAR api is one of them

sigar class

read here

Thanking you....

Facebook comments