Skip to content

Commit 9459b78

Browse files
Md.Ghulam Azad AnsariMd.Ghulam Azad Ansari
Md.Ghulam Azad Ansari
authored and
Md.Ghulam Azad Ansari
committed
fixed bugs
1 parent 81fccdb commit 9459b78

16 files changed

+993
-932
lines changed

Library Management System/.classpath

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
<attribute name="module" value="true"/>
77
</attributes>
88
</classpathentry>
9-
<classpathentry kind="lib" path="D:/JAVA/JAR Files/jfoenix-9.0.4.jar">
9+
<classpathentry kind="lib" path="lib/jfoenix-9.0.4.jar">
1010
<attributes>
1111
<attribute name="module" value="true"/>
1212
</attributes>
1313
</classpathentry>
14-
<classpathentry kind="lib" path="D:/JAVA/JAR Files/ojdbc8.jar">
14+
<classpathentry kind="lib" path="lib/ojdbc8.jar">
1515
<attributes>
1616
<attribute name="module" value="true"/>
1717
</attributes>
Binary file not shown.
3.85 MB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
package com.ghulam.about;
22

3+
import javafx.fxml.FXML;
34
import javafx.scene.layout.AnchorPane;
45
import javafx.scene.layout.StackPane;
56

67
public class AboutController {
7-
private StackPane stackPane;
8-
private AnchorPane rootPane;
9-
public void setPane(StackPane stackPane,AnchorPane rootPane){
10-
this.stackPane=stackPane;
11-
this.rootPane=rootPane;
12-
}
8+
@FXML
9+
private StackPane stackPane;
10+
@FXML
11+
private AnchorPane rootPane;
12+
13+
public void setPane(StackPane stackPane, AnchorPane rootPane) {
14+
this.stackPane = stackPane;
15+
this.rootPane = rootPane;
16+
}
1317
}

Library Management System/src/com/ghulam/alert/MaterialDialog.java

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
import javafx.scene.layout.StackPane;
1313

1414
public class MaterialDialog {
15-
private final static int OK = 1;
16-
private final static int CANCEL = 2;
1715
private static boolean isOpen = false;
1816
private BoxBlur blue;
1917
private JFXDialogLayout dialogLayout;
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
package com.ghulam.bookissuereturn;
22

3-
import com.ghulam.database.dao.BookDAO;
3+
import java.net.URL;
4+
import java.util.ResourceBundle;
5+
46
import com.ghulam.database.table.Book;
5-
import com.ghulam.database.table.Student;
67
import com.jfoenix.controls.JFXButton;
78
import com.jfoenix.controls.JFXCheckBox;
89
import com.jfoenix.controls.JFXTextField;
9-
import javafx.collections.FXCollections;
10+
1011
import javafx.collections.ObservableList;
1112
import javafx.collections.transformation.FilteredList;
1213
import javafx.collections.transformation.SortedList;
@@ -19,62 +20,61 @@
1920
import javafx.scene.layout.BorderPane;
2021
import javafx.stage.Stage;
2122

22-
import javax.swing.border.Border;
23-
import java.net.URL;
24-
import java.util.ResourceBundle;
25-
import java.util.function.Predicate;
23+
public class BookList implements Initializable {
24+
@FXML
25+
private BorderPane rootPane;
26+
@FXML
27+
private JFXTextField txtSearch;
28+
@FXML
29+
private JFXButton btnSubmit;
30+
@FXML
31+
private TableView<Book> table;
32+
@FXML
33+
private TableColumn<Book, Integer> colBookID;
34+
@FXML
35+
private TableColumn<Book, String> colNameBook;
36+
@FXML
37+
private TableColumn<Book, String> colAuthorName;
38+
@FXML
39+
private TableColumn<Book, String> colDescription;
40+
@FXML
41+
private TableColumn<Book, Integer> colStock;
42+
@FXML
43+
private TableColumn<Book, JFXCheckBox> colAction;
44+
private ObservableList<Book> list;
45+
46+
@Override
47+
public void initialize(URL location, ResourceBundle resources) {
48+
list = BookIssueReturnController.getBookObservableList();
49+
colBookID.setCellValueFactory(new PropertyValueFactory<>("id"));
50+
colNameBook.setCellValueFactory(new PropertyValueFactory<>("name"));
51+
colAuthorName.setCellValueFactory(new PropertyValueFactory<>("authorName"));
52+
colDescription.setCellValueFactory(new PropertyValueFactory<>("description"));
53+
colStock.setCellValueFactory(new PropertyValueFactory<>("stock"));
54+
colAction.setCellValueFactory(new PropertyValueFactory<>("action"));
55+
table.setItems(list);
56+
FilteredList<Book> filteredList = new FilteredList<>(list, e -> true);
57+
txtSearch.textProperty().addListener((observable, oldValue, newValue) -> {
58+
filteredList.setPredicate(book -> {
59+
if (newValue == null || newValue.isEmpty())
60+
return true;
61+
String data = newValue.toLowerCase();
62+
if (String.valueOf(book.getId()).toLowerCase().contains(data)
63+
|| book.getName().toLowerCase().contains(data)
64+
|| book.getAuthorName().toLowerCase().contains(data))
65+
return true;
66+
return false;
67+
});
68+
});
69+
SortedList<Book> sortedData = new SortedList<>(filteredList);
70+
sortedData.comparatorProperty().bind(table.comparatorProperty());
71+
table.setItems(sortedData);
2672

27-
public class BookList implements Initializable{
28-
@FXML
29-
private BorderPane rootPane;
30-
@FXML
31-
private JFXTextField txtSearch;
32-
@FXML
33-
private JFXButton btnSubmit;
34-
@FXML
35-
private TableView<Book> table;
36-
@FXML
37-
private TableColumn<Book, Integer> colBookID;
38-
@FXML
39-
private TableColumn<Book, String> colNameBook;
40-
@FXML
41-
private TableColumn<Book, String> colAuthorName;
42-
@FXML
43-
private TableColumn<Book, String> colDescription;
44-
@FXML
45-
private TableColumn<Book, Integer> colStock;
46-
@FXML
47-
private TableColumn<Book, JFXCheckBox> colAction;
48-
private ObservableList<Book> list;
49-
@Override
50-
public void initialize(URL location, ResourceBundle resources) {
51-
list=BookIssueReturnController.getBookObservableList();
52-
colBookID.setCellValueFactory(new PropertyValueFactory<>("id"));
53-
colNameBook.setCellValueFactory(new PropertyValueFactory<>("name"));
54-
colAuthorName.setCellValueFactory(new PropertyValueFactory<>("authorName"));
55-
colDescription.setCellValueFactory(new PropertyValueFactory<>("description"));
56-
colStock.setCellValueFactory(new PropertyValueFactory<>("stock"));
57-
colAction.setCellValueFactory(new PropertyValueFactory<>("action"));
58-
table.setItems(list);
59-
FilteredList<Book> filteredList=new FilteredList<>(list,e->true);
60-
txtSearch.textProperty().addListener((observable,oldValue,newValue)->{
61-
filteredList.setPredicate(book -> {
62-
if(newValue==null || newValue.isEmpty())
63-
return true;
64-
String data=newValue.toLowerCase();
65-
if(String.valueOf(book.getId()).toLowerCase().contains(data) || book.getName().toLowerCase().contains(data) || book.getAuthorName().toLowerCase().contains(data))
66-
return true;
67-
return false;
68-
});
69-
});
70-
SortedList<Book> sortedData = new SortedList<>(filteredList);
71-
sortedData.comparatorProperty().bind(table.comparatorProperty());
72-
table.setItems(sortedData);
73+
}
7374

74-
}
75-
@FXML
76-
void btnSubmitOnAction(ActionEvent event){
77-
Stage stage = (Stage) rootPane.getScene().getWindow();
78-
stage.close();
79-
}
75+
@FXML
76+
void btnSubmitOnAction(ActionEvent event) {
77+
Stage stage = (Stage) rootPane.getScene().getWindow();
78+
stage.close();
79+
}
8080
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
package com.ghulam.bookissuereturn;
22

3-
import com.ghulam.database.dao.StudentDAO;
4-
import com.ghulam.database.table.Book;
3+
import java.net.URL;
4+
import java.util.ResourceBundle;
5+
56
import com.ghulam.database.table.Student;
67
import com.jfoenix.controls.JFXButton;
78
import com.jfoenix.controls.JFXCheckBox;
89
import com.jfoenix.controls.JFXTextField;
9-
import javafx.collections.FXCollections;
10+
1011
import javafx.collections.ObservableList;
1112
import javafx.collections.transformation.FilteredList;
1213
import javafx.collections.transformation.SortedList;
@@ -19,59 +20,58 @@
1920
import javafx.scene.layout.BorderPane;
2021
import javafx.stage.Stage;
2122

22-
import java.net.URL;
23-
import java.util.ResourceBundle;
24-
2523
public class StudentList implements Initializable {
26-
@FXML
27-
private BorderPane rootPane;
28-
@FXML
29-
private JFXTextField txtSearch;
30-
@FXML
31-
private JFXButton btnSubmit;
32-
@FXML
33-
private TableView<Student> table;
34-
@FXML
35-
private TableColumn<Student, Integer> colStudentID;
36-
@FXML
37-
private TableColumn<Student, String> colStudentName;
38-
@FXML
39-
private TableColumn<Student, String> colClass;
40-
@FXML
41-
private TableColumn<Student,Integer> colRoll;
42-
@FXML
43-
private TableColumn<Student, JFXCheckBox> colAction;
44-
private ObservableList<Student> list;
45-
@Override
46-
public void initialize(URL location, ResourceBundle resources) {
47-
list=BookIssueReturnController.getStudentObservableList();
48-
colStudentID.setCellValueFactory(new PropertyValueFactory<>("studentID"));
49-
colStudentName.setCellValueFactory(new PropertyValueFactory<>("name"));
50-
colClass.setCellValueFactory(new PropertyValueFactory<>("cls"));
51-
colRoll.setCellValueFactory(new PropertyValueFactory<>("roll"));
52-
colAction.setCellValueFactory(new PropertyValueFactory<>("onAction"));
53-
table.setItems(list);
54-
FilteredList<Student> filteredList=new FilteredList<>(list,e->true);
55-
txtSearch.textProperty().addListener((observable,oldValue,newValue)->{
56-
filteredList.setPredicate(student->{
57-
if(newValue==null || newValue.isEmpty())
58-
return true;
59-
String data=newValue.toLowerCase();
60-
if(String.valueOf(student.getStudentID()).toLowerCase().contains(data) ||
61-
student.getName().toLowerCase().contains(data) ||
62-
String.valueOf(student.getRoll()).toLowerCase().contains(data) ||
63-
student.getCls().toLowerCase().contains(data))
64-
return true;
65-
return false;
66-
});
67-
});
68-
SortedList<Student> sortedList=new SortedList<>(filteredList);
69-
sortedList.comparatorProperty().bind(table.comparatorProperty());
70-
table.setItems(sortedList);
71-
}
72-
@FXML
73-
void btnSubmitOnAction(ActionEvent event){
74-
Stage stage = (Stage) rootPane.getScene().getWindow();
75-
stage.close();
76-
}
24+
@FXML
25+
private BorderPane rootPane;
26+
@FXML
27+
private JFXTextField txtSearch;
28+
@FXML
29+
private JFXButton btnSubmit;
30+
@FXML
31+
private TableView<Student> table;
32+
@FXML
33+
private TableColumn<Student, Integer> colStudentID;
34+
@FXML
35+
private TableColumn<Student, String> colStudentName;
36+
@FXML
37+
private TableColumn<Student, String> colClass;
38+
@FXML
39+
private TableColumn<Student, Integer> colRoll;
40+
@FXML
41+
private TableColumn<Student, JFXCheckBox> colAction;
42+
private ObservableList<Student> list;
43+
44+
@Override
45+
public void initialize(URL location, ResourceBundle resources) {
46+
list = BookIssueReturnController.getStudentObservableList();
47+
colStudentID.setCellValueFactory(new PropertyValueFactory<>("studentID"));
48+
colStudentName.setCellValueFactory(new PropertyValueFactory<>("name"));
49+
colClass.setCellValueFactory(new PropertyValueFactory<>("cls"));
50+
colRoll.setCellValueFactory(new PropertyValueFactory<>("roll"));
51+
colAction.setCellValueFactory(new PropertyValueFactory<>("onAction"));
52+
table.setItems(list);
53+
FilteredList<Student> filteredList = new FilteredList<>(list, e -> true);
54+
txtSearch.textProperty().addListener((observable, oldValue, newValue) -> {
55+
filteredList.setPredicate(student -> {
56+
if (newValue == null || newValue.isEmpty())
57+
return true;
58+
String data = newValue.toLowerCase();
59+
if (String.valueOf(student.getStudentID()).toLowerCase().contains(data)
60+
|| student.getName().toLowerCase().contains(data)
61+
|| String.valueOf(student.getRoll()).toLowerCase().contains(data)
62+
|| student.getCls().toLowerCase().contains(data))
63+
return true;
64+
return false;
65+
});
66+
});
67+
SortedList<Student> sortedList = new SortedList<>(filteredList);
68+
sortedList.comparatorProperty().bind(table.comparatorProperty());
69+
table.setItems(sortedList);
70+
}
71+
72+
@FXML
73+
void btnSubmitOnAction(ActionEvent event) {
74+
Stage stage = (Stage) rootPane.getScene().getWindow();
75+
stage.close();
76+
}
7777
}

0 commit comments

Comments
 (0)