Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

adding Under Lines

                         

In this program we are going to tell you how you can add underlines. You can  any number of lines. This example gives you an idea ,how to make a java program to add a underline and you can also make program for making line on the text.
In this example we create chunk and then we  use the setUnderLine(
0.2f, -2f) method to add the line. There are an other chunk  object on which we use setUnderLine(0.5f, 3f).So you can create any number of chunk object and set line as your requirements. 

Code Description:


You can create line for chunk object to any position of the text .

To make a program you need to import some packages one more package:
 import java.awt.Color;

setUnderLine(float f,float f):We use the setUnderLine(float f,float f) method. Float values may be negative or positive depending on  where you want to fix the line for the text.

You can create line on small text .For this Chunk class is provided by iText API,s.

 The code of the program is given below:

import java.awt.Color;
import java.io.FileOutputStream;
import java.io.IOException;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;
public class addUnderLines
      {
  public static void main(String[] argsthrows Exception 
             {
          System.out.println("Underline, Strike through,...");
    Document document = new Document();
    PdfWriter.getInstance(document,  new FileOutputStream("underLinesPdf.pdf"));
      document.open();
      Chunk chunk = new Chunk("RoseIndia.net");
      chunk.setUnderline(0.2f, -2f);
      Paragraph paragraph = new Paragraph("The following chunk is ");
      paragraph.add(chunk);
      document.add(paragraph);
      Chunk chunk1 = new Chunk("roseindia.net");
      chunk1.setUnderline(0.5f3f);  
      document.add(chunk1);    
            document.close();
  }
}

The output of the program is given below:

Download this example.

 

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Latest Searches:
poi-bin-3.1-beta2-200
how to print arraylist
pb tree implementati
CVS
stored
cgi
tree and treenode (Aja
format a number decima
jstl if
how to manipulate mand
how to split string c
compress file uploadin
create xls using POI
mysql-connector-java-3
stopping action event
StringTokenizer select
prime numbers between
JScrollPane
authentication jsf
linked list and window
hash table mapping
java udp
insert data to databas
explanation
mysql-connector-java-3
Error handling in stru
JSF panelGrid render
insert into
fibonacci method
jcreator code of calcu
tree
session destroy
jtabel
how to use tab control
java random numbers
ftp
Package Examples
J2ME Gauge
multiple rows in singl
Time
flex struts
how to user JSpinner t
convert text file to i
sorting with dropdown
creating exception exa
html:img
calling a method from
goto
interview question
jsp registration form
rational rose
example of struts with
struts-blank.war
date to calendar
struts framework
Thread Sleep Method
empty
Excel open java applic
read integers from fil
dojo Spring
how to declare an arra
java example program t
list interface
javascript to Display
jdbctemplate queryfor
struts e file jpeg
user login servletsusi
datatable delete row
Java example program t
authentication
create a directory and
lookupDispatchAction
retrieve image url fro
average numbers
log4j Tutorials
calculating prime numb
java file colum
pdf using xsl
nested logic
Two Dimensional Array
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.