Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
lab 10
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
9731065
lab 10
Commits
540e806b
Commit
540e806b
authored
5 years ago
by
9731065
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
massageArea created
parent
ecfc3940
master
No related merge requests found
Pipeline
#651
canceled with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
MessageArea.java
src/MessageArea.java
+19
-0
UsernameFrame.java
src/UsernameFrame.java
+22
-0
No files found.
src/MessageArea.java
0 → 100644
View file @
540e806b
import
javax.swing.*
;
import
java.awt.*
;
public
class
MessageArea
extends
JPanel
{
public
MessageArea
(){
super
();
setLayout
(
new
BorderLayout
());
JTextField
jTextField
=
new
JTextField
();
jTextField
.
setEditable
(
true
);
this
.
add
(
jTextField
,
BorderLayout
.
CENTER
);
JLabel
jLabel
=
new
JLabel
(
"Text:"
);
this
.
add
(
jLabel
,
BorderLayout
.
WEST
);
JButton
jButton
=
new
JButton
(
"Send"
);
jButton
.
setBackground
(
Color
.
CYAN
);
this
.
add
(
jButton
,
BorderLayout
.
EAST
);
jTextField
.
setToolTipText
(
"Enter Text :"
);
}
}
This diff is collapsed.
Click to expand it.
src/UsernameFrame.java
0 → 100644
View file @
540e806b
import
javax.swing.*
;
import
java.awt.*
;
public
class
UsernameFrame
extends
JFrame
{
private
static
final
String
BTN_TXT
=
"Start chatting..."
;
private
static
final
String
LABEL_TXT
=
"Choose your name "
;
private
static
final
int
WIDTH
=
300
,
HEIGHT
=
100
;
JTextField
textField
;
JButton
button
;
public
UsernameFrame
()
throws
HeadlessException
{
super
();
this
.
setLayout
(
new
BorderLayout
());
JLabel
label
=
new
JLabel
(
"choose your name"
);
add
(
label
,
BorderLayout
.
PAGE_START
);
textField
=
new
JTextField
();
add
(
textField
,
BorderLayout
.
CENTER
);
button
=
new
JButton
(
LABEL_TXT
);
add
(
button
,
BorderLayout
.
PAGE_END
);
setSize
(
WIDTH
,
HEIGHT
);
setVisible
(
true
);
}
}
This diff is collapsed.
Click to expand it.
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