public class

ServiceDialog

extends JDialog
implements ActionListener
java.lang.Object
   ↳ java.awt.Component
     ↳ java.awt.Container
       ↳ java.awt.Window
         ↳ java.awt.Dialog
           ↳ javax.swing.JDialog
             ↳ sun.print.ServiceDialog

Class Overview

A class which implements a cross-platform print dialog.

Summary

Constants
int APPROVE Approve print status (user activated "Print" or "OK").
int CANCEL Cancel print status (user activated "Cancel");
int WAITING Waiting print status (user response pending).
[Expand]
Inherited Constants
From class java.awt.Component
From interface java.awt.image.ImageObserver
From interface javax.swing.WindowConstants
[Expand]
Inherited Fields
From class javax.swing.JDialog
From class java.awt.Dialog
Public Constructors
ServiceDialog(GraphicsConfiguration gc, int x, int y, PrintService[] services, int defaultServiceIndex, DocFlavor flavor, PrintRequestAttributeSet attributes, Dialog dialog)
Constructor for the "standard" print dialog (containing all relevant tabs)
ServiceDialog(GraphicsConfiguration gc, int x, int y, PrintService[] services, int defaultServiceIndex, DocFlavor flavor, PrintRequestAttributeSet attributes, Frame frame)
Constructor for the "standard" print dialog (containing all relevant tabs)
ServiceDialog(GraphicsConfiguration gc, int x, int y, PrintService ps, DocFlavor flavor, PrintRequestAttributeSet attributes, Dialog dialog)
Constructor for the solitary "page setup" dialog
ServiceDialog(GraphicsConfiguration gc, int x, int y, PrintService ps, DocFlavor flavor, PrintRequestAttributeSet attributes, Frame frame)
Constructor for the solitary "page setup" dialog
Public Methods
void actionPerformed(ActionEvent e)
Invoked when an action occurs.
void dispose(int status)
Sets the current status flag for the dialog and disposes it (thus returning control of the parent frame back to the user)
PrintRequestAttributeSet getAttributes()
Returns an AttributeSet based on whether or not the user cancelled the dialog.
static String getMsg(String key)
Returns message string from resource
PrintService getPrintService()
Returns a PrintService based on whether or not the user cancelled the dialog.
int getStatus()
Returns the current status of the dialog (whether the user has selected the "Print" or "Cancel" button)
static void initResource()
Initialize ResourceBundle
static void showNoPrintService(GraphicsConfiguration gc)
Creates a pop-up dialog for "no print service"
[Expand]
Inherited Methods
From class javax.swing.JDialog
From class java.awt.Dialog
From class java.awt.Window
From class java.awt.Container
From class java.awt.Component
From class java.lang.Object
From interface java.awt.MenuContainer
From interface java.awt.event.ActionListener
From interface java.awt.image.ImageObserver
From interface javax.accessibility.Accessible
From interface javax.swing.RootPaneContainer

Constants

public static final int APPROVE

Approve print status (user activated "Print" or "OK").

Constant Value: 1 (0x00000001)

public static final int CANCEL

Cancel print status (user activated "Cancel");

Constant Value: 2 (0x00000002)

public static final int WAITING

Waiting print status (user response pending).

Constant Value: 0 (0x00000000)

Public Constructors

public ServiceDialog (GraphicsConfiguration gc, int x, int y, PrintService[] services, int defaultServiceIndex, DocFlavor flavor, PrintRequestAttributeSet attributes, Dialog dialog)

Constructor for the "standard" print dialog (containing all relevant tabs)

public ServiceDialog (GraphicsConfiguration gc, int x, int y, PrintService[] services, int defaultServiceIndex, DocFlavor flavor, PrintRequestAttributeSet attributes, Frame frame)

Constructor for the "standard" print dialog (containing all relevant tabs)

public ServiceDialog (GraphicsConfiguration gc, int x, int y, PrintService ps, DocFlavor flavor, PrintRequestAttributeSet attributes, Dialog dialog)

Constructor for the solitary "page setup" dialog

public ServiceDialog (GraphicsConfiguration gc, int x, int y, PrintService ps, DocFlavor flavor, PrintRequestAttributeSet attributes, Frame frame)

Constructor for the solitary "page setup" dialog

Public Methods

public void actionPerformed (ActionEvent e)

Invoked when an action occurs.

public void dispose (int status)

Sets the current status flag for the dialog and disposes it (thus returning control of the parent frame back to the user)

public PrintRequestAttributeSet getAttributes ()

Returns an AttributeSet based on whether or not the user cancelled the dialog. If the user selected "Print" we return their new selections, otherwise we return the attributes that were passed in initially.

public static String getMsg (String key)

Returns message string from resource

public PrintService getPrintService ()

Returns a PrintService based on whether or not the user cancelled the dialog. If the user selected "Print" we return the user's selection for the PrintService, otherwise we return null.

public int getStatus ()

Returns the current status of the dialog (whether the user has selected the "Print" or "Cancel" button)

public static void initResource ()

Initialize ResourceBundle

public static void showNoPrintService (GraphicsConfiguration gc)

Creates a pop-up dialog for "no print service"