What's the equivalent of Choice() in Swing

What's the equivalent of java.awt.Choice() in javax.swing?
I've been stuck on that one for a while.
Thank you

Here is a link showing all the Swing components:
http://java.sun.com/docs/books/tutorial/uiswing/components/components.html
Take some time to go through the Table of Contents as well. Its a great introduction to Swing.

Similar Messages

  • What is the equivalent selection in BI7? (Following BW 3.5 How to...Set up

    Hi,
    What is the equivalent selection in BI7? (Following BW 3.5 How to...Set up BW Statistics)
    I am trying to install BW statistics and all the good things that come with it for BI7. Following the instructions in a document that I was directed to on this site, in SBIW, I installed and replicated all the datasource in under “TCT” tree (Technical content)
    The instruction is for versions prior to BI7 and I had to make modifications as I go.
    Now, this instruction direct me to go to:
    rsa1, “Bi Content” (left) and then “InfoProviders by InfoAreas” and select all InfoProviders for the InfoAreas ”BW Statistics” and “BW Metadata” under the node “Technical Content”.
    1.
    In BI7, there is no ”BW Statistics” and “BW Metadata” infoareas under “Technical Content” if I follow the directions strictly.
    What is the equivalent of this in BI7?
    2.
    In the instructions, the author continues to collect these InfoAreas from under “Technical Content”:
    BW Data Slice
    BW Features characteristics
    BW Metadata
    BW Statistics
    In BI7, do we need exactly these? Or, now different? Should I just transfer all the infoareas under “Technical Content”? What is the disadvantage of collecting a ALL?
    Thanks

    Thanks for the link and i believe it will come in handing.
    Yet, it does not have the step by step installation information on page 46 of this link:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c8c4d794-0501-0010-a693-918a17e663cc
    Do you have the BI7 version of this link?
    Also, ssame stewise info is on page 4 of this:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5401ab90-0201-0010-b394-99ffdb15235b   
    If you have the BI7 version of this link also, it will answer my question.
    Thanks

  • What is the equivalent for 'On Change of' Event in ABAP OBJECTS?

    What is the equivalent for 'On Change of' Event in ABAP OBJECTS?  and how to use it in LOOP control?

    hi,
    There is no such Equivalent in OO ABAP.
    You have to Raise your own Event within tha class checking the value of the field whose value is changing.
    Regards
    Sumit Agarwal

  • What is the equivalent function of this...

    the following codes are in awt form, what are the equivalent swt form of the following function? thank you for your help
    ActionListener listener = new MenuItemActionListener(panel);
    *MenuItemActionListener(panel); is the awt
    Component parent; (Component is the awt)
    and using Color.<what_color>
    Again thank you!

    if you're planning on coming here getting the forum to re-write all your awt code in swt bit by bit, forget it. as far as I know, there's only 2 or 3 people who post here that know swt, and nobody's in the business of rewriting code on other people's behalf anyway. the swt documentation that comes with eclipse, plus the javadocs for swt, are more than good enough for you to manage this

  • What is the equivalent subtype of 'Text'?

    Hi experts,
    i have created one field using 'user defined field-management' menu with "type alphanumeric and structure text". now i want to create that field by code. so, i have selected oUserFieldsMD.Type = SAPbobsCOM.BoFieldTypes.db_Alpha but the option for subtype "text" is not coming in intellisense.
    so, what is the equivalent subtype for structure "text".
    Thanking
    Vishwajit Kumar

    It's actually a strange one - it's not a subtype in the DI for some reason, it appears as a main type under "Memo"
    oUserFieldsMD.Type = SAPbobsCOM.BoFieldTypes.db_Memo
    That will get you what you require it will appear in B1 as type alphanumeric and subtype text! Like I said, it's a weird one

  • What is the Equivalent tool of CHDBPASS in NetWeaver 7

    I want to change the password of SYSTEM  and SYS in NetWeaver 7. What is the Equivalent tool of CHDBPASS in NetWeaver 7
    Edited by: Sebastian Sebaraj on Apr 3, 2008 3:34 PM

    Hai,
    For the SAP BASIS >= Release 6.10:
    Use the oradbusr.sql script. This script is attached to the note 50088. The script is valid for Oracle and Unix. Use the following syntax
               sqlplus /NOLOG @oradbusr. sql SCHEMAOWNER UNIX SAP_SID x
    The SCHEMAOWNER is either SAPR3 or has to start with SAP followed by the three digit schema id (example: SAPPRD).
    On Unix x is a dummy parameter and may e. g. be set to  X.
    To change the password for the SAPR3 or SAP<SID> user you have to use the following command:
               brconnect -u system/<syst_pwd> -f chpass -o SAPR3 -p <new_sap_pwd>
    or
               brconnect -u system/<syst_pwd> -f chpass -o sap< sid> -p <new_sap_pwd>
    Thanks and Regards,

  • Help! what is the equivalent focal length of ipad 4 camera?

    what is the equivalent focal length of ipad 4 camera?

    Your apps is not providing enough information.
    I use ExifWizPro App.
    http://i1224.photobucket.com/albums/ee374/Diavonex/51b4d31dae7f841332878c77bfe13 9f1_zpscc0bd8a4.jpg

  • What's the equivalent of Windows' Alt+F in OSX?

    Hi all,
    Noob questions... What's the equivalent of Alt+F (too choose the File menu) in OS X?
    -Al

    Hello again Al,
    Simple answer is:
    *Control+F2 then F-key*
    (or *control+F2 then FI* if there is another menu beginning with an F)
    Enable (keep it permanently enabled) Full Keyboard Access by hitting control+F1.
    Now you can use all control+F commands listed in
    System Preferences > Keyboard & Mouse > Keyboard Shortcuts
    In your "alt+F" equivalent example, here's what you would do:
    Control+F2 then Arrow (left or right) then Arrow Down,
    and you can also type the first letter(s) of a command's name:
    Example in Safari, File menu:
    hit "P" to get "Page Setup"
    or
    hit "PR" to get "Print"
    Return key commands the action itself once you've reached it.
    Axel

  • What is the equivalent Windows laptop?

    What's the best Windows laptop equivalent to the MBP 15.4"? My vote goes to the Thinkpad T60p.

    sigh
    He asked what's the equivalent. When people ask for the "equivalent", they mean comparable hardware at a similar price. Most techies (who are what Apple's trying to court right now) will want to see similar specs, maybe compare weights, size, etc. We don't really care about immeasurable things like "design" and relatively useless stuff like the "patent pending magnetic power connector" (I have never, ever tripped over my laptops' wires. Neither has my family. And over the course of the last 10 years I've owned 6 laptops).
    As for trying to compare, if you honestly don't know what you're talking about, please don't speak. Dual Athlons are not the equivalent of an Intel Core Duo. Dual Athlons are a lot faster and guzzle tremendous amounts of energy. If you want to make a valid comparison, look at the Inspiron 9300 with Core Duo and a similar video card.
    Please don't let the reality distortion field and marketingspeak affect what you say to others. This is a big year for Apple to court us geeks, and we really, REALLY don't like the reality distortion field and marketingspeak. Just give us specs and benchmarks. Thanks.

  • What is the best way to use Swing GUIs in an MVC design?

    I have a question on how to build an application using swing frames for the UI, but using an MVC architecture. I've checked the rest of the forum, but not found an answer to my question that meets my needs.
    My application at this stage presents a login screen to get the userid and password, or to allow the user to choose a new locale. If an Enter action is performed, the userid and password are checked against the DB. If not accepted, the screen is repainted with a "try-again" message. If the Cancel action is performed, the process stops. If a locale action is performed, the screen is repainted with different langauge labels. Once the login process is passed, a front screen (another swing frame) is presented.
    Implementation: I am using a session object (Session, represents the user logging in) that calls the Login screen (LoginGUI, a Swing JFrame object with various components). Session uses setters in LoginGUI to set the labels, initial field entries etc, before enabling the screen. From this point, the user will do something with the LoginGUI screen - could be closing the window, entering a mix of userid and password, or maybe specifying a locale. Once the user has taken the action, if required, the session object can use getters to retrieve the userid and password values entered in the fields.
    The crux of the problem is 1) how will Session know that an action has been taken on the LoginGUI, and 2) how to tell what action has been taken.
    This could be solved by getting LoginGUI to call back to Session, however, I am trying to buid the application with a good separation of business, logic and presentation (i.e MVC, but not using any specific model). Therefore, I do not want LoginGUI to contain any program flow logic - that should all be contained in Session.
    I am aware of two possible ways to do this:
    1. Make LoginGUI synchronised, so that Session waits for LoginGUI to send a NotifyAll(). LoginGUI could hold a variable indicating what has happened which Session could interrogate.
    2. Implement Window Listener on Session so that it gets informed of the Window Close action. For the other two actions I could use a PropertyChangeListener in Session, that is notified when some variable in LoginGUI is changed. This variable could contain the action performed.
    Has anyone got any comments on the merits of these methods, or perhaps a better method? This technique seems fundamental to any application that interfaces with end-users, so I would like to find the best way.
    Thanks in advance.

    Hi,
    I tried to avoid putting in specific code as my question was more on design, and I wanted to save people having to trawl through specific code. And if I had any school assignments outstanding they would be about 20 years too late :-). I'm not sure computers more sophisticated than an abacus were around then...
    Rather than putting the actual code (which is long and refers to other objects not relevant to the discussion), I have put together two demo classes to illustrate my query. Comments in the code indicate where I have left out non-relevant code.
    Sessiondemo has the main class. When run, it creates an instance of LoginGUIdemo, containing a userid field, password field, a ComboBox (which would normally have a list of available locales), an Enter and a Cancel box.
    When the Locale combo box is clicked, the LoginGUIdemo.userAction button is changed (using an ActionListener) and a property change is fired to Session (which could then perform some work). The same technique is used to detect Enter events (pressing return in password and userid, or clicking on Enter), and to detect Cancel events (clicking on the cancel button). Instead of putting in business code I have just put in System.out.printlns to print the userAction value.
    With this structure, LoginGUIdemo has no business logic, but just alerts Sessiondemo (the class with the business logic).
    Do you know any more elegant way to achieve this function? In my original post, I mentioned that I have also achieved this using thread synchronisation (Sessiondemo waits on LoginGUI to issue a NotifyAll() before it can retrieve the LoginGUI values). I can put together demo code if you would like. Can you post any other demo code to demonstrate a better technique?
    Cheers,
    Alan
    Here's Sessiondemo.class
    import java.io.*;
    import java.awt.event.*;
    import java.util.*;
    import java.beans.*;
    public class Sessiondemo implements PropertyChangeListener {
        private LoginGUIdemo lgui;   // Login screen
        private int localeIndex; // index referring to an array of available Locales
        public Sessiondemo () {
            lgui = new LoginGUIdemo();
            lgui.addPropertyChangeListener(this);
            lgui.show();
        public static void main(String[] args) {
            Sessiondemo sess = new Sessiondemo();
        public void propertyChange(java.beans.PropertyChangeEvent pce) {
            // Get the userAction value from LoginGUI
            String userAction = pce.getNewValue().toString();
            if (userAction == "Cancelled") {
                System.out.println(userAction);
                // close the screen down
                lgui.dispose();
                System.exit(0);
            } else if (userAction == "LocaleChange") {
                System.out.println(userAction);
                // Get the new locale setting from the LoginGUI
                // ...modify LoginGUI labels with new labels from ResourceBundle
    lgui.show();
    } else if (userAction == "Submitted") {
    System.out.println(userAction);
    // ...Get the userid and password values from LoginGUIdemo
                // run some business logic to decide whether to show the login screen again
                // or accept the login and present the application frontscreen
    }And here's LoginGUIdemo.class
    * LoginGUIdemox.java
    * Created on 29 November 2002, 18:59
    * @author  administrator
    import java.beans.*;
    public class LoginGUIdemo extends javax.swing.JFrame {
        private String userAction;
        private PropertyChangeSupport pcs;
        /** Creates new form LoginGUIdemox */
        // Note that in the full code there are setters and getters to allow access to the
        // components in the screen. For clarity they are not included here
        public LoginGUIdemo() {
            pcs = new PropertyChangeSupport(this);
            userAction = "";
            initComponents();
        public void setUserAction(String s) {
            userAction = s;
            pcs.firePropertyChange("userAction",null,userAction);
        public void addPropertyChangeListener(PropertyChangeListener l) {
            pcs.addPropertyChangeListener(l);
        public void removePropertyChangeListener(PropertyChangeListener l) {
            pcs.removePropertyChangeListener(l);
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            jTextField1 = new javax.swing.JTextField();
            jTextField2 = new javax.swing.JTextField();
            jComboBox1 = new javax.swing.JComboBox();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            getContentPane().setLayout(new java.awt.FlowLayout());
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            jTextField1.setText("userid");
            jTextField1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    EnterActionPerformed(evt);
            getContentPane().add(jTextField1);
            jTextField2.setText("password");
            jTextField2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    EnterActionPerformed(evt);
            getContentPane().add(jTextField2);
            jComboBox1.setToolTipText("Select Locale");
            jComboBox1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    LocaleActionPerformed(evt);
            getContentPane().add(jComboBox1);
            jButton1.setText("Enter");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    EnterActionPerformed(evt);
            getContentPane().add(jButton1);
            jButton2.setText("Cancel");
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    CancelActionPerformed(evt);
            getContentPane().add(jButton2);
            pack();
        private void LocaleActionPerformed(java.awt.event.ActionEvent evt) {
            setUserAction("LocaleChange");
        private void CancelActionPerformed(java.awt.event.ActionEvent evt) {
            setUserAction("Cancelled");
        private void EnterActionPerformed(java.awt.event.ActionEvent evt) {
            setUserAction("Submitted");
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            new LoginGUIdemo().show();
        // Variables declaration - do not modify
        private javax.swing.JTextField jTextField2;
        private javax.swing.JTextField jTextField1;
        private javax.swing.JComboBox jComboBox1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton1;
        // End of variables declaration

  • What is the best Mac choice for creating pro-level art/graphics/animation?

    I'm an artist who does a lot of work with Adobe Creative Suite CS5, as well as some video editing and lots of animation. I've been using a 2007 model 15-inch Macbook Pro for the last 4 years, and it seems like it's time to upgrade...it runs burning hot all the time, and the battery dies pretty quick when the cord falls out. It seems like the whole thing is running a little slow, which is probably because I have a TON of graphics/animation/video software on there, but I need each and every program.
    My question is, what is the best new Mac to purchase to replace this one? I want to make sure it lasts as long as possible, and will be able to handle the programs I use now. My first thought is to get another Macbook Pro, because of the portability, and just add on all the higher RAM, etc to customize it. But my husband suggested looking into the Mac Mini, because it's a lot cheaper, and we're a little strapped for cash at the moment. Would that serve the purpose? Or is a Macbook Pro really the best choice for what I need it to do?
    I'd love to hear suggestions from other artists or graphics people. What do you recommend?

    For a "cash strapped" person, unless you already
    have a monitor, one of the new iMacs may be
    a better choice.  If you do have a monitor, I would
    suggest the dual core i7 equipt MacMini.  Since you state
    you are using CS5 stuff, most Adobe apps,
    Photoshop for example, do not make effective
    use of multiple cores.  Also, using any of the
    Adobe products, regardless of which computer
    you decide on, get as much RAM as you can afford.

  • What is the flaw in this simple Swing program ?

    Hi all ,
    I tried one simple animation in Swing .
    Here's what the program has to do :
    when a button called "play" is clicked a circle should be moved from upper left corner down to the lower right corner.
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class MyAnimation extends JFrame {
       int width;
       int height;
       MyAnimation animation ;
       MyDrawPanel drawpanel ;
       public static void main(String[] args) {
         MyAnimation gui=new MyAnimation();
         gui.go();
       } //close main()
       public void go() {
           animation = new MyAnimation();
           JButton button = new JButton("Play");
           button.addActionListener(new ButtonListener());
           drawpanel = new MyDrawPanel();
           animation.setTitle("Ball Animation");
           animation.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           animation.getContentPane().add(BorderLayout.SOUTH,button);
           animation.getContentPane().add(BorderLayout.CENTER,drawpanel);
           animation.setSize(300,300);
           animation.setVisible(true);
       } //close go()
       class ButtonListener implements ActionListener {
           public void actionPerformed(ActionEvent ae) {
              for(width=0,height=0;width<130&&height<130;width++,height++) {
                       System.out.println("before calling");
                       animation.repaint();
                       System.out.println("W ="+width+"H ="+height);
                   try {
                       Thread.sleep(50);
                   }catch(Exception ex) { }
             } //close for
        } //close actionPerformed()
    } //close ButtonListener
          class MyDrawPanel extends JPanel {
                public void paintComponent(Graphics g) {
                   g.setColor(Color.blue);
                   g.fillRect(0,0,this.getWidth(),this.getHeight());
                   int w= this.getWidth();
                   int h = this.getHeight();
                   //System.out.print(w,h);
                   g.setColor(Color.green);
                   g.fillOval(width,height,40,40);
                   System.out.println("paintcomponent");
               } //close paintcomponent()
         } //closeMyDrawPanel()
    } //close MyAnimation()I noticed when a button is clicked everything goes fine(code reached Listener and loop is executed) expect that repaint() method is not invoked with in a loop(invoked only once at the end of loop).
    but if I embed the same loop code with in go() method without a Listener class it's works Fine !
    Why it's not happening when the code is within Litener class?
    Two more additional questions :
    What is the difference between calling the repaint() method with JFrame instance and JPanel instance ?
    In that program why System.out.print() method which is in MyDrawPanel class can't be invoked ?
    Thanks in advance

    Axel_Richter wrote:
    May be you could have a chance to animate without threads by using paintImmediately directly. I have never tried this, because to use threads is not so difficult at all.animation without explicit calls to thread:
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class MyAnimation extends JPanel
        private static final int TIME_PERIOD = 10;
        private static final String PLAY = "Play";
        private static final String PAUSE = "Pause";
        private static final String RESET = "Reset";
        int width = 0;
        int height = 0;
        MyDrawPanel drawpanel = new MyDrawPanel();
        private Timer timer = new Timer(TIME_PERIOD, new TimerAL());
        public MyAnimation()
            super(new BorderLayout());
            setPreferredSize(new Dimension(300, 300));
            JButton button = new JButton("Play");
            button.addActionListener(new ButtonListener());
            add(button, BorderLayout.SOUTH);
            add(drawpanel, BorderLayout.CENTER);
        class ButtonListener implements ActionListener
            public void actionPerformed(ActionEvent event)
                String command = event.getActionCommand();
                if (command.equals(PLAY))
                    timer.start();
                    ((JButton)event.getSource()).setText(PAUSE);
                else if (command.equals(PAUSE))
                    timer.stop();
                    ((JButton)event.getSource()).setText(RESET);
                else if (command.equals(RESET))
                    timer.stop();
                    ((JButton)event.getSource()).setText(PLAY);
                    width = 0;
                    height = 0;
                    repaint();
        class TimerAL implements ActionListener
            public void actionPerformed(ActionEvent arg0)
                if (width < (drawpanel.getWidth() - 40) &&
                        height < (drawpanel.getHeight() - 40))
                    width++;
                    height++;
                    drawpanel.repaint();
                else
                    timer.stop();
        class MyDrawPanel extends JPanel
            public void paintComponent(Graphics g)
                g.setColor(Color.blue);
                g.fillRect(0, 0, this.getWidth(), this.getHeight());
                int w = this.getWidth();
                int h = this.getHeight();
                // System.out.print(w,h);
                Graphics2D g2 = (Graphics2D)g;
                g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                    RenderingHints.VALUE_ANTIALIAS_ON);
                g2.setColor(Color.green);
                g2.fillOval(width, height, 40, 40);
        private static void createAndShowGUI()
            JFrame frame = new JFrame("Ball Animation");
            frame.getContentPane().add(new MyAnimation());
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
        public static void main(String[] args)
            SwingUtilities.invokeLater(new Runnable()
                public void run()
                    createAndShowGUI();
    }

  • What is the equivalent app on an iPad for QuickTime on an iMac?

    I've created several videos using iVideo on an iMac that are in the .mov format and which are played using QuickTime.
    I would like to play them on an iPad. I have iMovie installed. Is that the equivalent of QuickTime for playback? But how do I access the videos on the iMac? I'm using a direct USB connection, but I don't find the tools on the iPad to access the iMac videos. I'm synchronizing data, but videos don't seem to be an option. Do I have to do it via iTunes? or iCloud? or what?
    Thank you.
    George

    Hello George,
        There are a few ways you can do this, depending how and where you saved your finished move, connect your iPad to your computer, open iTunes and select your iPad in the side bar under Devices.
         Once selected you will see tabs for all of your content on top, select Movies then you can select the movies you want to sync. You can then sync all your movies or select only the ones you want.
         If there are no movies, look at you sidebar select Movies under Library and you can either Add to Library, iTunes-File-Add to Library ( Command O ) or you can drag and drop them in there.
        To add then form iMovie,when your finished editing,  select Share - iTunes.
        In short, put them in iTunes. That is what I do, and it works find.
        Hope that helps

  • What is the equivalent Shift-Z ?

    I read in the book that to make the entire sequence fit into the timeline window, I do Shift-Z.
    If I forget the Shift-Z, where & what do I have to click to have the equivalent command ?
    Thanks

    View>Level>Fit to Window.

  • Newbie: what is the equivalent of passing request parameters?

    Hi-
    I am new to JSF. I have read many tutorials and articles. I still don't get one concept about passing parameters. Note: I don't want to store stuff in the session unless I have to.
    Let's say I have a page with a list of users. I layout the page with a panelGrid. Each row of the table has the first and last name of the user. If a user clicks on the name of a user on the user list, it should go to the user profile page. The backing bean for the user list page will be the UserListBean. It has a method called getUsers() that returns a List of User objects.
    For the View User page, I have a ViewUserBean. The ViewUserBean retrieve the entire profile for that user.
    How do I pass the user ID to the ViewUserBean? In struts, I would pass it as a request parameter (I would manually write the link URL with the userID). I know I can use the request like that in JSF, but that seems ugly. I looked at the code of the J2EE bookstore tutorial and it does a funky thing with all sorts of data stored in the session.
    What is the best way to request a page and "pass in" a userID?
    Thanks for your help.
    Adam

    I have a case on my current project very similar to your case. What you want, very simply, is an easy way to allow faces to handle URLs like http://www.domain.com/showUserDetails?userId=50
    The natural trouble is that when loading the page, there is no action to use to prefetch the User object based on the Request Parameters in JSF.
    All the solutions above either rely on the session or they are exceedingly complex. This case is actually very easy to do and is very straight forward using Managed Properties and a Request Scope bean...
    Here is the rather straight forward solution I used...
    First, make a "ShowUserDetailsBean" which represents the "logic" for this page.
    public class ShowUserDetailsBean
        /** Will point to the actual user service after dependency injection*/
        private UserService userService;
        /** Will hold the userId from the HTTP Request Parameters*/
        private String userId;
        /** Will hold a lazy loaded copy of the User object matching userId*/
        private User user;
        public void setUserService(UserService userService) {
            this.userService = userService;  //dependecy injection
        public void setUserId(String userId) {
           this.userId = userId;  //dependency injection
        /** Lazy loads the User object matching the UserId */
        public User getUser() {
            //Trap the case where the URL has no userId
            if (userId == null) return null;
            if (user == null) {
                user = userService.getUser(userId);  //Lazy Load
            return user;
    }Next, configure the managed properties in faces-config.xml
    <faces-config xmlns="http://java.sun.com/JSF/Configuration">
      <managed-bean>
        <managed-bean-name>userService</managed-bean-name>
        <managed-bean-class>foo.UserServiceImpl</managed-bean-class>
        <managed-bean-scope>application</managed-bean-scope>
      </managed-bean>
      <managed-bean>
        <managed-bean-name>showUserDetails</managed-bean-name>
        <managed-bean-class>foo.ShowUserDetailsBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
        <managed-property>
          <property-name>userService</property-name>
          <property-class>foo.UserService</property-class>
          <value>#{userService}</value>
        </managed-property>
        <managed-property>
          <property-name>userId</property-name>
          <property-class>java.lang.String</property-class>
          <value>#{param.userId}</value>
        </managed-property>
      </managed-bean>Finally, you just make your webpage as you normally would...
    <h:outputText value="#{showUserDetails.user.userId}"/>
    <h:outputText value="#{showUserDetails.user.firstName}"/>
    <h:outputText value="#{showUserDetails.user.lastName}"/>
    Now you're ready to test, so you visit the page
    http://www.domain.com/showUserDetails?userId=50
    And your user details with userId=50 appears!
    It's just that simple!
    Regards,
    Doug
    Caveat: I haven't added any sample logic to handle cases where you visit:
    http://www.domain.com/showUserDetails
    without specifying a userId. I suggest you add some basic logic to your page to handle this case more gracefully.

Maybe you are looking for