Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Enigma
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dennis Eisold
Enigma
Commits
7a325959
Commit
7a325959
authored
5 years ago
by
Dennis Eisold
Browse files
Options
Downloads
Patches
Plain Diff
Delete ChkBoxPanel.java
parent
98196f17
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/projekt/enigma/view/ChkBoxPanel.java
+0
-74
0 additions, 74 deletions
src/main/java/projekt/enigma/view/ChkBoxPanel.java
with
0 additions
and
74 deletions
src/main/java/projekt/enigma/view/ChkBoxPanel.java
deleted
100644 → 0
+
0
−
74
View file @
98196f17
package
projekt.enigma.view
;
import
java.awt.*
;
import
javax.swing.*
;
public
class
ChkBoxPanel
extends
JPanel
{
/*private static JPanel panel = new JPanel();*/
private
static
JCheckBox
[]
checkbox
;
private
static
Character
[]
alphabet
;
/* = {'A','B','C','D'};*/
private
static
int
charSize
;
public
ChkBoxPanel
(
Character
[]
alphabet
)
{
this
.
charSize
=
alphabet
.
length
;
this
.
alphabet
=
alphabet
;
/*this.setTitle("Vertausche Buchstaben");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);*/
this
.
setSize
(
30
,
charSize
*
25
);
//this.setLocation(getMousePosition()/*.x, getMousePosition().y+this.getHeight()+30*/);
initializeComponents
();
}
private
void
initializeComponents
()
{
this
.
checkbox
=
new
JCheckBox
[
charSize
];
GridLayout
panelLayout
=
new
GridLayout
();
this
.
setLayout
(
panelLayout
);
if
(!(
charSize
%
2
==
0
))
{
this
.
setSize
(
30
,
(
charSize
+
1
)
*
20
);
panelLayout
.
setRows
((
charSize
+
1
)
/
2
);
}
else
{
this
.
setSize
(
30
,
charSize
*
10
);
panelLayout
.
setRows
(
charSize
/
2
);
}
panelLayout
.
setColumns
(
2
);
//panelLayout.setVgap(5);
//panelLayout.setHgap(-5);
for
(
int
i
=
0
;
i
<
charSize
;
i
++)
{
checkbox
[
i
]
=
new
JCheckBox
(
alphabet
[
i
]
+
""
);
checkbox
[
i
].
setSize
(
15
,
20
);
checkbox
[
i
].
setHorizontalTextPosition
(
SwingConstants
.
CENTER
);
checkbox
[
i
].
setVerticalTextPosition
(
SwingConstants
.
TOP
);
/* if (!(i%2==0)){
}*/
checkbox
[
i
].
setMargin
(
new
Insets
(
0
,
20
,
0
,
20
));
//checkbox[i].setLocation(20, (i + 1) * 30);
this
.
add
(
checkbox
[
i
]);
}
/* this.getContentPane().add(panel);*/
checkbox
[
0
].
setSelected
(
true
);
//this.add(panel);
//this.setLocation(100, 100);
this
.
setVisible
(
true
);
}
private
int
isChecked
()
{
for
(
int
i
=
0
;
i
<
charSize
;
i
++)
{
if
(
checkbox
[
i
].
isSelected
())
{
// do something...
}
else
{
// do something else...
}
}
return
0
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment