FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Uni__LibraryManagementJavaGUI/src/code/test.java at master · bestmahdi2/Uni__LibraryManagementJavaGUI · GitHub
bestmahdi2
/
Uni__LibraryManagementJavaGUI
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Uni__LibraryManagementJavaGUI
/
src
/
code
/
test.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
128 lines (95 loc) · 4.78 KB
Breadcrumbs
Uni__LibraryManagementJavaGUI
/
src
/
code
/
test.java
Copy path
File metadata and controls
128 lines (95 loc) · 4.78 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package
code
;
import
jdk
.
swing
.
interop
.
SwingInterOpUtils
;
import
java
.
util
.
ArrayList
;
import
java
.
util
.
Scanner
;
import
java
.
util
.
stream
.
Collectors
;
public
class
test
{
public
static
void
main
(
String
[]
args
) {
int
[][]
array
=
new
int
[
3
][
3
];
ArrayList
<
Integer
>
numbers
=
new
ArrayList
();
Scanner
scanner
=
new
Scanner
(
System
.
in
);
for
(
int
i
=
0
;
i
<
array
.
length
;
i
++) {
String
thisArray
=
"Array "
+ (
i
+
1
);
for
(
int
j
=
0
;
j
<
array
[
i
].
length
;
j
++) {
System
.
out
.
println
(
thisArray
+
", element "
+
j
+
" > "
);
array
[
i
][
j
] =
scanner
.
nextInt
();
numbers
.
add
(
array
[
i
][
j
]);
}
}
numbers
= (
ArrayList
<
Integer
>)
numbers
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
for
(
int
n
:
numbers
) {
int
counter
=
0
;
for
(
int
i
=
0
;
i
<
array
.
length
;
i
++) {
for
(
int
j
=
0
;
j
<
array
[
i
].
length
;
j
++) {
if
(
array
[
i
][
j
] ==
n
)
counter
++;
}
}
System
.
out
.
println
(
n
+
" repeated "
+
counter
+
" times !"
);
}
}
}
// LoginForm:
// getContentPane().setLayout(new FlowLayout());
/* WindowListener exitListener = new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
Manager.loginForm.setVisible(true);
}
};
addWindowListener(exitListener);*/
/////////////////////////////////////////////////////////
// AddBookForm
// open image:
// fileChooser.addChoosableFileFilter(new FileNameExtensionFilter("Images", "jpg", "png", "gif", "bmp"));
/////////////////////////////////////////////////////////
// Manager:
// bigger: {{{"Mahdi"}, {"London", "it's good"}, {"Tehran", "it's good"}}, {{"Ali"}, {"Tehran", "it's good"}} };
// small: {{"Mahdi"}, {"London", "it's good"}, {"Tehran", "it's good"}}
// smaller: {{"Mahdi"}, {"London", "it's good"}}
// /* open image:
// JFileChooser fc = new JFileChooser();
// if(fc.showOpenDialog(app) == JFileChooser.APPROVE_OPTION){
// BufferedImage img = ImageIO.read(fc.getSelectedFile());//it must be an image file, otherwise you'll get an exception
// JLabel label = new JLabel();
// label.setIcon(new ImageIcon(img));
// app.getContentPane().add(label);
// }*/
// signUp("ali", "1234", "Ali", "Badiee", "admin");
// signUp("mahdi", "4321", "Mahdi", "Badiee", "user");
// addBook("Man Pish Az To", "JoJo Moyes", "src/photos/Man Pish Az To.jpg", "src/photos/Man Pish Az To.jpg", "1");
// addBook("Pas Az To", "JoJo Moyes", "src/photos/Pas Az To.jpg", "src/photos/Pas Az To.jpg", "1");
// addBook("Yek Be Alave Yek", "JoJo Moyes", "src/photos/Yek Be Alave Yek.jpg", "src/photos/Yek Be Alave Yek.jpg", "1");
// addComment("ali", "Man Pish Az To", "This is a very good book !");
// addComment("ali", "Man Pish Az To", "This is a very good book !");
// addComment("mahdi", "Man Pish Az To", "This is a very good book 1 !");
// addComment("mahdi", "Pas Az To", "This is a very good book 2 !");
// addCommentForBook("qwerty", "This is america1");
// addCommentForBook("qwerty", "This is america2");
// users.addAll(Arrays.asList(getUsers()));
// System.out.println(elementExists2(new String[][]{{"Mahdi"}, {"London", "it's good"}, {"Tehran", "it's good"}}, new String[]{"London", "it's good"}));
// addComment("ali123", "12344", "good1 baba good");
// getAdminsUsers();
/////////////////////////////////////////////////////////
// Book Comment From:
// JLabel textLabel = new JLabel(text, SwingConstants.CENTER);
// textLabel.setBorder(new EmptyBorder(10, 10, 10, 10));
// textLabel.setFont(new Font(textLabel.getFont().getName(), Font.PLAIN, 14));
// textLabel.setIconTextGap(10);
// textLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
// imagesPanel.add(textLabel);
// bookInfoPane.setText(String.format("%s\n\n%s\n\n%s", books[bookNumber][0][1], "\uD83C\uDF1F".repeat(Integer.parseInt(books[bookNumber][0][4])), commentsNum));
/////////////////////////////////////////////////////////
// Add Comment Form
// textArea1 = new JTextArea(new DefaultStyledDocument() {
// @Override
// public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
// if ((getLength() + str.length()) <= maxLength) {
// System.out.println("ok");
// super.insertString(offs, str, a);
// }
// else {
// Toolkit.getDefaultToolkit().beep();
// }
// }
// });
Back
|
FazBrowse Home
|
New Git URL