Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
20231104-KursPodstawowyALX
Overview
Overview
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
Patryk Czarnik
20231104-KursPodstawowyALX
Commits
892538de
Commit
892538de
authored
Jan 07, 2024
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
layout - początek
parent
e4f70045
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
0 deletions
+78
-0
Okno3.java
src/main/java/p30_swing/podstawy/Okno3.java
+39
-0
Okno3a.java
src/main/java/p30_swing/podstawy/Okno3a.java
+39
-0
No files found.
src/main/java/p30_swing/podstawy/Okno3.java
0 → 100644
View file @
892538de
package
p30_swing
.
podstawy
;
import
java.awt.Color
;
import
java.awt.Font
;
import
javax.swing.JButton
;
import
javax.swing.JFrame
;
import
javax.swing.JLabel
;
import
javax.swing.SwingConstants
;
public
class
Okno3
{
public
static
void
main
(
String
[]
args
)
{
JFrame
okno
=
new
JFrame
(
"Nasza aplikacja"
);
okno
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
okno
.
setSize
(
800
,
600
);
JLabel
label1
=
new
JLabel
(
"Hello world"
);
label1
.
setFont
(
new
Font
(
"Arial"
,
Font
.
BOLD
,
40
));
label1
.
setForeground
(
Color
.
BLUE
);
label1
.
setHorizontalAlignment
(
SwingConstants
.
CENTER
);
okno
.
add
(
label1
);
JLabel
label2
=
new
JLabel
(
"Goodbye cruel world"
);
label2
.
setFont
(
new
Font
(
"Arial"
,
Font
.
BOLD
|
Font
.
ITALIC
,
40
));
label2
.
setForeground
(
Color
.
RED
);
label2
.
setHorizontalAlignment
(
SwingConstants
.
CENTER
);
okno
.
add
(
label2
);
JButton
button1
=
new
JButton
(
"OK"
);
button1
.
setFont
(
new
Font
(
"Arial"
,
Font
.
BOLD
,
40
));
button1
.
setForeground
(
Color
.
GREEN
);
button1
.
setHorizontalAlignment
(
SwingConstants
.
CENTER
);
okno
.
add
(
button1
);
okno
.
setVisible
(
true
);
}
}
src/main/java/p30_swing/podstawy/Okno3a.java
0 → 100644
View file @
892538de
package
p30_swing
.
podstawy
;
import
java.awt.Color
;
import
java.awt.Font
;
import
javax.swing.JButton
;
import
javax.swing.JFrame
;
import
javax.swing.JLabel
;
import
javax.swing.SwingConstants
;
public
class
Okno3a
{
public
static
void
main
(
String
[]
args
)
{
JFrame
okno
=
new
JFrame
(
"Nasza aplikacja"
);
okno
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
okno
.
setSize
(
800
,
600
);
JLabel
label1
=
new
JLabel
(
"Hello world"
);
label1
.
setFont
(
new
Font
(
"Arial"
,
Font
.
BOLD
,
40
));
label1
.
setForeground
(
Color
.
BLUE
);
label1
.
setHorizontalAlignment
(
SwingConstants
.
CENTER
);
okno
.
add
(
label1
);
JLabel
label2
=
new
JLabel
(
"Goodbye cruel world"
);
label2
.
setFont
(
new
Font
(
"Arial"
,
Font
.
BOLD
|
Font
.
ITALIC
,
40
));
label2
.
setForeground
(
Color
.
RED
);
label2
.
setHorizontalAlignment
(
SwingConstants
.
CENTER
);
okno
.
add
(
label2
,
"South"
);
JButton
button1
=
new
JButton
(
"OK"
);
button1
.
setFont
(
new
Font
(
"Arial"
,
Font
.
BOLD
,
40
));
button1
.
setForeground
(
Color
.
GREEN
);
button1
.
setHorizontalAlignment
(
SwingConstants
.
CENTER
);
okno
.
add
(
button1
,
"West"
);
okno
.
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