Open PDF file I have javafx

I need to open a PDF file for javafx. If I use java.awt.Desktop.open (), load all the java awt toolkit? Opening up my system (jnlp) becoming slow?

Hello. GetHostServices () .showDocument () using the Application class.
The following works in Windows.

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import   javafx.application.*;

public class PdfOpen extends Application {

    public static void main(String[] args) {
        launch(args);
        }

    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle("Hello World!");
        Button btn = new Button();
        btn.setText("Say 'Hello World'");

        StackPane root = new StackPane();
        root.getChildren().add(btn);
        primaryStage.setScene(new Scene(root, 300, 250));
        primaryStage.show();

        HostServices hs =  getHostServices();
        hs.showDocument("C:\\DOF.pdf");
    }
}

Tags: Java

Similar Questions

  • I have Acrobat Standard XI and recently downloaded CD Player for a specific use. Reader became my default for open PDF files once it has been installed. How can I get Acrobat Standard to be once more my fault?

    I have Acrobat Standard XI and recently downloaded CD Player for a specific use. Reader became my default for open PDF files once it has been installed. How can I get Acrobat Standard to be once more my fault?

    Hi nancye22519208 ,

    Please right-click on any PDF on your system, then go to properties > under general, you will find "opens with". Here you will see 'change' option, by clicking on it, wil give you a window from which you can choose the Acrobat Standard XI as a default for PDF files.

    Kind regards

    Christian

  • Problem opening pdf files.  I have Acrobat Reader DC/Windows by default, but when I click on the file, a file conversion screen with all these codes. Must use the "open with" function which is a nuisance.  Why it will not default?

    Problem opening pdf files.  I have Acrobat DC/Windows by default, but when I click on the file, a file conversion screen now with all these language codes. Must use the "open with" function which is a nuisance.

    Why it will not open by default when I click on the file?

    Hello

    I guess that you are looking for this:

    Open drive

    Go in Edition > Preferences > General

    Uncheck the option, the online storage see the opening of the files

    Click OK and restart

    Thank you

    Abhishek

  • I have Acrobat Pro XI and want to keep this program as my primary PDF look at an application; I don't want to use Acrobar Reader DC.  How can I disable Acrobat Reader DC to open PDF files?

    I have Acrobat Pro XI and want to keep this program as my primary PDF look at an application; I do not want to use Acrobar Reader DC and try to avoid clouds of"solutions.".  How can I disable Acrobat Reader DC to open PDF files?

    If she runs from a web browser, check your web browser plugins and remove it.

  • Do not open the PDF files I have tried EVERYTHING, nothing works please help

    In the last two weeks, I can't open PDF files in Firefox. They open fine in Internet Explorer. I've been on the support forum now over 2 hours and EVERYTHING suggested tried unsuccessfully. It seems this is a common problem.
    Help, please.


  • Is no longer able to open pdf files in mail, Yosemite 10.10.5 in mail 8.2

    Hello

    After trying to install the 2016-004 security update 10.10.5 I'm more able to open pdf files in the yosemite in 8.2 mail or on our hard drive.

    When you try to install the update, we get the following message:

    "Updates available have changed."

    • We can install is more up-to-date, even if we downloaded.

    • Sent PDF files can only be opened by mail on our iMac

    • This has also affected all PDFs, saved the e-mail to the iMac.

    • All PDFs in mail over the past four years cannot be open-ended.

    • All PDFs over the past four years, saved from mail hard disk cannot be opened by any PDF reader, including preview and Adobe Acrobat.

    Any help appreciated

    Anthony

    Try to install the update mode without failure or another account admin user. If it works, check if you still have the PDF problem. If so, try what is displayed below links Safe Mode.

    Safe mode - subject

    Safe mode - Yosemite

    Make a backup using Time Machine or a cloning program, to ensure that data files can be recovered. Two backups are better than one.

    Try to set up another admin user account to see if the same problem persists. If back to my Mac is enabled in the system Prefeences, the guest account will not work. The intention is to see if it is specific to an account or a system wide problem. This account can be deleted later.

    Isolate a problem by using a different user account

    If the problem is still there, try to start safe mode using your usual account.  Disconnect all devices except those necessary for the test. Shut down the computer and then put it up after a 10 second wait. Immediately after hearing the startup chime, hold down the SHIFT key and continue to hold it until the gray Apple icon and a progress bar appear. Startup is considerably slower than normal. This will reset some caches, forces a check for directory and disables all start-up and connection, among other things. When you restart normally, the initial restart may be slower than normal. If the system is operating normally, there may be 3rd party applications that pose a problem. Try to delete/disable the third-party applications after a reboot using the UN-Installer. For each disable/remove, you need to restart if you do them all at once.

    If it works in safe mode, try to run this program when it is started normally, copy and paste the result in a response. The program was created by Etresoft, a regular contributor.  Use please copy and paste the screenshots can be difficult to read. On the screen with the Options, please open Options and tick the boxes in the bottom 2 before the race. Click on the button "Report share" in the toolbar, select "Copy to Clipboard" and then paste into a response. This will show what is running on your computer. No personal information is shown.

    Etrecheck - Information System

  • I can't open pdf files in firefox, and I tried all the solutions proposed by others. How can I reactivate pdf in firefox?

    I have recently switched to Firefox to Google Chrome, and I find that I can't open all PDFs from the web in some way in Firefox. I can't download them and open them in Adobe Reader and I can't preview them in Firefox, or I can use the plugin from Adobe. I tried to use the solutions posed by users on this site, but none of them have worked. Whenever I have an amendment to the settings to try to resolve this problem, change never allows me to view the pdf file, and the setting reverts to the previous setting after the browser is restarted. I don't like how to display the file, but I need to be be able to see a preview or I need to be able to download it.

    I use an adobe download add-on, 3.0.0.2, and I have disabled. Now, I can actually open pdf files in my browser shows a preview, or download them as I see fit. Thank you!

    But clearly, there is an error with the add-on.

  • Cannot open PDF files

    I have a HP Pavilion desktop pc with card mother at660a and that you just download the latest Mozilla fire fox and now I can't open PDF files when I am still on the web, can I open then, but as soon as I insert in downloads on my drive hard all the that get is a blank page with the exception of the border etc. but no script , by the way this pc has never used Mozilla firefox.
    But when I use internet explore that it's ok, I have Mozilla on my other PC and I have no problem, but they are charged with an earlier version when I try manually open with Adobe reader, he tells me that the file is corrupted hope you can help thank you.

    For some reason, your Firefox is who identified himself as version 9 instead of version 19. If you select help > about Firefox, can you verify that you have version 19.0.2 or click Find updates and get the current version?

    19 of Firefox has an internal PDF Viewer. To switch to a different Viewer, see the following article: How to disable the built-in PDF Viewer and use another Viewer. Note that this does not apply to earlier versions of Firefox.

    Finally, please note that current versions of Adobe Reader 10.1.6 and 11.0.2. For your safety, make sure you have a current version.

  • I can't open PDF files

    I have Adobe Acrobat 9.2 installed. When I receive a PDF file instead of open it using Adobe (as it did in the past) Microsoft Word Viewer takes over and asks me to do a file conversion. Everything goes down hill from there.
    I'm running Vista, I deleted Microsoft Word Viewer under all programs.
    Used to be able to open PDF files without problem.
    If I right click on the file it asks me what program I want to open with; the only option it gives me is OPEN.

    Go to start / Default programs / associate a file or Protocol with a program and highlight .pdf.  Shall be provided to Adobe Reader as the default program, but it probably isn't.  Click on edit, and then see if Adobe Reader is one of the options indicated.  If so, choose it and save your work.  You will now be able to open PDF files.  If Adobe Reader is not one of the options, click Browse and locate the executable file of Adobe Reader (it will be probably somewhere in a subdirectory of the secondary Program Files directory) and select that, like the program by default.  Once again, once done you should be able to once more open the PDF files.  Chances are good that the Microsoft Word Viewer set themselves up as the default for PDF files and now there is noplace to (they have no valid link).  The reason why you have no options to open with, it is that there is probably no configuration of the associations for the PDF files and programs.

    You can also try to uninstall Adobe Reader and then re-install.  That should restore the association and solve the problem.  How to solve the problem, it is up to you.

    I hope this helps.

    Good luck! Lorien - a - MCSE/MCSA/network + / A +.

  • problems trying to open pdf files. said the treatment works cannot open file

    original title: rayexceed

    Hi, I have problems trying to open pdf files. said the treatment works cannot open file. everything worked fine before and when it started I'm not too sure.my security is up to date when I try to open a pdf file, it says file may be damaged and then I press ok and it goes on a blank page in aid of processor.please of work

    Work does not have PDF files. You need Acrobat Reader or Foxit Reader.

  • It can not open PDF files in IE 7 or IE 8.

    It can not open PDF files in IE 7 or IE 8. I have to use firefox. This just started last week. Whenever I try to open a pdf file, IE freezes and no response.

    Are you running IE 7 and IE - 8 on the same computer?  If so, how?

    Uninstall and re - install Adobe Reader should fix.

    Boulder computer Maven
    Most Microsoft Valuable Professional

  • Download and open pdf files

    I keep losing the ability to open, create or download the pdf files?  Why is happening.  My computer within 1 year.

    I keep losing the ability to open, create or download the pdf files?  Why is happening.  My computer within 1 year.

    How do you have "open, create, or download pdf files" in the past?

    You must abdobe reader to open pdf files. Do you have it?
    Here is the link:
    http://get.Adobe.com/reader/

    To create pdf files:
    http://kb2.Adobe.com/CPS/330/330729.html

    t-4-2

  • Cannot open PDF files by e-mail more

    I can't open PDF files in my Outlook email more.  My husband gets his colonies to work via e-mail and for 3 years now I have been open the colonies without problem.  This week, I can't open the file.  I get this error:

    Microsoft Word

    A red x, then "Sorry there was a problem and we can't open the PDF if this product again try to open the PDF file in Microsoft Word"

    Well, I thought it was always open in Word!  Anyway, it is not the drive.  I Sumatra and I can still open the other PDF files.  I even changed my readers just to check and get the same message.  I wrote to Outlook and they said it is not their problem and to post here in the Microsoft Community.  It's very frustrating because we need to see those files.  If she is not Outlook or the PDF reader, what could be the problem?  Thank you!

    Hello

    Please keep us up-to-date and sorry for the inconvenience caused.

    We are aware of this problem and the engineering team working on this and will inform you about the same to as soon as possible.

    Thank you!

  • Why the CD player replace default 'use Acrobat Pro' to open pdf files?

    Had to install the CD player to open online pdf files. Already have Acrobat Pro. After the installation of the drive of DC and despite repeated together "use this application to open pdf files" Acrobat Pro, CD player overrides this setting. Seems so new versions of programs... as, for example, Windows 10... are programmed by nerds who seem to think they know more about what a user wants to that user only. Sites now offer pdf files requiring a CD to open, but this version now seems to have the attitude "to hell with what you want to do." I want only to set Acrobat Pro as my default application to open pdf files. How can I do this? And, Adobe, why do you think that you know better than I what I want? < Nothing new, by the way; I had to do to make the script processing in PhotoShop, because it substitutes for my choices for the target files and your technicians had no idea how to solve this problem, with workarounds.

    Hi brucec3514345,

    Acrobat Reader DC has been defined as the once its installed default PDF Viewer, this is a behavior of design. However, you can change the default program, open Acrobat, navigate to the Edit-> Preferences-> General-> click "set as my default pdf reader.

    Click OK to confirm the changes.

    Kind regards
    Nicos

  • CC of Photoshop won't open PDF files...

    Since the last update (last night) CC Photoshop won't open PDF files...

    It shows an error stating "could not complete your request because of a disk error", but it will not open any PDF any disk, they are stored on.

    JPEG and PSD open correctly.

    Windows 7 Home Premium 64-bit [SP.1]

    I7 - 3770K @ 3.90 GHz

    16 GB of ram

    Hi emilie_bonje_photography,

    Greetings.

    • Here are the existing files that you are talking about.
    • Try to create a new pdf file, see if you are able to save.
    • Once you have completed the steps above, and the PS will always open PDF files not try to reset the PS preferences.

    Concerning

    Rohit

Maybe you are looking for