In my program, i use paperclips. But, when a user don´t have a printer installed in the system, the program exits.
Is there any form , i can detect if the user has a printer installed??? Thanks!!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Maybe it would be better to use s.th. like this to avoid NullPointerException
if (Printer.getDefaultPrinterData() == null)
{
// no printer installed
// From swt help: Returns a PrinterData object representing the default printer or
// null if there is no printer available on the System.
}
Regards,
KewlWater
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello!!!
In my program, i use paperclips. But, when a user don´t have a printer installed in the system, the program exits.
Is there any form , i can detect if the user has a printer installed??? Thanks!!!
Hi,
SWT offers methods to check if a printer is installed or not... e.g.
if (Printer.getPrinterList().length == 0)
{
// no printer installed
}
Regards,
CoolWater
OK.Thanks .. I' ll try that. Thanks for your fast reply...
Maybe it would be better to use s.th. like this to avoid NullPointerException
if (Printer.getDefaultPrinterData() == null)
{
// no printer installed
// From swt help: Returns a PrinterData object representing the default printer or
// null if there is no printer available on the System.
}
Regards,
KewlWater