KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > javax > print > attribute > HashPrintRequestAttributeSet

javax.print.attribute
Class HashPrintRequestAttributeSet

java.lang.Object
  extended by javax.print.attribute.HashAttributeSet
      extended by javax.print.attribute.HashPrintRequestAttributeSet
All Implemented Interfaces:
Serializable, AttributeSet, PrintRequestAttributeSet
See Also:
Top Examples, Source Code

public HashPrintRequestAttributeSet()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1060]An applet displaying print service name
By coolsaboo { at } yahoo { dot } com on 2004/10/20 08:33:20  Rate
package printer18102004; 
  
  
 import java.awt.event.*; 
 import java.awt.*; 
 import java.applet.*; 
 import javax.swing.*; 
 import javax.swing.event.*; 
 import java.lang.Object; 
 import javax.print.*; 
 import javax.print.attribute.*; 
 import java.io.*; 
 import javax.print.PrintService; 
 import javax.print.*; 
  
  
 public class Applet1 extends Applet  {  
   private boolean isStandalone = true; 
   JButton jButton1 = new JButton (  ) ; 
   JTextField jTextField1 = new JTextField (  ) ; 
   char a; 
  
  
 //Initialize the applet 
   public void init (  )   {  
    try  {  
       jbInit (  ) ; 
      }  
     catch ( Exception e )   {  
       e.printStackTrace (  ) ; 
      }  
  }  
  
  
  
   //Component initialization 
  
  
  
  
   void jbInit (  )  throws Exception  {  
     jButton1.setText ( "jButton1" ) ; 
  
  
     jButton1.addActionListener ( new Applet1_jButton1_actionAdapter ( this )  ) ; 
     this.add ( jButton1, null ) ; 
     this.add ( jTextField1,null ) ; 
  
  
    }  
  
  
   //Get Applet information 
   public String getAppletInfo (  )   {  
     return "Applet Information"; 
    }  
  
  
   /*public void update ( ActionEvent e )  {  
    update e; 
    } */
 
  
  
   public static void main ( String args [  ]  )  
  {  
  }  
  /* public HashPrintRequestAttributeSet ( PrintRequestAttribute [  ]  attributes )   {  
           super  ( attributes, PrintRequestAttribute.class ) ; 
    } */
 
    
  
  
   void jButton1_actionPerformed ( ActionEvent e )  
          {  
          PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet (  ) ; 
          javax.print.DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE; 
          PrintService defaultService1 = PrintServiceLookup.lookupDefaultPrintService (  ) ; 
 // PrintService defaultService11 = PrintServiceLookup.s ( flavor,pras ) ; 
          this.jTextField1.setText ( defaultService1.getName (  )  ) ; 
           
        //this.jTextField1.setText ( "asd" ) ; 
          //System.out.println ( "abc" ) ; 
          }  
  
  
    }  
  
  
   class Applet1_jButton1_actionAdapter implements java.awt.event.ActionListener  {  
     Applet1 adaptee; 
  
  
     Applet1_jButton1_actionAdapter ( Applet1 adaptee )   {  
       this.adaptee = adaptee; 
      }  
     public void actionPerformed ( ActionEvent e )   {  
       adaptee.jButton1_actionPerformed ( e ) ; 
      }  
    }  
 


public HashPrintRequestAttributeSet(PrintRequestAttribute attribute)
See Also:
NullPointerException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public HashPrintRequestAttributeSet(PrintRequestAttributeSet attributes)
See Also:
ClassCastException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public HashPrintRequestAttributeSet(PrintRequestAttribute[] attributes)
See Also:
NullPointerException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags