Java代写 | Lab3 – CIT325

本次Java代写是实现简单的GUI

CIT325 Lab2
Lab3 – CIT325
Goals
The goal of this lab is extend the previous lab on moving objects and building a simple GUI.
You are two build a simple GUI to build a rudimentary chat system to reinforce the concept of
communication between objects.
1. Design a Person class with userName and IDNum.
2. Design a Message class, shown below.
3. Design a Chatroom class that uses a client and connects to a ChatServer, of your design.
4. Carry out a conversation between two people by inputting data and posting it to the GUI of
both participants.
Specifications
The class you create will be a Person class. The Person class will connect to Chatroom. The
Chatroom object will allow multiple Person objects to communicate to each other. The class
will contain the following list of data attributes. You must decide the correct types for each, and
minimally use the attributes and methods listed below.
Class Person
• userName
• PUID
You will need to code a get and set function for each attribute, so minimally 2 methods per each
attribute. You can design more if you want. For the Message class, there is only 1 attribute, String
message. The required methods are below:
• public void sendMessage(String message)
• public String receiveMessage()
Class Chatroom
• CurrentPerson – the current person sending a message
• CurrentMessage – the current message being sent/answered
The simple GUI to create will minimally have three simple requirements:
1
CIT325 Lab2
1. JTextField that can take a message as entry
2. JButton that when pressed will take the message entered and send it to another person
3. any other control object that can display all texts submitted with name of sender and text.
You will first instantiate 2 persons into the Chatroom object. Then, go through a continuous
series of interactions (loop) where the you will ask what person, by Last Name, wants to send
a message/question. Then the system will ask what Person object to send the message/question
to. Third, it will ask if you want to send a message or question. Finally, the text of question or
message will be entered. once it is entered, the system will do 2 operations. Update that question or
message into the memory of the person object to which it was intended. Second, display a message
to the screen showing what message has been sent from who to who, whether it is a question or
message and what is the content of the text. This will continue until the user exits with an ”END”
command as the message.
Please begin the chat!
Sender Name: Matson
Message: What time is lunch?
Sender Name: Smith
Message: Lunch is at noon.
Submission
When complete, show the lab instructor the results for your experiments. Then, ZIP all code and
submit it to Blackboard for this week.
2


程序代写代做C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝交易!

E-mail: [email protected]  微信:dmxyzl003


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。

发表评论