Powerpoint in swings Application

hi folks,
Am newbee to java and i need disperate help from you
i need to run slide show (powerpoint presentation in swings application)
can any body give me approach or some coding tips.
i am stuck up at these for serveral days

Your problem is where did the user install PowerPoint, right?
Here is some code that figures out where the user installed explorer. You can use similar code to find PowerPoint.
The you can build a temporary batch file with its path, like I showed you before, and run it (the batch file should get deleted automatically later.):
private static boolean ShowHelpURL(String strUrl) {   
    logger.info("strUrl: " + strUrl);
    String strPath=null;
    boolean bFound = false;
    if (isWindows()) {
      if (isFromMS()) {
        String strWndPath = System.getProperty("com.ms.windir");
        logger.info("com.ms.windir: " + strWndPath);
        if (strWndPath != null) {
          strPath = strWndPath.substring(0, 2) + "\\Program Files\\Internet Explorer\\IEXPLORE.EXE";
          logger.info("strPath: " + strPath);
      if (strPath == null) {
        String strPaths = System.getProperty("java.library.path");
        logger.info("strPaths: " + strPaths);
        String strSeperator=System.getProperty("path.separator");
        int nPos = 0;
        int nPosx = -1;
        do {
          nPosx = strPaths.indexOf(strSeperator, nPos);
          if (nPosx != -1) {
            strPath = strPaths.substring(nPos, nPosx);
            strPath.replace('/', '\\');
            nPos = nPosx + 1;
            int nFindPos = -1;
            if ((nFindPos = strPath.toLowerCase().indexOf("\\program files")) != -1) {
              if ((strPath.length() == nFindPos + 14) ||
                (strPath.charAt(nFindPos + 14) == '\\')) {
                   bFound = ieFoundThere(strPath, strUrl);
                   if (bFound) {
            } else if ((nFindPos = strPath.toLowerCase().indexOf("\\progra~1")) != -1) {
              if ((strPath.length() == nFindPos + 9) ||
                (strPath.charAt(nFindPos + 9) == '\\')) {
                   bFound = ieFoundThere(strPath, strUrl);
                   if (bFound) {
            } else if ((nFindPos = strPath.toLowerCase().indexOf("\\windows")) != -1) {
              if ((strPath.length() == nFindPos + 8) ||
                (strPath.charAt(nFindPos + 8) == '\\')) {
                strPath = strPath.substring(0,nFindPos + 1) + "program files";
                bFound = ieFoundThere(strPath, strUrl);
                   if (bFound) {
        } while (nPosx != -1);       
        logger.info("strPath: " + strPath);
    return bFound;
   * Return true if an internet explorer was found there.
   * It brings it up with the strUrl if found
   * @param strPath
   * @param strUrl
   * @return
  private static boolean ieFoundThere(String strPath, String strUrl) {
    if (strPath != null) {
      int nPos1 = strPath.toLowerCase().indexOf("program files");
      strPath = strPath.substring(0, nPos1 + 13);
      strPath += "\\Internet Explorer\\IEXPLORE.EXE";
      logger.info("strPath != null");
      logger.info("Runtime.getRuntime().exec: " + strPath + " " + strUrl);
      File ieFile = new File(strPath);
      if (!ieFile.exists()) {
           return false;//keep on trying
      try {
        Runtime.getRuntime().exec(strPath + " " + strUrl);
        return true;
      } catch (IOException e) {
        logger.info("IOException: " + e.getMessage());
        return false;
    } else {
      return false;
  private static boolean isFromMS() {
    String s = System.getProperty("java.vendor");
    return (s.toLowerCase().indexOf("microsoft") == 0) ;
  private static boolean isWindows() {
    String s = System.getProperty("os.name");
    return (s.toLowerCase().indexOf("window") == 0) ;

Similar Messages

  • Is there free java chat, which i can embed in my Swing application

    Hello all,
    I have a Swing application and i want to embed java chat into it.
    Can you recommend me free chat for which i can see and modofy client and server sources.


  • How to give Common Background color for all JPanels in My Swing application

    Hi All,
    I am developing a swing application using The Swing Application Framework(SAF)(JSR 296). I this application i have multiple JPanel's embedded in a JTabbedPane. In this way i have three JTabbedPane embedded in a JFrame.
    Now is there any way to set a common background color for the all the JPanel's available in the application??
    I have tried using UIManager.put("Panel.background",new Color.PINK);. But it did not work.
    Also let me know if SAF has some inbuilt method or way to do this.
    Your inputs are valuable.
    Thanks in Advance,

    It is not the fault of NetBeans' GUI builder, JPanels are opaque by default, I mean whether you use Netbeans or not.Thank you!
    I stand corrected (which is short for +"I jumped red-eyed on my feet and rushed to create an SSCCE to demonstrate that JPanels are... mmm... oh well, they are opaque by default... ;-[]"+)
    NetBeans's definitely innocent then, and indeed using it would be an advantage (ctrl-click all JPanels in a form and edit the common opaque property to false) over manually coding
    To handle this it would be better idea to make a subclass of JPanel and override isOpaque() to return false. Then use this 'Trasparent Panel' for all the panels where ever transparency is required.I beg to differ. From a design standpoint, I'd find it terrible (in the pejorative sense of the word) to design a subclass to inconsistently override a getter whereas the standard API already exposes the property (both get and set) for what it's meant: specify whether the panel is opaque.
    Leveraging this subclass would mean changing all lines where a would-be-transparent JPanel is currently instantiated, and instantiate the subclass instead.
    If you're editing all such lines anyway, you might as well change the explicit new JPanel() for a call to a factory method createTransparentJPanel(); this latter could, at the programmer's discretion, implement transparency whichever way makes the programmer's life easier (subclass if he pleases, although that makes me shudder, or simply call thePanel.setOpaque(false) before returning the panel). That way the "transparency" code is centralized in a single easy to maintain location.
    I had to read the code for that latter's UI classes to find out the keys to use (+Panel.background+, Label.foreground, etc.), as I happened to not find this info in an authoritative document - I see that you seem to know thoses keys, may I ask you where you got them from?
    One of best utilities I got from this forum, written by camickr makes getting these keys and their values very easy. You can get it from his blog [(->link)|http://tips4java.wordpress.com/2008/10/09/uimanager-defaults/]
    Definitely. I bit a pair of knucles off when discovered it monthes after cumbersomely traversing the BasicL&F code...
    Still, it is a matter-of-fact approach (and this time I don't mean that to sound pejorative), that works if you can test the result for a given JDK version and L&F, but doesn't guarantee that these keys are there to stand - an observation, but not a specification.
    Thanks TBM for highlighting this blog entry, that's the best keys list device I have found so far, but the questions still holds as to what specifies the keys.
    Edited by: jduprez on Feb 15, 2010 10:07 AM

  • How to get mouse wheel action in my swing application?

    In my mouse, i am having mousewheel to support scrolling.With the help of the wheel, i can scroll the pages in IE browser or any other appliction.
    In swing application ,i have scroll bar inside a JFrame.I want to have mousewheel action in my swing application to support scrolling.
    any idea ???

    As far as I know,there is no facility for detecting mouse scrolling wheel in JDK 1.3.
    Check it in the later releases of JDK.

  • I want to implement thems functionality in  my swing application

    Hi All...
    I want to implement the themes object in my swing application,How ,where to start and move that functionality,If anybody use this functionality in your program experience can u share with me.
    Than to Advance

    Hi Kuldeep Chitrakar
    I can do that in web intelligence. dont want that
    I am replicating some of the sample report of SQL Servers in BusinessObjects XI R3.1.
    One of the SQL Sever's report is of product catalogue type that gives complete information like name, category, description along with the products image etc... for each of the products.
    I am trying to replicate the above said SQL Server report in Business objects XI R3.1. I am facing problem in bringing the image in to my BO report. The image resides in a table and its datatype is of varbinary(max). I don't know the exact matching while creating an object in the uiverse designer.
    Here is the url link http://errorsbusinessobjectsxir3.blogspot.com/2010/10/business-objects-image-errors.html

  • Can not launch swing application from Java Web Start 1.6.0_37

    I have a dynamic generated jnlp file from a serlvet. When I used Java Web Start to start the swing application, it failed. The exception showed
    com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://xxxx.xx.com:9080/dilpipweb/Test-1.0-SNAPSHOT.jar
         at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
         at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
         at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
         at java.util.concurrent.FutureTask.run(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    I used janela to validate the generated jnlp file. It was valid. I also checked the tomcat access log, it showed that the Test-1.0-SNAPSHOT.jar file was accessed correctly (with a 200 return code).
    Can anyone help me what was the problem?

    I got a different problem. My Corba application works in JRE 1.6, but doesn't works in JRE 1.5.X. I got an unexpected error and my console shows:
    getSubjectX500Principal NoSuchMethodError: java.lang NoSuchMethodError
    #### Java Web Start Error:
    #### null
    Can you help me?

  • Java Swing application problem in Windows vista

    When we execute the Swing application in windows vista environment.
    The look and feel of the swing components are displayed improperly.
    Do we need to put any specific look and feel for windows vista environment or any specific hardware configuration is required to setup windows vista environment.
    Please give some inputs to solve the problem.
    We have tried with the following sample code to run in windows vista.
    * Vista.java
    * Created on December 5, 2006, 5:39 PM
    public class Vista extends javax.swing.JFrame {
    /** Creates new form Vista */
    public Vista() {
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
    jButton1 = new javax.swing.JButton();
    jToggleButton1 = new javax.swing.JToggleButton();
    jPanel1 = new javax.swing.JPanel();
    jCheckBox1 = new javax.swing.JCheckBox();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    jTextField1 = new javax.swing.JTextField();
    jButton1.setText("Button 1");
    jButton1.setBounds(20, 20, 170, 30);
    jToggleButton1.setText("Togle btn");
    jToggleButton1.setBounds(100, 80, 90, 20);
    jCheckBox1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jCheckBox1.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jCheckBox1.setBounds(10, 40, 130, 13);
    jPanel1.setBounds(10, 150, 200, 130);
    jScrollPane1.setBounds(210, 150, 164, 94);
    jTextField1.setBounds(240, 30, 140, 30);
    }// </editor-fold>//GEN-END:initComponents
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new Vista().setVisible(true);
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JToggleButton jToggleButton1;
    // End of variables declaration//GEN-END:variables

    When we execute the Swing application in windows
    vista environment.
    The look and feel of the swing components are
    displayed improperly.Improperly means what? You must be aware that Vista's native L&F certainly isn't supported yet.

  • Need Help to update the labels in the GUI syncronously - Swing application

    Hello everyone,
    I need some help regarding a swing application. I am not able to syncronously update the counters and labels that display on my Swing GUI as the application runs in the background. But when the running of application is completed, then the labels on the GUI are getting updated, But I want update the labels and counters on the GUI syncronously as the code executes... below I am giving the format of the code I have written..............
    public class SwingApp extends JFrame{
            // here i have declared the label and component varibles like...
                      private JTextField startTextField;
           private JComboBox maxComboBox;
           private JTextField logTextField;
           private JTextField searchTextField;
           private JLabel imagesDownloaded1;
           private JLabel imagesDownloaded2;
           private JLabel imagesDidnotDownload1;
           private JLabel imagesDidnotDownload2;
                      private JButton startButton;
    //now in the constructer.............
    public Swing(){
    //I used gridbaglayout and wrote the code for the GUI to appear....
    startButton = new JButton("Start Downloading");
        startButton.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
                 actionSearch();   //actionSearch will contain all the code and the function calls of my application...........
            }catch(Exception e1){
        constraints = new GridBagConstraints();
        constraints.gridwidth = GridBagConstraints.REMAINDER;
        constraints.insets = new Insets(5, 5, 5, 5);
        layout.setConstraints(startButton, constraints);
    //update is a function which initiates a thread which updates the GUI. this function will be called to pass the required variables in the application
    public void update(final int count_hits, final int counter_image_download1, final int didnot_download1) throws Exception{
         Thread thread = new Thread(new Runnable() {
             public void run() {
                  System.out.println("entered into thread");
                  System.out.println("the variable that has to be set is " + count_hits);
                  server_hits_count.setText( " "+ Integer.toString(count_hits));
                  imagesDownloaded2.setText(" " + Integer.toString(counter_image_download1));
                  imagesDidnotDownload2.setText(" " + Integer.toString(didnot_download1));
    //Now in main............................
    public static void main(String[] args){
    Swing s = new Swing();
    }//end of main
    }//end of class SwingAbove I have given the skeleton code of my application........ Please tell me how to update the GUI syncronously...
    Please its a bit urgent...............
    Thank you very much in advance

    First off, note that this question should have been posted in the Swing section.
    GUI events run in a separate thread (the AWT / Event Dispatch Thread) than your program.
    You should be invoking AWT/Swing events via SwingUtilities.invokeLater().
    If for whatever reason you want to have the program thread wait for the event to process
    you can use invokeAndWait().

  • Problem with "find" mode in adf/swing application

    Hi all,
    I'm working on ADF Swing application which uses MS SQL Server 2005 (JDeveloper 10g 10.1.3)
    I think that my issue might be well-known…sorry if it has been already discussed somewhere else…
    I have a problem with the “find” mode for a detail panel in a master-detail form…(To make it clear the “find” mode is switched on when clicking on the special button on a navigation panel).
    So this mode works well in a master panel, but it demonstrates strange behavior on a detail panel, i.e. it takes me two attempts to find the necessary child object and it doesn’t switch back in a simple way from this mode to the normal mode….say if we are in the department 10 (Dept is a master form) we can’t simply find KING employee (Emp is a detail form)…is there any workaround for this?
    Thanks in advance. Alex.

    Hi Frank, please look this issue

  • Problem in Opening HTML Page in Internet Explorer from my Swing Application

    I am opening a HTML file in Internet Explorer from my swing application.I am using the code given below
    private final static String WIN_FLAG = "url.dll,FileProtocolHandler";
    private final static String WIN_PATH = "rundll32";
    String cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
    // url is HTML file Path
    Process p = Runtime.getRuntime().exec( cmd );
    Here there are two things i need to address ...
    1)The HTML file is opening up,but it always opens behind the swing application,that makes me every time to maximize the HTML file after it being opened up.I want to open it in front of the Swing Application.I need to implement "Always On Top" functionality for the html page.
    2)Whenever i trigger action to open different HTML page,it opens in new Internet Explorer window.
    I need to open it in same IE window.
    how to solve out these problems ??? any help would be greatly appreciated .Thanks in advance.
    - Manikandan

    any idea about this ????

  • Where i Put my swing application jar file in jboss

    Hi experts...
    I develope swing application and convert it into jar file....I know jnlp deployment using tomcat..In tomcat i
    put my appcation.jar in webapps/root folder...This is not similar in jboss..I dont know where i put my applcation.jar in jboss.If any body know the idea please let me know..

    You have to put your jar file in
    M Fazal Ur Rehman

  • A database connection in a swing application

    hi ,
    i am developping an intranet stabdalone swing application based on a jdbc connection to oracle8i data server.
    in fact i am interested in keeping my user authentification encrypted while this connection is done! is there any method to do it ! i read about SSL but is it supported by web application ! i have a client-server simple connection !
    please help !

    Hello Levi,
    You can to do this form:
    String appModule = "yourAppmodule";
    String config = "yourAppmodule"+ "Local";
    ApplicationModule am = Configuration.createRootApplicationModule(appModule, config);
    ConnectionMetada cm = am.getTransaction().getConnectionMetadata();
    DriverManager.registerDriver(new OracleDriver());
    Connection connection = DriverManager.getConnection(cm.getJdbcURL());You can to see this threads:
    Retrieve Database Connection
    Getting the Connection object out of ApplicationModule

  • Loading a JPEG into a swing application...

    I need help embedding a JPEG in a swing application(preferrably in it's own container). What should container should I use? Any helpful methods?

    Swing related questions should be posted in the Swing forum.
    Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html]How to Use Icons.

  • My swing application is too slow

    my application is an add-in swing application. It is connect with a posptgres database to show and edit data in this database. The application has about 10 frames and dialog. It run very slow. It may take 20-30 seconds to close a dialog or frame.
    Do you have any hint or suggestion so I can increase the speed of the application.
    I already increase memory to 512m when run the application by using
    I really need help about this issue. Could you please help

    Stop doing all the DB accessing in the event thread?

  • Certificate support in Java Swing application

    Hi There,
    I am new to this Certificate thing and running into issues! Would appreciate for all the help and please ignore for any stupid questions.
    Here is my scenario.
    1. I do have a client server application and client is a java swing application which connects to a Server application (Using Jetty 4.2.22 as embedded server)
    2. Initially, it had a self signed certificate but goal is to support third party certificate (i.e import in the server and then show warning to the client during login)
    If somebody has already done this or point me to some example (using Jetty APIs) that would be great help. If not, here is what I am trying to do and some questions.
    1. I tried to get some free SSL certificate from the web and imported into the server's KeyStore.
    If I do a list from the server using Keystore, this is what it looks like
    keytool -list -keystore /tmp/keystore -storepass genview
    Keystore type: JKS
    Keystore provider: SUN
    Your keystore contains 2 entries
    self, Dec 3, 2008, PrivateKeyEntry,
    Certificate fingerprint (MD5): 0D:58:E8:77:89:09:F8:2B:37:64:37:D5:03:AD:C9:0B
    rapid, Jan 6, 2009, trustedCertEntry,
    Certificate fingerprint (MD5): 64:9C:EF:2E:44:FC:C6:8F:52:07:D0:51:73:8F:CB:3
    QUESTION 1 : why the third party certificate's entry as "trustedCertEntry"? Is it always like this? Do I need to have only one certificate at a time? (If so, just remove the self signed and have 3rd party one)
    My Jetty server comes up but when I connect from Client Swing App, the "getServerCertificates()" method only returns one entry i.e self signed one but not the third party one.
    I am using like this
    URL url = new URL("");
    HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
    Certificate[] certs = conn.getServerCertificates();
    Is not this API supposed to return all the server's certificate?
    Please guide me or instruct me what to do.

    Crossposted and answered.

Maybe you are looking for

  • Tuning HFM

    Hi We recently upgraded our HFM environment from v11.1.1.3 to v11.1.2.2 Upgrade was successful however we are observing following slowness issues in the areas as below : Opening Dataform takes more time,Member selection from Member selection list in

  • Moving project btwn hd's

    good evening have a question that I cannot find elsewhere here...I for some stupid reason moved quite a large 2 hr project onto a USB external hd when i was done with it. Now I have to go back and re-edit some of it. Would it be better to move all th

  • Using a macro to hide an account line when refreshing a report

    let say i have the account "Expense" in cell A1 with values of 10 and 15 in cells B1 and C1. have any of you guys used a macro to do this? is the code fairly simple? basically i dont want to see the "Expense" line if cells B1 and C1 have no value or

  • KO22 internal order budget issue

    Hello All, while making changes for internal order budget with transaction code KO22 the system shows a error as u201CItem order xxxxxx budget exceededu201D & for some orders u2018Item order xxxxxx budget almost exhaustedu201D & also referring to a b

  • Please Help...Start Up Disk

    I have been getting a message that pops up very frequently thats tells me my StartUp Disk is almost full and that I need to Delete Files... I have went through several times and deleted a ton of stuff and have saved only a few things extra other then