Skip to content

Commit 7447284

Browse files
committed
updated
1 parent 26859e7 commit 7447284

File tree

5 files changed

+132
-108
lines changed

5 files changed

+132
-108
lines changed

README.md

+3-108
Original file line numberDiff line numberDiff line change
@@ -17,113 +17,8 @@ Rustam_Z🚀, 9.10.2020
1717

1818
- Design Patterns, SOLID Principles- https://youtu.be/A1PWJB98qcw
1919

20-
## Java GUI
20+
- [Java Swing](java-swing)
2121

22-
### GUI Basics
23-
- [Lecture Notes](lecture-notes/GUI_Basics.ppt)
22+
- JavaFX
2423

25-
- [Swing Notes](lecture-notes/Creating_User_Interfaces_Swing.ppt)
26-
27-
- Swing (interface) vs. AWT (event handling)
28-
29-
- ```java
30-
import javax.swing.*;
31-
32-
public class MyFrame {
33-
public static void main(String[] args) {
34-
JFrame frame = new JFrame("Test Frame");
35-
frame.setSize(400, 300);
36-
frame.setLocationRelativeTo(null);
37-
frame.setVisible(true);
38-
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
39-
}
40-
}
41-
```
42-
43-
- ```java
44-
import javax.swing.*;
45-
46-
public class MyFrameWithComponents {
47-
public static void main(String[] args) {
48-
JFrame frame = new JFrame( "MyFrameWithComponen")
49-
50-
JButton jbtOK = new JButton("OK"); // Add a button into the frame
51-
frame.add(jbtOK);
52-
53-
frame.setSize(400, 300);
54-
frame.setDefau1tC10seOperation(JFrame.EXIT_ON_CLOSE);
55-
frame.setLocationRe1ativeTo(nu11); // Center the frame
56-
frame.setVisib1e(true);
57-
}
58-
}
59-
```
60-
- [JFrame with inheritence](programs/MyFrame1.java)
61-
62-
### Layout Manager
63-
- For arraning a position into containers
64-
65-
- [FlowLayout](programs/ShowFlowLayout.java)
66-
67-
- [GridLayout](programs/ShowGridLayout.java)
68-
69-
- [BorderLayout](programs/ShowBorderLayout.java)
70-
71-
- `Color` class
72-
- ```java
73-
Color mycolor = new Color(228, 100, 50);
74-
// how to set for button
75-
mybutton.setBackground(Color.mycolor);
76-
mybutton.setForeground(Color.mycolor);
77-
```
78-
79-
### JPanel
80-
- In `JFrame` we add a component `JPanel`
81-
82-
- [TestPanels](programs/TestPanels.java)
83-
84-
### Event-Handling in Java (Event-Driven Programming)
85-
86-
- [Lecture Notes](lecture-notes/Event-Driven_Programming.ppt)
87-
88-
- Event-driven programming (depends of action) <-> procedural programming (step by step)
89-
90-
- [HandleEvent](programs/HandleEvent.java)
91-
92-
- [HandleEvent1](programs/HandleEvent1.java) with the use of Inner Classes
93-
94-
- ```
95-
User Action Object Generated
96-
97-
Click a button JButton ActionEvent
98-
Click a check box JCheckBox ItemEvent, ActionEvent
99-
Click a radio button JRadioButton ItemEvent, ActionEvent
100-
Press return on a text field JTextField ActionEvent
101-
Select a new item JComboBox ItemEvent, ActionEvent
102-
Window opened, closed, etc. Window WindowEvent
103-
Mouse pressed, released, etc. Component MouseEvent
104-
Key released, pressed, etc. Component KeyEvent
105-
```
106-
107-
- ```
108-
Event Class Listener Interface Listener Methods (Handlers)
109-
ActionEvent ActionListener actionPerformed(ActionEvent)
110-
ItemEvent ItemListener itemStateChanged(ItemEvent)
111-
WindowEvent WindowListener windowClosing(WindowEvent)
112-
windowOpened(WindowEvent)
113-
windowIconified(WindowEvent)
114-
windowDeiconified(WindowEvent)
115-
windowClosed(WindowEvent)
116-
windowActivated(WindowEvent)
117-
windowDeactivated(WindowEvent)
118-
ContainerEvent ContainerListener componentAdded(ContainerEvent)
119-
componentRemoved(ContainerEvent)
120-
MouseEvent MouseListener mousePressed(MouseEvent)
121-
mouseReleased(MouseEvent)
122-
mouseClicked(MouseEvent)
123-
mouseExited(MouseEvent)
124-
mouseEntered(MouseEvent)
125-
KeyEvent KeyListener keyPressed(KeyEvent)
126-
keyReleased(KeyEvent)
127-
keyTypeed(KeyEvent)
128-
129-
```
24+
- [Collections Framework](collections-framework)

collections-framework.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Collections Framework
2+
> Java Collection framework provides many interfaces (Set, List, Queue, Deque etc.) and classes (ArrayList, Vector, LinkedList, PriorityQueue, HashSet, LinkedHashSet, TreeSet etc).
3+
4+
- [Lecture Notes](lecture-notes/Java_Collection.docx)
5+
6+
- Readymade architecture, no need to implement functions
7+
8+
- `ArrayList` uses an `Object[]`, and makes a bigger array when the array gets full.
9+

java-swing.md

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
## Java Swing
2+
### GUI Basics
3+
- [Lecture Notes](lecture-notes/GUI_Basics.ppt)
4+
5+
- [Swing Notes](lecture-notes/Creating_User_Interfaces_Swing.ppt)
6+
7+
- Swing (interface) vs. AWT (event handling)
8+
9+
- ```java
10+
import javax.swing.*;
11+
12+
public class MyFrame {
13+
public static void main(String[] args) {
14+
JFrame frame = new JFrame("Test Frame");
15+
frame.setSize(400, 300);
16+
frame.setLocationRelativeTo(null);
17+
frame.setVisible(true);
18+
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
19+
}
20+
}
21+
```
22+
23+
- ```java
24+
import javax.swing.*;
25+
26+
public class MyFrameWithComponents {
27+
public static void main(String[] args) {
28+
JFrame frame = new JFrame( "MyFrameWithComponen")
29+
30+
JButton jbtOK = new JButton("OK"); // Add a button into the frame
31+
frame.add(jbtOK);
32+
33+
frame.setSize(400, 300);
34+
frame.setDefau1tC10seOperation(JFrame.EXIT_ON_CLOSE);
35+
frame.setLocationRe1ativeTo(nu11); // Center the frame
36+
frame.setVisib1e(true);
37+
}
38+
}
39+
```
40+
- [JFrame with inheritence](programs/MyFrame1.java)
41+
42+
### Layout Manager
43+
- For arraning a position into containers
44+
45+
- [FlowLayout](programs/ShowFlowLayout.java)
46+
47+
- [GridLayout](programs/ShowGridLayout.java)
48+
49+
- [BorderLayout](programs/ShowBorderLayout.java)
50+
51+
- `Color` class
52+
- ```java
53+
Color mycolor = new Color(228, 100, 50);
54+
// how to set for button
55+
mybutton.setBackground(Color.mycolor);
56+
mybutton.setForeground(Color.mycolor);
57+
```
58+
59+
### JPanel
60+
- In `JFrame` we add a component `JPanel`
61+
62+
- [TestPanels](programs/TestPanels.java)
63+
64+
### Event-Handling in Java (Event-Driven Programming)
65+
66+
- [Lecture Notes](lecture-notes/Event-Driven_Programming.ppt)
67+
68+
- Event-driven programming (depends of action) <-> procedural programming (step by step)
69+
70+
- [HandleEvent](programs/HandleEvent.java)
71+
72+
- [HandleEvent1](programs/HandleEvent1.java) with the use of Inner Classes
73+
74+
- ```
75+
User Action Object Generated
76+
77+
Click a button JButton ActionEvent
78+
Click a check box JCheckBox ItemEvent, ActionEvent
79+
Click a radio button JRadioButton ItemEvent, ActionEvent
80+
Press return on a text field JTextField ActionEvent
81+
Select a new item JComboBox ItemEvent, ActionEvent
82+
Window opened, closed, etc. Window WindowEvent
83+
Mouse pressed, released, etc. Component MouseEvent
84+
Key released, pressed, etc. Component KeyEvent
85+
```
86+
87+
- ```
88+
Event Class Listener Interface Listener Methods (Handlers)
89+
ActionEvent ActionListener actionPerformed(ActionEvent)
90+
ItemEvent ItemListener itemStateChanged(ItemEvent)
91+
WindowEvent WindowListener windowClosing(WindowEvent)
92+
windowOpened(WindowEvent)
93+
windowIconified(WindowEvent)
94+
windowDeiconified(WindowEvent)
95+
windowClosed(WindowEvent)
96+
windowActivated(WindowEvent)
97+
windowDeactivated(WindowEvent)
98+
ContainerEvent ContainerListener componentAdded(ContainerEvent)
99+
componentRemoved(ContainerEvent)
100+
MouseEvent MouseListener mousePressed(MouseEvent)
101+
mouseReleased(MouseEvent)
102+
mouseClicked(MouseEvent)
103+
mouseExited(MouseEvent)
104+
mouseEntered(MouseEvent)
105+
KeyEvent KeyListener keyPressed(KeyEvent)
106+
keyReleased(KeyEvent)
107+
keyTypeed(KeyEvent)
108+
109+
```

lab-05/lab-05.iml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="inheritedJdk" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
</component>
11+
</module>

lecture-notes/Java_Collection.docx

156 KB
Binary file not shown.

0 commit comments

Comments
 (0)