Results 1 to 5 of 5
  1. #1
    choymits is offline Member
    Join Date
    Mar 2014
    Posts
    3
    Rep Power
    0

    Default The Instant Message GUI

    import java.awt.*;
    import javax.swing.*;

    public class InstantMessageFrame extends JFrame
    {
    private JList friends;
    private JTextField message;
    private JButton send;

    public InstantMessageFrame e (String title)
    {
    super(title);
    this.setDefaultCloseOperation(WindowConstants.EXIT _ON_CLOSE);

    }
    public static void main (String [] args)
    {
    JFrame f = new InstantMessageFrame ("My IM Program");
    f.setSize(220, 450);
    f.setVisible(true);
    }
    }





    Im little confusing .. help guys



    1. Open the source code file of your InstantMessageFrame class from
    Lab 12.2.
    2. Add the following three fields to the InstantMessageFrame class: a
    JTextField named message, a JList named friends, and a JButton
    named send.
    3. Add a method to your InstantMessageFrame class named getMessagePanel()
    that returns a JPanel and has no parameters. (This
    method will create a JPanel that will appear in the south border of
    your JFrame. It will contain a text field in which a message can be
    entered and a button that sends an instant message to all the friends
    in the list.)
    4. Within getMessagePanel(), instantiate a new JPanel and give it BorderLayout.
    Assign a message equal to a new JTextField by using the
    no-argument constructor of JTextField. Assign send to a new JButton,
    passing in “Send” to the constructor. (This will be the label on
    the button.)
    5. Within getMessagePanel(), add the message text field to the center
    of the JPanel and add the send button to the east border of the
    JPanel. The panel is now ready, so return the JPanel reference.
    6. Add a method to your InstantMessageFrame class named get-
    FriendsPane() that returns a JScrollPane and has no parameters.
    (This method will create a scrollable list that will contain the names
    of others that you can chat with.)
    7. Within getFriendsPane(), assign friends to a new JList by using the
    no-argument constructor of JList.
    8. Within getFriendsPane(), instantiate a new JScrollPane using the following
    statement:
    JScrollPane pane = new JScrollPane(friends);
    9. The scroll pane is ready, so return the reference pane at the end of
    getFriendsPane().
    10. Within the constructor of InstantMessageFrame, invoke getMessagePanel(),
    placing the returned panel in the south border of the
    content pane of InstantMessageFrame.
    An Introduction to GUI Programming 399
    11. Within the constructor of InstantMessageFrame, invoke get-
    FriendsPane(), placing the returned scroll pane in the center of the
    content pane of InstantMessageFrame.
    12. Save, compile, and run the InstantMessageFrame class.
    Your InstantMessageFrame now has three visible components: a JList,
    a JTextField, and a JButton.

  2. #2
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,846
    Rep Power
    5

    Default Re: The Instant Message GUI

    You forgot to ask a question.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    choymits is offline Member
    Join Date
    Mar 2014
    Posts
    3
    Rep Power
    0

    Default Re: The Instant Message GUI

    can u help me .. guys... i need the final programme

  4. #4
    choymits is offline Member
    Join Date
    Mar 2014
    Posts
    3
    Rep Power
    0

    Default Re: The Instant Message GUI

    @gimbal2 i need the final program im a newbie about the java.. im confuse of the GUI,,

  5. #5
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,846
    Rep Power
    5

    Default Re: The Instant Message GUI

    No, I can't help you become less confused. You have to sit down and think to fix that. If you have a specific question to ask I'll see if I can answer it.

    And just so you know: nobody is going to write the code for you, that's cheating.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Instant Messenger using RMI
    By sQu3aKy in forum Networking
    Replies: 2
    Last Post: 12-30-2010, 12:33 AM
  2. different instant variable of same class
    By javastuden in forum New To Java
    Replies: 1
    Last Post: 11-20-2009, 05:06 AM
  3. Instant Messaging Program
    By Zosden in forum Networking
    Replies: 13
    Last Post: 05-05-2008, 07:18 AM

Posting Permissions

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