Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
alx_mszczonow_1
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
alx_mszczonow_1
Commits
e41b5e1c
Commit
e41b5e1c
authored
Jul 24, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Form w IntelliJ
parent
b54a9964
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
3 deletions
+69
-3
Proba1.form
src/main/java/swing/proby_gui/Proba1.form
+45
-0
Proba1.java
src/main/java/swing/proby_gui/Proba1.java
+19
-0
Rysowanie2D.java
src/main/java/swing/rysowanie/Rysowanie2D.java
+5
-3
No files found.
src/main/java/swing/proby_gui/Proba1.form
0 → 100644
View file @
e41b5e1c
<?xml version="1.0" encoding="UTF-8"?>
<form
xmlns=
"http://www.intellij.com/uidesigner/form/"
version=
"1"
bind-to-class=
"swing.proby_gui.Proba1"
>
<grid
id=
"27dc6"
layout-manager=
"GridLayoutManager"
row-count=
"2"
column-count=
"2"
same-size-horizontally=
"false"
same-size-vertically=
"false"
hgap=
"-1"
vgap=
"-1"
>
<margin
top=
"0"
left=
"0"
bottom=
"0"
right=
"0"
/>
<constraints>
<xy
x=
"20"
y=
"20"
width=
"734"
height=
"139"
/>
</constraints>
<properties/>
<border
type=
"none"
/>
<children>
<component
id=
"9b92a"
class=
"javax.swing.JLabel"
>
<constraints>
<grid
row=
"0"
column=
"0"
row-span=
"1"
col-span=
"1"
vsize-policy=
"0"
hsize-policy=
"0"
anchor=
"8"
fill=
"0"
indent=
"0"
use-parent-layout=
"false"
/>
</constraints>
<properties>
<text
value=
"Podaj swoje imię"
/>
</properties>
</component>
<component
id=
"defba"
class=
"javax.swing.JTextField"
binding=
"textField1"
default-binding=
"true"
>
<constraints>
<grid
row=
"0"
column=
"1"
row-span=
"1"
col-span=
"1"
vsize-policy=
"0"
hsize-policy=
"6"
anchor=
"8"
fill=
"1"
indent=
"0"
use-parent-layout=
"false"
>
<preferred-size
width=
"150"
height=
"-1"
/>
</grid>
</constraints>
<properties/>
</component>
<component
id=
"7d509"
class=
"javax.swing.JButton"
binding=
"OKButton"
default-binding=
"true"
>
<constraints>
<grid
row=
"1"
column=
"0"
row-span=
"1"
col-span=
"1"
vsize-policy=
"0"
hsize-policy=
"3"
anchor=
"0"
fill=
"1"
indent=
"0"
use-parent-layout=
"false"
/>
</constraints>
<properties>
<text
value=
"OK"
/>
</properties>
</component>
<component
id=
"b39c5"
class=
"javax.swing.JLabel"
>
<constraints>
<grid
row=
"1"
column=
"1"
row-span=
"1"
col-span=
"1"
vsize-policy=
"0"
hsize-policy=
"0"
anchor=
"8"
fill=
"0"
indent=
"0"
use-parent-layout=
"false"
/>
</constraints>
<properties>
<text
value=
""
/>
</properties>
</component>
</children>
</grid>
</form>
src/main/java/swing/proby_gui/Proba1.java
0 → 100644
View file @
e41b5e1c
package
swing
.
proby_gui
;
import
javax.swing.*
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
public
class
Proba1
{
private
JTextField
textField1
;
private
JButton
OKButton
;
public
Proba1
()
{
OKButton
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
String
imie
=
textField1
.
getText
();
}
});
}
}
src/main/java/swing/rysowanie/Rysowanie2D.java
View file @
e41b5e1c
...
@@ -51,9 +51,11 @@ public class Rysowanie2D {
...
@@ -51,9 +51,11 @@ public class Rysowanie2D {
protected
void
paintComponent
(
Graphics
g
)
{
protected
void
paintComponent
(
Graphics
g
)
{
super
.
paintComponent
(
g
);
super
.
paintComponent
(
g
);
if
(
g
instanceof
Graphics2D
)
{
// Nowa możliwość Javy: rzutowanie bezpośrednio w instanceof
Graphics2D
g2
=
(
Graphics2D
)
g
;
// ("pattern matching")
if
(
g
instanceof
Graphics2D
g2
)
{
//Graphics2D g2 = (Graphics2D)g;
AffineTransform
pustyTrans
=
g2
.
getTransform
();
AffineTransform
pustyTrans
=
g2
.
getTransform
();
...
...
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