AS/400 Toolbox for Java \ GUI classes \ Network print \ Printer lists

VPrinters

A VPrinters object is a resource that represents a list of printers for use in AS/400 panes.

To use a VPrinters object, set the system property. Set this property by using a constructor or through the setSystem() method. The VPrinters object is then "plugged" into the AS/400 pane as the root, using the pane's constructor or setRoot() method.

A VPrinters object has another useful property for defining the set of printers that is presented in AS/400 panes. Use setPrinterFilter() to specify a filter that defines which printers should appear.

When AS/400 pane and VPrinters objects are created, they are initialized to a default state. The list of printers has not been loaded. To load the contents, the caller must explicitly call the load() method on either object.

At run-time, a user can perform actions on any printer list or printer through the pop-up menu. The following action is available for printer lists:

The following actions are available for printers in a printer list:

Users can only access printers to which they are authorized. In addition, the caller can prevent the user from performing actions by using the setAllowActions() method on the pane.

The following example creates a VPrinters object and presents it in an AS400TreePane

                       // Create the VPrinters object.
                       // Assume that "system" is an AS400
                       // object created and initialized
                       // elsewhere.
     VPrinters root = new VPrinters (system);

                       // Create and load an AS400TreePane
                       // object.
     AS400TreePane treePane = new AS400TreePane (root);
     treePane.load ();

                       // Add the tree pane to a frame.
                       // Assume that "frame" is a JFrame
                       // created elsewhere.
     frame.getContentPane ().add (treePane);

Example

Present network print resources using an AS400ExplorerPane with a VPrinters object.

The following image shows the VPrinters graphical user interface component:


[ Information Center Home Page | Feedback ] [ Legal | AS/400 Glossary ]