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

Creating Auto Shape in PowerPoint Using Java

                         


In this example we are going to create auto shape on PowerPoint slide using java.

In this example, we are creating the object of AutoShape .We are passing the shape type into AutoShape as argument parameter .We are passing ShapeTypes.Star32 as shape type. Then we are using setAnchor() method to give the position of the shape. To fill the color we are using setFillColr(Color colr)  method.

 

 


  
 The code of the program is given below:

import org.apache.poi.hslf.HSLFSlideShow;
import org.apache.poi.hslf.model.Slide;
import org.apache.poi.hslf.model.*;
import org.apache.poi.hslf.usermodel.SlideShow;
import org.apache.poi.hslf.usermodel.*;
import java.io.*;
import java.awt.*;
import org.apache.poi.hslf.model.TextBox;
class autoShape
{
  public static void main(String a[])
  {
  try
  {   SlideShow slideShow = new SlideShow();
       Slide slide = slideShow.createSlide();
         AutoShape sh1 = new AutoShape(ShapeTypes.Star32);
             sh1.setAnchor(new java.awt.Rectangle
(
00600600));
             sh1.setFillColor(Color.red);
       AutoShape sh2 = new AutoShape(ShapeTypes.Star32);
             sh2.setAnchor(new java.awt.Rectangle
(
200200200200));
             sh2.setFillColor(Color.green);
        AutoShape sh3 = new AutoShape(ShapeTypes.Star32);
             sh3.setAnchor(new java.awt.Rectangle
(
150150300300));
             sh3.setFillColor(Color.red);
        AutoShape sh4 = new AutoShape(ShapeTypes.Star32);
             sh4.setAnchor(new java.awt.Rectangle
(
100100400400));
             sh4.setFillColor(Color.green);
             slide.addShape(sh1);
             slide.addShape(sh4);
             slide.addShape(sh3);
             slide.addShape(sh2);
        FileOutputStream out = new FileOutputStream
(
"autoShape.ppt");
        slideShow.write(out);
        out.close();
  }catch(Exception e){}
  }}

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:
google
code for frames using
visible
С?в??в??С?в???С?
adding hibernate tools
create xml using java
web application tomcat
array element in php
UIData
Working with EHCache
sample code
input two files
Struts 2 File Upload
saveOrUpdatefaces
class not found
given list is sorted
program to explain the
JSLT Example
what is Ice Faces
change color in JTabl
How to create Jasperpr
pojo
login code using jsp
threads/
session.getAttribute
how to conect with any
sample examples in spr
prepare statement exec
how to edit a file in
calling one jsp p
update checkbox row in
Photoshop Color RGB vs
Disadvantagesofanexcep
btreeimplementation
table joining
�����?��
portals
how to write the zoomi
scroll bar
GNATbench
VisualBasicTCP/IPProgr
Photoshop Textures and
timer
html button
how can create panel g
how to edit a any file
chaching
tesseract ocr
graphics
list is sorted or not
3DS MAX Making a Ligh
javaexampleprogramuseo
how to insert date val
struts 2 and exception
upload an image
jpanel
checkbox button enable
java button event fram
extracting day from da
updatetable
distributed cache upda
give me some java pro
csv file format
value change listener
joining
call printer in jsp
javax.mail
download
standard
?ร??ร?ย
program of creating wa
UsingAbstractClass
j2me canvas
decimal to binary conv
JScroolPane in JTable
JQUERY
methods in java
multiple checkboxes st
usingbufferedreaderin.
hssf
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.