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
Jan Schubert
Enigma
Commits
024cfe41
Commit
024cfe41
authored
5 years ago
by
Dennis Eisold
Browse files
Options
Downloads
Patches
Plain Diff
char[] durch String ersetzt mit toUpperCase #10
parent
d22dfeba
No related branches found
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/KenngruppeController.java
+14
-9
14 additions, 9 deletions
src/main/java/projekt/enigma/KenngruppeController.java
with
14 additions
and
9 deletions
src/main/java/projekt/enigma/KenngruppeController.java
+
14
−
9
View file @
024cfe41
...
@@ -18,22 +18,27 @@ public class KenngruppeController {
...
@@ -18,22 +18,27 @@ public class KenngruppeController {
* Beim drücken der Taste wird überprüft ob die eingegebene Kenngruppe weniger als 9 Zeichen hat und ob die
* Beim drücken der Taste wird überprüft ob die eingegebene Kenngruppe weniger als 9 Zeichen hat und ob die
* eingegebenen Zeichen nur Buchstaben sind.
* eingegebenen Zeichen nur Buchstaben sind.
* Bei einer gültigen Eingabe wird die eingegebene Kenngruppe gespeichert und die Enigma-Anwendung gestartet
* Bei einer gültigen Eingabe wird die eingegebene Kenngruppe gespeichert und die Enigma-Anwendung gestartet
*
* @throws IOException :
* @throws IOException :
*/
*/
@FXML
@FXML
private
void
btnGui
()
throws
IOException
{
private
void
btnGui
()
throws
IOException
{
if
(
tfKenngruppe
.
getText
().
length
()
<
9
)
{
for
(
char
c
:
tfKenngruppe
.
getText
().
toCharArray
())
{
String
alphabet
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
;
if
(
c
==
'a'
||
c
==
'b'
||
c
==
'c'
||
c
==
'd'
||
c
==
'e'
||
c
==
'f'
||
c
==
'g'
||
c
==
'h'
||
c
==
'i'
||
c
==
'j'
||
c
==
'k'
||
c
==
'l'
||
c
==
'm'
||
c
==
'n'
||
c
==
'o'
||
c
==
'p'
||
c
==
'q'
||
c
==
'r'
||
c
==
's'
||
c
==
't'
||
c
==
'u'
||
c
==
'v'
||
c
==
'w'
||
c
==
'x'
||
c
==
'y'
||
c
==
'z'
||
c
==
'A'
||
c
==
'B'
||
c
==
'C'
||
c
==
'D'
||
c
==
'E'
||
c
==
'F'
||
c
==
'G'
||
c
==
'H'
||
c
==
'I'
||
c
==
'J'
||
c
==
'K'
||
c
==
'L'
||
c
==
'M'
||
c
==
'N'
||
c
==
'O'
||
c
==
'P'
||
c
==
'Q'
||
c
==
'R'
||
c
==
'S'
||
c
==
'T'
||
c
==
'U'
||
c
==
'V'
||
c
==
'W'
||
c
==
'X'
||
c
==
'Y'
||
c
==
'Z'
)
{
boolean
error
=
false
;
cod
.
setKenngruppe
(
tfKenngruppe
.
getText
());
for
(
char
c
:
tfKenngruppe
.
getText
().
toUpperCase
().
toCharArray
())
{
//setzt
if
(!
alphabet
.
contains
(
String
.
valueOf
(
c
)))
{
App
.
setRoot
(
"gui"
);
error
=
true
;
}
}
}
}
if
(
tfKenngruppe
.
getText
().
length
()
<
9
&&
!
error
)
{
cod
.
setKenngruppe
(
tfKenngruppe
.
getText
().
toUpperCase
());
//setzt
App
.
setRoot
(
"gui"
);
}
else
{
}
else
{
tfKenngruppe
.
setStyle
(
"-fx-background-color:#FF0000"
);
tfKenngruppe
.
setStyle
(
"-fx-background-color:#FF0000"
);
tfKenngruppe
.
setText
(
"Fehlerhafte Kenngruppe!"
);
tfKenngruppe
.
setText
(
"Fehlerhafte Kenngruppe!"
);
}
}
}
}
}
}
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