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

Change Background of Master Slide Using Java  

                         


In this example we are going to create a slide then change background of the master slide.

In this example we are creating a slide master for the slide show. To create slide show we are using SlideShow constructor and to create master slide we are using SlideMaster constructor. Then we are creating fill for setting background and for adding a picture. We are using getFill() to create the fill object. The setFillType(type) is used to set the type of fill. In this example, we are using picture type. Finally we are adding the picture into master slide in fill.
  
 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.usermodel.*;
import org.apache.poi.hslf.usermodel.SlideShow;
import org.apache.poi.hslf.model.*;
import java.io.*;
import java.awt.Color;
import org.apache.poi.hslf.model.TextBox;
class MasterSlideBackground
{
  public static void main(String a[])
  {
  try
  {          
        SlideShow slideShow = new SlideShow();
        SlideMaster master = slideShow.getSlidesMasters()[0];
        Fill fill = master.getBackground().getFill();
        int id = slideShow.addPicture(new File("2.png"),
 Picture.PNG
);
        fill.setFillType(Fill.FILL_PICTURE);
        fill.setPictureData(id);
        FileOutputStream out = new FileOutputStream
(
"MasterBackground.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:
j2me canvas
Array in Java
GWT Designer
ArrayList
reflectionapi
struts2 action element
passing values from js
insert query in HQL
sql basics
Removing
PHP Date and .....:/pw
crud application using
openlazlo
j2me background image
Linux Administration L
Eclipse 3.4 EJB
videoinflash
abstract
json tutorial
jboss 4.0.2
upload file to server
layout:datagrid
oXygen
image upload
calendar.set
odd
read a row in oracle t
how to capture multipl
comparetwoarraylist
voip example
map iteration in jstl
multiple submit button
Visual Basic Interface
userdefinedexceptionsa
jsp applet netbeans
coding in time date o
Bubble sort with two n
sessions with login an
validate radio button
character to decimal
Photosh
Two Dimensional Array
createxmlusingjava
Enabling and Disabling
struts fileupload
form validation using
copy to Output file
java arrays
collection list
JSF condition check
digital numbers recogn
message box
Binary Tree JTree
Display image on JSP p
default constructor
log file
stringbuilder replace
grantchart
exception implict obje
jcp
Image Reader
tomcat6.0
gateway
Methods
struts2 example
like roseindia.net
JSP timeout
Convert Time to Second
how to solve recurrenc
PHP Date and .../tools
PHP Form Processing Se
à¹?à¸?à¸?à¹?à¸??????à¹
sampleprojectsinstruts
writetotextfilereturn
substring in jstl
check character
char
servlets programs
palindrome checking th
charat
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.