[Bug 155462] Re: Java doesn't list any printers in cups

2008-12-16 Thread gorgor
*** This bug is a duplicate of bug 156191 ***
https://bugs.launchpad.net/bugs/156191

I' using Java OpenJDK:

$ java -version
java version 1.6.0_0
IcedTea6 1.4 (6b14~pre1-0ubuntu2~intrepid1) Runtime Environment (build 
1.6.0_0-b14)
OpenJDK 64-Bit Server VM (build 11.0-b17, mixed mode)

And I have this issue occuring with Matlab when I'm trying to print:

java.lang.NullPointerException: null attribute
at sun.print.IPPPrintService.isAttributeValueSupported(Unknown Source)
at sun.print.ServiceDialog$OrientationPanel.updateInfo(Unknown Source)
at sun.print.ServiceDialog$PageSetupPanel.updateInfo(Unknown Source)
at sun.print.ServiceDialog.updatePanels(Unknown Source)
at sun.print.ServiceDialog.initPrintDialog(Unknown Source)
at sun.print.ServiceDialog.init(Unknown Source)
at javax.print.ServiceUI.printDialog(Unknown Source)
at 
com.mathworks.page.export.printdlg.Printdlg.setVisible(Printdlg.java:470)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at 
com.mathworks.jmi.AWTUtilities$Invoker$2.runWithOutput(AWTUtilities.java:432)
at com.mathworks.jmi.AWTUtilities$Invoker$1.run(AWTUtilities.java:389)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

-- 
Java doesn't list any printers in cups
https://bugs.launchpad.net/bugs/155462
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 155462] Re: Java doesn't list any printers in cups

2007-11-11 Thread Yan Li
*** This bug is a duplicate of bug 156191 ***
https://bugs.launchpad.net/bugs/156191

I observed same problem on my Gutsy 7.10 installation. The printing of
Java applications doesn't work. It's a rather annoying problem.

System: x86 on a IBM ThinkPad T43p.

How to reproduce: Open any Java program (I tried Freemind and some
others) and try to print.

Expect: Printing dialog appear on GUI

Actual: Nothing happens on GUI (no error message), however, I found following 
exception text appeared on console:
Exception in thread AWT-EventQueue-0 java.lang.NullPointerException: null 
attribute
at 
sun.print.IPPPrintService.isAttributeValueSupported(IPPPrintService.java:1147)
at 
sun.print.ServiceDialog$OrientationPanel.updateInfo(ServiceDialog.java:2121)
at 
sun.print.ServiceDialog$PageSetupPanel.updateInfo(ServiceDialog.java:1263)
at sun.print.ServiceDialog.updatePanels(ServiceDialog.java:437)
at sun.print.ServiceDialog.initPrintDialog(ServiceDialog.java:195)
at sun.print.ServiceDialog.init(ServiceDialog.java:124)
at javax.print.ServiceUI.printDialog(ServiceUI.java:188)
at sun.print.RasterPrinterJob.printDialog(RasterPrinterJob.java:855)
at sun.print.PSPrinterJob.printDialog(PSPrinterJob.java:421)
at 
freemind.controller.Controller$PrintAction.actionPerformed(Controller.java:870)
at 
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at 
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at 
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at 
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at 
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1216)
at 
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1257)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at 
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Packages installed:
ii  sun-java6-bin  6-03-0ubuntu2
Sun Java(TM) Runtime Environment (JRE) 6 (arch
ii  sun-java6-doc  6-03-0ubuntu2
Sun JDK(TM) Documention -- integration install
ii  sun-java6-jre  6-03-0ubuntu2
Sun Java(TM) Runtime Environment (JRE) 6 (arch
ii  sun-java6-plugin   6-03-0ubuntu2
The Java(TM) Plug-in, Java SE 6
ii  bluez-cups 3.19-0ubuntu3
Bluetooth printer driver for CUPS
ii  cups-pdf   2.4.6-3ubuntu10  
PDF printer for CUPS
ii  cupsys 1.3.2-1ubuntu7.1 
Common UNIX Printing System(tm) - server
ii  cupsys-bsd 1.3.2-1ubuntu7.1 
Common UNIX Printing System(tm) - BSD commands
ii  cupsys-client  1.3.2-1ubuntu7.1 
Common UNIX Printing System(tm) - client progr
ii  cupsys-common  1.3.2-1ubuntu7.1 
Common UNIX Printing System(tm) - common files
ii  cupsys-driver-gutenprint   5.0.1-0ubuntu8   
printer drivers for CUPS
ii  hal-cups-utils 0.6.13+svn83-0ubuntu1
CUPS integration with HAL
ii  libcupsimage2

[Bug 155462] Re: Java doesn't list any printers in cups

2007-10-28 Thread Arnaud Blouin
*** This bug is a duplicate of bug 156191 ***
https://bugs.launchpad.net/bugs/156191

** This bug has been marked a duplicate of bug 156191
   Printing from Java does not work at all in Gutsy

-- 
Java doesn't list any printers in cups
https://bugs.launchpad.net/bugs/155462
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 155462] Re: Java doesn't list any printers in cups

2007-10-22 Thread Miguel Costa
** Description changed:

  This applies to a current Gutsy Gibbon amd64 installation 
  I have installed Java 1.5 from the repositories 
  
- Printing from any java application (e.g. Netbeans, Jedit) to a CUPS printer 
does not work 
+ Printing from any java application (e.g. Netbeans, Jedit) to a CUPS printer 
does not show the print dialog
  by compiling and running the following code i can't get any printers listed.
  
  import javax.print.PrintService;  import
  javax.print.attribute.Attribute;  import
  javax.print.attribute.standard.PrinterIsAcceptingJobs;  /*   *  *
  TestPrinter.java   *  *   *  * Created on 26 de Setembro de 2007, 14:52
  *  *   *  * To change this template, choose Tools | Template Manager   *
  * and open the template in the editor.   *  *//**   *  *   *  *
  @author carlos   *  */  public class TestPrinter  {   /** Creates a
  new instance of TestPrinter */   public TestPrinter() { } public
  static boolean checkAvailablePrinters(){PrintService[] ss =
  java.awt.print.PrinterJob.lookupPrintServices();for (int
  i=0;iss.length;i++) { System.out.println( ss[i].getName() + \n
   + ss[i] ); Attribute[] att = ss[i].getAttributes().toArray();
  for (int j=0;jatt.length;j++)  {  if (att[j].equals(
  PrinterIsAcceptingJobs.ACCEPTING_JOBS ) )   {
  System.out.println( ACCEPTING JOBS );  } }}return
  false;   }   public static void main( String[] args )   {
  checkAvailablePrinters();   }}
  
  
  by running the following command, the printers are listed
  
  [EMAIL PROTECTED]:~$ lpstat -t
  programador em execução
  destino predefinido de sistema: XKPrinter
  periférico para XKPrinter: usb://HP/LaserJet%201022
  periférico para XKPrinter_Cores: usb://EPSON/Stylus%20CX3600
  periférico para XKPrinter_PDF: cups-pdf:/
  XKPrinter aceita pedidos desde Dom 21 Out 2007 18:46:10 WEST
  XKPrinter_Cores aceita pedidos desde Sáb 20 Out 2007 23:44:10 WEST
  XKPrinter_PDF aceita pedidos desde Sáb 28 Abr 2007 19:41:52 WEST
  impressora XKPrinter inactiva.  activada desde Dom 21 Out 2007 18:46:10 WEST
  impressora XKPrinter_Cores desactivada desde Sáb 20 Out 2007 23:44:10 WEST -
+ 
+ Updated: I can list the printers by using that java code with jre-7
+ beta, but still can't see any print dialog when i try to print any
+ document with any java application.

-- 
Java doesn't list any printers in cups
https://bugs.launchpad.net/bugs/155462
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 155462] Re: Java doesn't list any printers in cups

2007-10-22 Thread Miguel Costa
** Description changed:

  This applies to a current Gutsy Gibbon amd64 installation 
  I have installed Java 1.5 from the repositories 
  
  Printing from any java application (e.g. Netbeans, Jedit) to a CUPS printer 
does not show the print dialog
  by compiling and running the following code i can't get any printers listed.
  
  import javax.print.PrintService;  import
  javax.print.attribute.Attribute;  import
  javax.print.attribute.standard.PrinterIsAcceptingJobs;  /*   *  *
  TestPrinter.java   *  *   *  * Created on 26 de Setembro de 2007, 14:52
  *  *   *  * To change this template, choose Tools | Template Manager   *
  * and open the template in the editor.   *  *//**   *  *   *  *
  @author carlos   *  */  public class TestPrinter  {   /** Creates a
  new instance of TestPrinter */   public TestPrinter() { } public
  static boolean checkAvailablePrinters(){PrintService[] ss =
  java.awt.print.PrinterJob.lookupPrintServices();for (int
  i=0;iss.length;i++) { System.out.println( ss[i].getName() + \n
   + ss[i] ); Attribute[] att = ss[i].getAttributes().toArray();
  for (int j=0;jatt.length;j++)  {  if (att[j].equals(
  PrinterIsAcceptingJobs.ACCEPTING_JOBS ) )   {
  System.out.println( ACCEPTING JOBS );  } }}return
  false;   }   public static void main( String[] args )   {
  checkAvailablePrinters();   }}
  
  
  by running the following command, the printers are listed
  
  [EMAIL PROTECTED]:~$ lpstat -t
  programador em execução
  destino predefinido de sistema: XKPrinter
  periférico para XKPrinter: usb://HP/LaserJet%201022
  periférico para XKPrinter_Cores: usb://EPSON/Stylus%20CX3600
  periférico para XKPrinter_PDF: cups-pdf:/
  XKPrinter aceita pedidos desde Dom 21 Out 2007 18:46:10 WEST
  XKPrinter_Cores aceita pedidos desde Sáb 20 Out 2007 23:44:10 WEST
  XKPrinter_PDF aceita pedidos desde Sáb 28 Abr 2007 19:41:52 WEST
  impressora XKPrinter inactiva.  activada desde Dom 21 Out 2007 18:46:10 WEST
  impressora XKPrinter_Cores desactivada desde Sáb 20 Out 2007 23:44:10 WEST -
  
  Updated: I can list the printers by using that java code with jre-7
  beta, but still can't see any print dialog when i try to print any
- document with any java application.
+ document with any java application. I get only the following output when
+ i try to run this hello world printing function
+ 
+ /*
+  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions are met:
+  *
+  * -Redistribution of source code must retain the above copyright notice, this
+  *  list of conditions and the following disclaimer.
+  *
+  * -Redistribution in binary form must reproduce the above copyright notice,
+  *  this list of conditions and the following disclaimer in the documentation
+  *  and/or other materials provided with the distribution.
+  *
+  * Neither the name of Sun Microsystems, Inc. or the names of contributors may
+  * be used to endorse or promote products derived from this software without
+  * specific prior written permission.
+  *
+  * This software is provided AS IS, without a warranty of any kind. ALL
+  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+  * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
+  * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. (SUN)
+  * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
+  * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+  * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
+  * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
+  * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
+  * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
+  * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+  *
+  * You acknowledge that this software is not designed, licensed or intended
+  * for use in the design, construction, operation or maintenance of any
+  * nuclear facility.
+  */
+ 
+ import java.awt.*;
+ import java.awt.event.*;
+ import javax.swing.*;
+ import java.awt.print.*;
+ 
+ public class HelloWorldPrinter implements Printable, ActionListener {
+ 
+ 
+ public int print(Graphics g, PageFormat pf, int page) throws
+ PrinterException {
+ 
+ if (page  0) { /* We have only one page, and 'page' is zero-based */
+ return NO_SUCH_PAGE;
+ }
+ 
+ /* User (0,0) is typically outside the imageable area, so we must
+  * translate by the X and Y values in the PageFormat to avoid clipping
+  */
+ Graphics2D g2d = (Graphics2D)g;
+ g2d.translate(pf.getImageableX(), pf.getImageableY());
+ 
+ /* 

[Bug 155462] Re: Java doesn't list any printers in cups

2007-10-22 Thread Miguel Costa
** Description changed:

  This applies to a current Gutsy Gibbon amd64 installation 
  I have installed Java 1.5 from the repositories 
  
  Printing from any java application (e.g. Netbeans, Jedit) to a CUPS printer 
does not show the print dialog
  by compiling and running the following code i can't get any printers listed.
  
  import javax.print.PrintService;  import
  javax.print.attribute.Attribute;  import
  javax.print.attribute.standard.PrinterIsAcceptingJobs;  /*   *  *
  TestPrinter.java   *  *   *  * Created on 26 de Setembro de 2007, 14:52
  *  *   *  * To change this template, choose Tools | Template Manager   *
  * and open the template in the editor.   *  *//**   *  *   *  *
  @author carlos   *  */  public class TestPrinter  {   /** Creates a
  new instance of TestPrinter */   public TestPrinter() { } public
  static boolean checkAvailablePrinters(){PrintService[] ss =
  java.awt.print.PrinterJob.lookupPrintServices();for (int
  i=0;iss.length;i++) { System.out.println( ss[i].getName() + \n
   + ss[i] ); Attribute[] att = ss[i].getAttributes().toArray();
  for (int j=0;jatt.length;j++)  {  if (att[j].equals(
  PrinterIsAcceptingJobs.ACCEPTING_JOBS ) )   {
  System.out.println( ACCEPTING JOBS );  } }}return
  false;   }   public static void main( String[] args )   {
  checkAvailablePrinters();   }}
  
  
  by running the following command, the printers are listed
  
  [EMAIL PROTECTED]:~$ lpstat -t
  programador em execução
  destino predefinido de sistema: XKPrinter
  periférico para XKPrinter: usb://HP/LaserJet%201022
  periférico para XKPrinter_Cores: usb://EPSON/Stylus%20CX3600
  periférico para XKPrinter_PDF: cups-pdf:/
  XKPrinter aceita pedidos desde Dom 21 Out 2007 18:46:10 WEST
  XKPrinter_Cores aceita pedidos desde Sáb 20 Out 2007 23:44:10 WEST
  XKPrinter_PDF aceita pedidos desde Sáb 28 Abr 2007 19:41:52 WEST
  impressora XKPrinter inactiva.  activada desde Dom 21 Out 2007 18:46:10 WEST
  impressora XKPrinter_Cores desactivada desde Sáb 20 Out 2007 23:44:10 WEST -
  
  Updated: I can list the printers by using that java code with jre-7
  beta, but still can't see any print dialog when i try to print any
  document with any java application. I get only the following output when
  i try to run this hello world printing function
  
  /*
   * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * -Redistribution of source code must retain the above copyright notice, this
   *  list of conditions and the following disclaimer.
   *
   * -Redistribution in binary form must reproduce the above copyright notice,
   *  this list of conditions and the following disclaimer in the documentation
   *  and/or other materials provided with the distribution.
   *
   * Neither the name of Sun Microsystems, Inc. or the names of contributors may
   * be used to endorse or promote products derived from this software without
   * specific prior written permission.
   *
   * This software is provided AS IS, without a warranty of any kind. ALL
   * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
   * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
   * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. (SUN)
   * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
   * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
   * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
   * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
   * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
   * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
   * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
   *
   * You acknowledge that this software is not designed, licensed or intended
   * for use in the design, construction, operation or maintenance of any
   * nuclear facility.
   */
  
  import java.awt.*;
  import java.awt.event.*;
  import javax.swing.*;
  import java.awt.print.*;
  
  public class HelloWorldPrinter implements Printable, ActionListener {
  
  
  public int print(Graphics g, PageFormat pf, int page) throws
  PrinterException {
  
  if (page  0) { /* We have only one page, and 'page' is zero-based */
  return NO_SUCH_PAGE;
  }
  
  /* User (0,0) is typically outside the imageable area, so we must
   * translate by the X and Y values in the PageFormat to avoid clipping
   */
  Graphics2D g2d = (Graphics2D)g;
  g2d.translate(pf.getImageableX(), pf.getImageableY());
  
  /* Now we perform our rendering */
  

[Bug 155462] Re: Java doesn't list any printers in cups

2007-10-22 Thread Miguel Costa
** Description changed:

  This applies to a current Gutsy Gibbon amd64 installation 
  I have installed Java 1.5 from the repositories 
  
  Printing from any java application (e.g. Netbeans, Jedit) to a CUPS printer 
does not show the print dialog
  by compiling and running the following code i can't get any printers listed.
  
  import javax.print.PrintService;  import
  javax.print.attribute.Attribute;  import
  javax.print.attribute.standard.PrinterIsAcceptingJobs;  /*   *  *
  TestPrinter.java   *  *   *  * Created on 26 de Setembro de 2007, 14:52
  *  *   *  * To change this template, choose Tools | Template Manager   *
  * and open the template in the editor.   *  *//**   *  *   *  *
  @author carlos   *  */  public class TestPrinter  {   /** Creates a
  new instance of TestPrinter */   public TestPrinter() { } public
  static boolean checkAvailablePrinters(){PrintService[] ss =
  java.awt.print.PrinterJob.lookupPrintServices();for (int
  i=0;iss.length;i++) { System.out.println( ss[i].getName() + \n
   + ss[i] ); Attribute[] att = ss[i].getAttributes().toArray();
  for (int j=0;jatt.length;j++)  {  if (att[j].equals(
  PrinterIsAcceptingJobs.ACCEPTING_JOBS ) )   {
  System.out.println( ACCEPTING JOBS );  } }}return
  false;   }   public static void main( String[] args )   {
  checkAvailablePrinters();   }}
  
  
  by running the following command, the printers are listed
  
  [EMAIL PROTECTED]:~$ lpstat -t
  programador em execução
  destino predefinido de sistema: XKPrinter
  periférico para XKPrinter: usb://HP/LaserJet%201022
  periférico para XKPrinter_Cores: usb://EPSON/Stylus%20CX3600
  periférico para XKPrinter_PDF: cups-pdf:/
  XKPrinter aceita pedidos desde Dom 21 Out 2007 18:46:10 WEST
  XKPrinter_Cores aceita pedidos desde Sáb 20 Out 2007 23:44:10 WEST
  XKPrinter_PDF aceita pedidos desde Sáb 28 Abr 2007 19:41:52 WEST
  impressora XKPrinter inactiva.  activada desde Dom 21 Out 2007 18:46:10 WEST
  impressora XKPrinter_Cores desactivada desde Sáb 20 Out 2007 23:44:10 WEST -
  
  Updated: I can list the printers by using that java code with jre-7
  beta, but still can't see any print dialog when i try to print any
  document with any java application. I get only the following output when
  i try to run this hello world printing function
  
  /*
   * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * -Redistribution of source code must retain the above copyright notice, this
   *  list of conditions and the following disclaimer.
   *
   * -Redistribution in binary form must reproduce the above copyright notice,
   *  this list of conditions and the following disclaimer in the documentation
   *  and/or other materials provided with the distribution.
   *
   * Neither the name of Sun Microsystems, Inc. or the names of contributors may
   * be used to endorse or promote products derived from this software without
   * specific prior written permission.
   *
   * This software is provided AS IS, without a warranty of any kind. ALL
   * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
   * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
   * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. (SUN)
   * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
   * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
   * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
   * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
   * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
   * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
   * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
   *
   * You acknowledge that this software is not designed, licensed or intended
   * for use in the design, construction, operation or maintenance of any
   * nuclear facility.
   */
  
  import java.awt.*;
  import java.awt.event.*;
  import javax.swing.*;
  import java.awt.print.*;
  
  public class HelloWorldPrinter implements Printable, ActionListener {
  
  
  public int print(Graphics g, PageFormat pf, int page) throws
  PrinterException {
  
  if (page  0) { /* We have only one page, and 'page' is zero-based */
  return NO_SUCH_PAGE;
  }
  
  /* User (0,0) is typically outside the imageable area, so we must
   * translate by the X and Y values in the PageFormat to avoid clipping
   */
  Graphics2D g2d = (Graphics2D)g;
  g2d.translate(pf.getImageableX(), pf.getImageableY());
  
  /* Now we perform our rendering */