The users and groups components in the vaccess package allow you to present lists of server users and groups through the VUser class.
The following components are available:
AS400Pane and VUserList objects can be used together to present many views of the list. They can also be used to allow the user to select users and groups.
To use a VUserList, you must first set the system property. Set this property by using a constructor or through the setSystem() method. The VUserList object is then "plugged" into the AS400Pane as the root, using the constructor or setRoot() method of the AS400Pane.
VUserList has some other useful properties for defining the set of users and groups that are presented in AS400Panes:
You can use the VUserAndGroup object to get information about the Users and Groups on the system. Before you can get information about a particular object, you need to load the information so that it can be accessed. You can display the server in which the information is found by using the getSystem method.
When AS400Pane objects and VUserList or VUserAndGroup objects are created, they are initialized to a default state. The list of users and groups has not been loaded. To load the contents, the Java program must explicitly call the load() method on either object to initiate communication to the server to gather the contents of the list.
At run-time, right-click a user, user list, or group to display the shortcut menu. Select Properties from the shortcut menu to perform actions on the selected object:
Users can only access users and groups to which they are authorized. In addition, the Java program can prevent the user from performing actions by using the setAllowActions() method on the pane.
// Create the VUserList object. // Assume that "system" is an AS400 // object created and initialized // elsewhere. VUserList root = new VUserList (system); // Create and load an // AS400DetailsPane object. AS400DetailsPane detailsPane = new AS400DetailsPane (root); detailsPane.load (); // Add the details pane to a frame. // Assume that "frame" is a JFrame // created elsewhere. frame.getContentPane ().add (detailsPane);The following example shows how to use the VUserAndGroup object:
// Create the VUserAndGroup object. // Assume that "system" is an AS400 object created and initialized elsewhere. VUserAndGroup root = new VUserAndGroup(system); // Create and Load an AS400ExplorerPane AS400ExplorerPane explorerPane = new AS400ExplorerPane(root); explorerPane.load(); // Add the explorer pane to a frame // Assume that "frame" is a JFrame created elsewhere frame.getContentPane().add(explorerPane);Other Examples
Present a list of users on the system using an AS400ListPane with a VUserList object.
The following image shows the VUserList graphical user interface component: