Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
Lab10
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9731087
Lab10
Commits
2daef90e
Commit
2daef90e
authored
May 20, 2019
by
9731087
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first phase
parent
6b792e98
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
ChatArea.java
src/ChatArea.java
+1
-0
ChatRoomGUI.java
src/ChatRoomGUI.java
+2
-0
No files found.
src/ChatArea.java
View file @
2daef90e
...
@@ -7,6 +7,7 @@ public class ChatArea extends JTextArea {
...
@@ -7,6 +7,7 @@ public class ChatArea extends JTextArea {
super
(
ROWS
,
COLUMNS
);
super
(
ROWS
,
COLUMNS
);
this
.
setEditable
(
false
);
this
.
setEditable
(
false
);
this
.
setLineWrap
(
true
);
this
.
setLineWrap
(
true
);
setVisible
(
true
);
}
}
public
void
addMessage
(
String
username
,
String
message
)
{
public
void
addMessage
(
String
username
,
String
message
)
{
...
...
src/ChatRoomGUI.java
View file @
2daef90e
...
@@ -17,6 +17,7 @@ public class ChatRoomGUI extends JFrame {
...
@@ -17,6 +17,7 @@ public class ChatRoomGUI extends JFrame {
this
.
setVisible
(
true
);
this
.
setVisible
(
true
);
ChatArea
chatBox
=
new
ChatArea
();
ChatArea
chatBox
=
new
ChatArea
();
this
.
add
(
new
JScrollPane
(
chatBox
),
BorderLayout
.
CENTER
);
this
.
add
(
new
JScrollPane
(
chatBox
),
BorderLayout
.
CENTER
);
chatBox
.
addMessage
(
" Ostad"
,
" Hello!"
);
MessageArea
messageArea
=
new
MessageArea
();
MessageArea
messageArea
=
new
MessageArea
();
this
.
add
(
messageArea
,
BorderLayout
.
SOUTH
);
this
.
add
(
messageArea
,
BorderLayout
.
SOUTH
);
this
.
setVisible
(
true
);
this
.
setVisible
(
true
);
...
@@ -25,6 +26,7 @@ public class ChatRoomGUI extends JFrame {
...
@@ -25,6 +26,7 @@ public class ChatRoomGUI extends JFrame {
participantsArea
.
addNewParticipant
(
" Amirmehdy"
);
participantsArea
.
addNewParticipant
(
" Amirmehdy"
);
participantsArea
.
addNewParticipant
(
" Abtin"
);
participantsArea
.
addNewParticipant
(
" Abtin"
);
participantsArea
.
removeParticipant
(
" Amirmehdy"
);
participantsArea
.
removeParticipant
(
" Amirmehdy"
);
participantsArea
.
addNewParticipant
(
" Ostad"
);
this
.
setVisible
(
true
);
this
.
setVisible
(
true
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment