This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to load powerpoint presentation in java applet

 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

In my java application i am including an image in my applet by browsing through a dialog box, which can browse the image from my system wherever it is present. For example in c: drive or d: drive......

Same way if I want to browse power point presentations and want to display it on the applet, how can i do that?

I have searched a lot.
But found nothing.

Anybody has any idea please tell me.
Regards,
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my java application i am including an image in my applet

I'm confused - is this an applet or an application? This matters because applets run under security restrictions that won't allow them to perform file I/O unless the applet is signed or the local security policy altered (you can find more about that here).

You would use the java.awt.FileDialog or javax.swing.JFileChooser classes to browse for files.

The hardest part would be to display PPT files. I'm not aware of an AWT or Swing component that can do that. It's not hard to read PPT files with the help of the Apache POI library, though. It lets you extract slide titles, text, images, notes and other information for each slide. You'll just have to display those in a meaningful way in the applet.
 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf Dittmer,
Thanks for your reply.
I apologize for not making myself clear.
Its an applet actually.
In my applet i have a canvas for displaying the images.
Now i want to display the ppt file in this canvas.
Is it possible or not?
I did not find any appropriate solution for this on the net.
Regards,
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't display it in the way you can display an image, because there's nothing in the class libraries that understands PPT files.

But as I said, it's not hard to use POI to read PPT files and iterate through their contents, displaying the slides' contents as appropriate. (If you want to show transitions etc. it gets a whole lot more complicated, of course.)
 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Ulf Dittmer.
Regards
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic