java.awt Code Samples
- How do I Read Image File?
- How do I create a beep sound?
- How do I create key press event using Robot class?
- How do I create mouse event using Robot class?
- How do I get the colour of a screen pixel?
- How do I create a screen capture using Robot class?
- How do I get my screen size?
- How do I get the available font names?
- How do I get the available font family names?
- How do I get the location of mouse pointer?
- How do I get screen's display mode information?
- How do I get number of available screens?
- How do I get mouse number of buttons?
- How do I turn the Num Lock button on?
Page of 2 |
Prev
|
Next
How do I print a file using the default registered application?
The example code below show you how to print a file using the default registered application's print command for the corresponding file type. To do the printing we call the Desktop.print(File file) method.
Running the program on Windows operating system will open for instance a notepad.exe and print the data.txt file.
