Results 1 to 2 of 2

Thread: class loading

  1. #1
    purejoker is offline Member
    Join Date
    Jan 2009
    Posts
    2
    Rep Power
    0

    Default class loading

    hi there,

    i have two classes called login and members

    what im tring to do is make when you press a button on the login form it shoes the members form.

    im using action listener on the button, but im not sure of the code to use to call the members class. can someone point me in the right direction?

    is it something like this:
    Members objectName = new Members();

    thanks

  2. #2
    itaipee is offline Member
    Join Date
    Dec 2008
    Posts
    99
    Rep Power
    0

    Default

    what im tring to do is make when you press a button on the login form it shoes the members form
    you meant shows? -

    First, assume you have already class called allMembers . :

    inside the actionListern
    Java Code:
    //	@Override
    public void actionPerformed(ActionEvent e) {
    
     // assume allMemebr is the list of the all members and 
    //   the method getAllNames return array of strings with all names
    Object[] memberNames = allMembers.getAllNames();
    
    String s = (String)JOptionPane.showInputDialog(
                        mainFrame,
                        "Choose Member name",
                        "title",
                        JOptionPane.PLAIN_MESSAGE,
                        null,
                        memberNames,
                        memberNames[0]);
    
    // s - will be the selected member name
    } // end of actionperformed

Similar Threads

  1. Why is one applet loading but the other isnít?
    By spmchugh82 in forum Java Applets
    Replies: 1
    Last Post: 01-26-2009, 03:39 PM
  2. Error loading c:\\...\jvm.dll
    By dnyan123 in forum SWT / JFace
    Replies: 7
    Last Post: 10-20-2008, 04:26 AM
  3. Factory loading class...help?
    By prabhurangan in forum Advanced Java
    Replies: 2
    Last Post: 10-14-2008, 02:20 PM
  4. Loading a class within a different class
    By nick2price in forum New To Java
    Replies: 1
    Last Post: 05-30-2008, 07:19 AM
  5. Help with class loading in java
    By mathias in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 08:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •