java.awt.desktop.PrintFilesEvent Java Examples

The following examples show how to use java.awt.desktop.PrintFilesEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: _AppEventHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
void performUsing(final PrintFilesHandler handler, final _NativeEvent event) {
    // create file list from fileNames
    final List<String> fileNameList = event.get(0);
    final ArrayList<File> files = new ArrayList<File>(fileNameList.size());
    for (final String fileName : fileNameList) files.add(new File(fileName));

    handler.printFiles(new PrintFilesEvent(files));
}
 
Example #2
Source File: PrintCommand.java    From gcs with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public void printFiles(PrintFilesEvent event) {
    for (File file : event.getFiles()) {
        EventQueue.invokeLater(new DeferredPrint(file.toPath()));
    }
}