Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7724707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:45:21+00:00 2026-06-01T04:45:21+00:00

I have for example .pdf file (path to that file). How to open this

  • 0

I have for example .pdf file (path to that file). How to open this file in default application (probably Acrobat Reader) from SWT application (for example on Button click) ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:45:22+00:00Added an answer on June 1, 2026 at 4:45 am

    You should be able to use:

    Program.launch(file);
    

    to open the file (using the default application or creator). From the javadoc:

    Launches the operating system executable associated with the file or URL (http:// or https://). If the file is an executable then the executable is launched. Note that a Display must already exist to guarantee that this method returns an appropriate result.

    Note that there are some peculiarities in Program.launch() (or at least there were, though these may have been fixed in more recent versions of the runtime.) I don’t really remember the specifics of the bugs, but we do some checks to work around some issues:

    1. If you’re on a Unix platform, and you’re specifying an absolute path, there may be trouble opening that file. We prefix absolute paths with /. – so that /tmp/foo would be translated to /./tmp/foo – although I don’t really remember the specifics of this bug any more than that.

    2. On Windows, if you’re trying to open a UNC path – for example \\server\bar – you need to wrap the string in double-quotes. For example: Program.open("\"\\server\bar\"");

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried to open a PDF file from the local disk. For example
i have downloaded this Example code its a pdf reader code, its having a
i need to open a pdf file from my android app. I have the
I have a requirement where there is a URL = http://www.example/Open.pdf Now from my
I have some code that generates a PDF file programmatically and I need to
I have a method that returns a PDF file using DOMPDF . It sends
I'm creating a PDF file from a txt-template with tcpdf ([Example 8][1]). The txt-template
I have a method that generates a PDF file using Reportlab library: def obtenerPDFNuevoPedido(self,
It is sometimes desirable to have your application open the default application for a
I'm trying to digitally sign a PDF file using THIS project as an example.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.