├── .classpath
├── .project
├── .settings
├── org.eclipse.jdt.core.prefs
└── org.eclipse.m2e.core.prefs
├── Music
├── Song1.mpeg
├── song2.mpeg
├── song3.mpeg
└── song4.mpeg
├── bin
└── application
│ ├── Main.class
│ ├── Test.fxml
│ ├── TestController.class
│ └── application.css
├── build.fxbuild
├── pom.xml
├── src
├── application
│ ├── Controller.java
│ ├── Food.fxml
│ ├── Login.fxml
│ ├── Login.java
│ ├── Logout.fxml
│ ├── Main.fxml
│ ├── Main.java
│ ├── Menu.fxml
│ ├── MusicController.java
│ ├── MusicPlayer.fxml
│ ├── Scene.java
│ ├── Temp.fxml
│ ├── Test.fxml
│ ├── TestController.java
│ ├── application.css
│ ├── bulb.fxml
│ ├── bulb1.png
│ ├── bulb2.png
│ ├── energy-drink.png
│ ├── hamburger.png
│ ├── pizza.png
│ └── slider.java
├── icon.png
└── module-info.java
└── target
└── classes
├── META-INF
├── MANIFEST.MF
└── maven
│ └── HelloJavafx
│ └── HelloJavafx
│ ├── pom.properties
│ └── pom.xml
├── application
├── Controller.class
├── Food.fxml
├── Login.class
├── Login.fxml
├── Logout.fxml
├── Main.class
├── Main.fxml
├── Menu.fxml
├── MusicController$1.class
├── MusicController$2.class
├── MusicController.class
├── MusicPlayer.fxml
├── Temp.fxml
├── Test.fxml
├── TestController.class
├── application.css
├── bulb.fxml
├── bulb1.png
├── bulb2.png
├── energy-drink.png
├── hamburger.png
├── pizza.png
├── slider$1.class
└── slider.class
├── icon.png
└── module-info.class
/.classpath:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | HelloJavafx
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.xtext.ui.shared.xtextBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.m2e.core.maven2Builder
20 |
21 |
22 |
23 |
24 |
25 | org.eclipse.m2e.core.maven2Nature
26 | org.eclipse.xtext.ui.shared.xtextNature
27 | org.eclipse.jdt.core.javanature
28 |
29 |
30 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=20
3 | org.eclipse.jdt.core.compiler.compliance=20
4 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
5 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
6 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
7 | org.eclipse.jdt.core.compiler.release=enabled
8 | org.eclipse.jdt.core.compiler.source=20
9 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------
/Music/Song1.mpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/Music/Song1.mpeg
--------------------------------------------------------------------------------
/Music/song2.mpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/Music/song2.mpeg
--------------------------------------------------------------------------------
/Music/song3.mpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/Music/song3.mpeg
--------------------------------------------------------------------------------
/Music/song4.mpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/Music/song4.mpeg
--------------------------------------------------------------------------------
/bin/application/Main.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/bin/application/Main.class
--------------------------------------------------------------------------------
/bin/application/Test.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/bin/application/TestController.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/bin/application/TestController.class
--------------------------------------------------------------------------------
/bin/application/application.css:
--------------------------------------------------------------------------------
1 | /* JavaFX CSS - Leave this comment until you have at least create one rule which uses -fx-Property */
--------------------------------------------------------------------------------
/build.fxbuild:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 | HelloJavafx
5 | HelloJavafx
6 | 0.0.1-SNAPSHOT
7 |
8 | src
9 |
10 |
11 | src
12 |
13 | **/*.java
14 |
15 |
16 |
17 |
18 |
19 | maven-compiler-plugin
20 | 3.8.1
21 |
22 | 20
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/application/Controller.java:
--------------------------------------------------------------------------------
1 | package application;
2 |
3 |
4 | import java.io.IOException;
5 | import javafx.event.ActionEvent;
6 | import javafx.fxml.FXML;
7 | import javafx.fxml.FXMLLoader;
8 | import javafx.scene.Node;
9 | import javafx.scene.Parent;
10 | import javafx.scene.Scene;
11 | import javafx.scene.control.Alert;
12 | import javafx.scene.control.Alert.AlertType;
13 | import javafx.scene.control.Button;
14 | import javafx.scene.control.ButtonType;
15 | import javafx.scene.control.CheckBox;
16 | import javafx.scene.control.Label;
17 | import javafx.scene.control.RadioButton;
18 | import javafx.scene.control.TextField;
19 | import javafx.scene.image.Image;
20 | import javafx.scene.image.ImageView;
21 | import javafx.scene.layout.AnchorPane;
22 |
23 | import javafx.scene.shape.Circle;
24 | import javafx.stage.Stage;
25 |
26 |
27 |
28 |
29 | public class Controller{
30 |
31 | @FXML
32 | private Circle mycircle;
33 | private double x;
34 | private double y;
35 | @FXML
36 | TextField nameTextField;
37 |
38 | private Stage stage;
39 | private Scene scene;
40 | private Parent root;
41 |
42 | @FXML
43 | private Button logoutButton;
44 | @FXML AnchorPane sectionPane;
45 |
46 | @FXML
47 | private CheckBox myCheckButton;
48 | @FXML
49 | private Label myLabel;
50 | @FXML
51 | private ImageView myImageView;
52 |
53 | @FXML
54 | private ImageView Myimg;
55 | @FXML
56 |
57 | private RadioButton button1,button2,button3;
58 |
59 | @FXML
60 | private Label nameLabel;
61 |
62 |
63 | Image myImage1 = new Image(getClass().getResourceAsStream("bulb1.png"));
64 | Image myImage2 = new Image(getClass().getResourceAsStream("bulb2.png"));
65 | Image myImage3 = new Image(getClass().getResourceAsStream("pizza.png"));
66 | Image myImage5 = new Image(getClass().getResourceAsStream("energy-drink.png"));
67 | Image myImage4 = new Image(getClass().getResourceAsStream("hamburger.png"));
68 |
69 |
70 | public void getFood (ActionEvent event) {
71 | if(button1.isSelected()) {
72 | Myimg.setImage(myImage3);
73 | }
74 | else if(button2.isSelected()){
75 | Myimg.setImage(myImage4);
76 | }
77 | else if(button3.isSelected()){
78 | Myimg.setImage(myImage5);
79 | }
80 | }
81 |
82 | public void change (ActionEvent event) {
83 | if(myCheckButton.isSelected()) {
84 | System.out.println("ON");
85 | myLabel.setText("ON");
86 | myImageView.setImage(myImage1);
87 | }
88 | else {
89 | System.out.println("OFF");
90 | myLabel.setText("OFF");
91 | myImageView.setImage(myImage2);
92 | }
93 | }
94 | public void logout(ActionEvent event) {
95 |
96 | Alert alert = new Alert(AlertType.CONFIRMATION);
97 | alert.setTitle("Logout");
98 | alert.setHeaderText("Your are About to Leave");
99 | alert.setContentText("Do You want to Save Before Exiting");
100 |
101 | if(alert.showAndWait().get() == ButtonType.OK) {
102 | stage = (Stage) sectionPane.getScene().getWindow();
103 | System.out.println("Logged out");
104 | stage.close();
105 | }
106 | }
107 |
108 | public void Login(ActionEvent event) throws IOException {
109 | String username = nameTextField.getText();
110 | FXMLLoader loader = new FXMLLoader(getClass().getResource("Test.fxml"));
111 | root = loader.load();
112 |
113 | Controller loginC = loader.getController();
114 | loginC.displayName(username);
115 | System.out.println("Logged In as" + username);
116 | }
117 |
118 |
119 | public void displayName(String username) {
120 | nameLabel.setText("Welcome: " + username);
121 | }
122 | public void switchToScene1(ActionEvent event) throws IOException {
123 | root = FXMLLoader.load(getClass().getResource("Test.fxml"));
124 | stage=(Stage) ((Node)event.getSource()).getScene().getWindow();
125 | scene = new Scene(root);
126 | stage.setScene(scene);
127 | stage.show();
128 | }
129 | public void switchToScene2(ActionEvent event) throws IOException {
130 | Parent root = FXMLLoader.load(getClass().getResource("Main.fxml"));
131 | stage=(Stage) ((Node)event.getSource()).getScene().getWindow();
132 | scene = new Scene(root);
133 | stage.setScene(scene);
134 | stage.show();
135 |
136 | }
137 |
138 | public void switchToScene3(ActionEvent event) throws IOException {
139 | root = FXMLLoader.load(getClass().getResource("Bulb.fxml"));
140 | stage=(Stage) ((Node)event.getSource()).getScene().getWindow();
141 | scene = new Scene(root);
142 | stage.setScene(scene);
143 | stage.show();
144 | }
145 | public void switchToScene4(ActionEvent event) throws IOException {
146 | root = FXMLLoader.load(getClass().getResource("Food.fxml"));
147 | stage=(Stage) ((Node)event.getSource()).getScene().getWindow();
148 | scene = new Scene(root);
149 | stage.setScene(scene);
150 | stage.show();
151 | }
152 | public void switchToScene5(ActionEvent event) throws IOException {
153 | root = FXMLLoader.load(getClass().getResource("Temp.fxml"));
154 | stage=(Stage) ((Node)event.getSource()).getScene().getWindow();
155 | scene = new Scene(root);
156 | stage.setScene(scene);
157 | stage.show();
158 | }
159 | public void switchToScene6(ActionEvent event) throws IOException {
160 | root = FXMLLoader.load(getClass().getResource("Menu.fxml"));
161 | stage=(Stage) ((Node)event.getSource()).getScene().getWindow();
162 | scene = new Scene(root);
163 | stage.setScene(scene);
164 | stage.show();
165 |
166 | }
167 | public void switchToScene7(ActionEvent event) throws IOException {
168 | root = FXMLLoader.load(getClass().getResource("MusicPlayer.fxml"));
169 | stage=(Stage) ((Node)event.getSource()).getScene().getWindow();
170 | scene = new Scene(root);
171 | stage.setScene(scene);
172 | stage.show();
173 |
174 | }
175 |
176 |
177 | public void up(ActionEvent e) {
178 | mycircle.setCenterY(y-=10);
179 | System.out.println("UP");
180 | }
181 | public void down(ActionEvent e) {
182 | mycircle.setCenterY(y+=10);
183 | System.out.println("Down");
184 | }
185 | public void left(ActionEvent e) {
186 | mycircle.setCenterX(x-=10);
187 | System.out.println("Left");
188 | }
189 | public void right(ActionEvent e) {
190 | mycircle.setCenterX(x+=10);
191 | System.out.println("Right");
192 | }
193 |
194 |
195 |
196 |
197 | }
198 |
199 |
--------------------------------------------------------------------------------
/src/application/Food.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/application/Login.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/application/Login.java:
--------------------------------------------------------------------------------
1 | package application;
2 |
3 |
4 | import javafx.fxml.FXML;
5 | import javafx.scene.control.Label;
6 |
7 | public class Login {
8 |
9 | @FXML
10 | private Label nameLabel;
11 |
12 | public void displayName(String username) {
13 | nameLabel.setText("Welcome: " + username);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/application/Logout.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/application/Main.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/application/Main.java:
--------------------------------------------------------------------------------
1 | package application;
2 |
3 | import javafx.application.Application;
4 | import javafx.event.ActionEvent;
5 | import javafx.fxml.FXMLLoader;
6 | import javafx.scene.Parent;
7 | import javafx.scene.Scene;
8 | import javafx.scene.control.Alert;
9 | import javafx.scene.control.ButtonType;
10 | import javafx.scene.control.Alert.AlertType;
11 | import javafx.stage.Stage;
12 |
13 | public class Main extends Application {
14 |
15 | public static void main(String[] args) {
16 | launch(args);
17 | }
18 |
19 | @Override
20 | public void start(Stage primaryStage) throws Exception {
21 | Parent root = FXMLLoader.load(getClass().getResource("Login.fxml"));
22 | Scene scene = new Scene(root);
23 | // scene.getStylesheets().add(getClass().getResource("Application.css").toExternalForm());
24 | primaryStage.setScene(scene);
25 | primaryStage.show();
26 |
27 | primaryStage.setOnCloseRequest(event -> {
28 | event.consume();
29 | logout(primaryStage);
30 | });
31 | }
32 |
33 | public void logout(Stage primaryStage) {
34 |
35 | Alert alert = new Alert(AlertType.CONFIRMATION);
36 | alert.setTitle("Exit");
37 | alert.setHeaderText("Your are About to Exit");
38 | alert.setContentText("Do You want to Save Before Exiting");
39 |
40 | if(alert.showAndWait().get() == ButtonType.OK) {
41 | // stage = (Stage) sectionPane.getScene().getWindow();
42 | System.out.println("Logged out");
43 | primaryStage.close();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/application/Menu.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
55 |
60 |
65 |
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/src/application/MusicController.java:
--------------------------------------------------------------------------------
1 | package application;
2 |
3 | import java.io.File;
4 | import java.net.URL;
5 | import java.util.ArrayList;
6 | import java.util.ResourceBundle;
7 | import java.util.Timer;
8 | import java.util.TimerTask;
9 |
10 | import javafx.beans.value.ChangeListener;
11 | import javafx.beans.value.ObservableValue;
12 | import javafx.event.ActionEvent;
13 | import javafx.fxml.FXML;
14 | import javafx.fxml.Initializable;
15 | import javafx.scene.control.Button;
16 | import javafx.scene.control.ComboBox;
17 | import javafx.scene.control.Label;
18 | import javafx.scene.control.ProgressBar;
19 | import javafx.scene.control.Slider;
20 |
21 | import javafx.scene.layout.Pane;
22 | import javafx.util.Duration;
23 | import javafx.scene.media.MediaPlayer;
24 | import javafx.scene.media.Media;
25 |
26 |
27 | public class MusicController implements Initializable{
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | @FXML
37 | private Pane MusicPane;
38 | @FXML
39 | private Label songLabel;
40 | @FXML
41 | private Button playButton,pauseButton,prevButton,nextButton,resetButton;
42 | @FXML
43 | private ComboBox speedBox;
44 | @FXML
45 | private Slider volumeSlider;
46 | @FXML
47 | private ProgressBar progressBar;
48 |
49 | private Media media;
50 | private MediaPlayer mediaPlayer;
51 |
52 | private File directory;
53 | private File[] files;
54 |
55 | private ArrayList songs;
56 |
57 | private int songNumber;
58 | private int[] speeds = {25,50,75,100,125,150,175,200};
59 |
60 | private Timer timer;
61 | private TimerTask task;
62 | private boolean running;
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | @Override
71 | public void initialize(URL arg0, ResourceBundle arg1) {
72 | songs = new ArrayList();
73 | directory =new File("Music");
74 | files = directory.listFiles();
75 |
76 | if(files !=null) {
77 | for(File file: files) {
78 | songs.add(file);
79 | System.out.println(file);
80 | }
81 | }
82 |
83 |
84 | media = new Media(songs.get(songNumber).toURI().toString());
85 | mediaPlayer = new MediaPlayer(media);
86 | // songLabel.setText(songs.get(songNumber).getName());
87 |
88 | for (int i =0; i< speeds.length; i++) {
89 | speedBox.getItems().add(Integer.toString(speeds[i])+"%");
90 | }
91 | speedBox.setOnAction(this::speedMedia);
92 |
93 | volumeSlider.valueProperty().addListener(new ChangeListener() {
94 |
95 | @Override
96 | public void changed(ObservableValue extends Number> observable, Number oldValue, Number newValue) {
97 | mediaPlayer.setVolume(newValue.doubleValue() * 0.01);
98 | }
99 | });
100 |
101 |
102 | progressBar.setStyle("-fx-accent: #00FF00;");
103 |
104 | }
105 | public void playMedia() {
106 | beginTimer();
107 | speedMedia(null);
108 |
109 | mediaPlayer.setVolume(volumeSlider.getValue() * 0.01);
110 | mediaPlayer.play();
111 |
112 | }
113 | public void pauseMedia() {
114 | cancelTimer();
115 | mediaPlayer.pause();
116 |
117 | }
118 | public void resetMedia() {
119 | progressBar.setProgress(0);
120 | mediaPlayer.seek(Duration.seconds(0));
121 |
122 | }
123 | public void prevMedia() {
124 | if(songNumber>0) {
125 | songNumber--;
126 | mediaPlayer.stop();
127 |
128 | if(running) {
129 | cancelTimer();
130 | }
131 |
132 | media = new Media(songs.get(songNumber).toURI().toString());
133 | mediaPlayer = new MediaPlayer(media);
134 | songLabel.setText(songs.get(songNumber).getName());
135 | playMedia();
136 |
137 | }
138 | else {
139 |
140 | songNumber = songs.size()-1;
141 |
142 | mediaPlayer.stop();
143 |
144 | if(running) {
145 | cancelTimer();
146 | }
147 |
148 | media = new Media(songs.get(songNumber).toURI().toString());
149 | mediaPlayer = new MediaPlayer(media);
150 | songLabel.setText(songs.get(songNumber).getName());
151 | playMedia();
152 | }
153 |
154 | }
155 | public void nextMedia() {
156 | if(songNumber
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
24 |
29 |
34 |
39 |
40 |
41 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/src/application/Scene.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/src/application/Scene.java
--------------------------------------------------------------------------------
/src/application/Temp.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/application/Test.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
18 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/application/TestController.java:
--------------------------------------------------------------------------------
1 | package application;
2 |
3 | public class TestController {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/src/application/application.css:
--------------------------------------------------------------------------------
1 | /* JavaFX CSS - Leave this comment until you have at least create one rule which uses -fx-Property */
--------------------------------------------------------------------------------
/src/application/bulb.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/application/bulb1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/src/application/bulb1.png
--------------------------------------------------------------------------------
/src/application/bulb2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/src/application/bulb2.png
--------------------------------------------------------------------------------
/src/application/energy-drink.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/src/application/energy-drink.png
--------------------------------------------------------------------------------
/src/application/hamburger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/src/application/hamburger.png
--------------------------------------------------------------------------------
/src/application/pizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/src/application/pizza.png
--------------------------------------------------------------------------------
/src/application/slider.java:
--------------------------------------------------------------------------------
1 | package application;
2 |
3 | import java.io.IOException;
4 | import java.net.URL;
5 | import java.util.ResourceBundle;
6 |
7 | import javafx.beans.value.ChangeListener;
8 | import javafx.beans.value.ObservableValue;
9 | import javafx.event.ActionEvent;
10 | import javafx.fxml.FXML;
11 | import javafx.fxml.FXMLLoader;
12 | import javafx.fxml.Initializable;
13 | import javafx.scene.Node;
14 | import javafx.scene.Parent;
15 | import javafx.scene.Scene;
16 | import javafx.scene.control.Label;
17 | import javafx.scene.control.Slider;
18 | import javafx.stage.Stage;
19 |
20 | public class slider implements Initializable {
21 | @FXML
22 | private Label tempLabel;
23 | @FXML
24 | private Slider mySlider;
25 |
26 | private Stage stage;
27 | private Scene scene;
28 | private Parent root;
29 |
30 | public void switchToScene5(ActionEvent event) throws IOException {
31 | root = FXMLLoader.load(getClass().getResource("Test.fxml"));
32 | stage=(Stage) ((Node)event.getSource()).getScene().getWindow();
33 | scene = new Scene(root);
34 | stage.setScene(scene);
35 | stage.show();
36 | }
37 |
38 | @Override
39 | public void initialize(URL arg0, ResourceBundle arg1) {
40 |
41 | int temp = (int)mySlider.getValue();
42 |
43 | tempLabel.setText(temp + "°C");
44 |
45 | mySlider.valueProperty().addListener(new ChangeListener() {
46 | @Override
47 | public void changed(ObservableValue extends Number> observable, Number oldValue, Number newValue) {
48 | int temp = newValue.intValue();
49 |
50 | tempLabel.setText(temp + "°C");
51 | }
52 | });
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/src/icon.png
--------------------------------------------------------------------------------
/src/module-info.java:
--------------------------------------------------------------------------------
1 | module HelloJavafx {
2 | requires javafx.controls;
3 | requires javafx.fxml;
4 | requires javafx.graphics;
5 | requires java.desktop;
6 | requires javafx.base;
7 | requires javafx.media;
8 |
9 | opens application to javafx.graphics, javafx.fxml;
10 | }
11 |
--------------------------------------------------------------------------------
/target/classes/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Build-Jdk-Spec: 20
3 | Created-By: Maven Integration for Eclipse
4 |
5 |
--------------------------------------------------------------------------------
/target/classes/META-INF/maven/HelloJavafx/HelloJavafx/pom.properties:
--------------------------------------------------------------------------------
1 | #Generated by Maven Integration for Eclipse
2 | #Fri Sep 22 03:30:00 PDT 2023
3 | artifactId=HelloJavafx
4 | groupId=HelloJavafx
5 | m2e.projectLocation=C\:\\JavaWorkspace\\HelloJavafx
6 | m2e.projectName=HelloJavafx
7 | version=0.0.1-SNAPSHOT
8 |
--------------------------------------------------------------------------------
/target/classes/META-INF/maven/HelloJavafx/HelloJavafx/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 | HelloJavafx
5 | HelloJavafx
6 | 0.0.1-SNAPSHOT
7 |
8 | src
9 |
10 |
11 | src
12 |
13 | **/*.java
14 |
15 |
16 |
17 |
18 |
19 | maven-compiler-plugin
20 | 3.8.1
21 |
22 | 20
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/target/classes/application/Controller.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/Controller.class
--------------------------------------------------------------------------------
/target/classes/application/Food.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/target/classes/application/Login.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/Login.class
--------------------------------------------------------------------------------
/target/classes/application/Login.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/target/classes/application/Logout.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/target/classes/application/Main.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/Main.class
--------------------------------------------------------------------------------
/target/classes/application/Main.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/target/classes/application/Menu.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
55 |
60 |
65 |
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/target/classes/application/MusicController$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/MusicController$1.class
--------------------------------------------------------------------------------
/target/classes/application/MusicController$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/MusicController$2.class
--------------------------------------------------------------------------------
/target/classes/application/MusicController.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/MusicController.class
--------------------------------------------------------------------------------
/target/classes/application/MusicPlayer.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
24 |
29 |
34 |
39 |
40 |
41 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/target/classes/application/Temp.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/target/classes/application/Test.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
18 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/target/classes/application/TestController.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/TestController.class
--------------------------------------------------------------------------------
/target/classes/application/application.css:
--------------------------------------------------------------------------------
1 | /* JavaFX CSS - Leave this comment until you have at least create one rule which uses -fx-Property */
--------------------------------------------------------------------------------
/target/classes/application/bulb.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/target/classes/application/bulb1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/bulb1.png
--------------------------------------------------------------------------------
/target/classes/application/bulb2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/bulb2.png
--------------------------------------------------------------------------------
/target/classes/application/energy-drink.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/energy-drink.png
--------------------------------------------------------------------------------
/target/classes/application/hamburger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/hamburger.png
--------------------------------------------------------------------------------
/target/classes/application/pizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/pizza.png
--------------------------------------------------------------------------------
/target/classes/application/slider$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/slider$1.class
--------------------------------------------------------------------------------
/target/classes/application/slider.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/application/slider.class
--------------------------------------------------------------------------------
/target/classes/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/icon.png
--------------------------------------------------------------------------------
/target/classes/module-info.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdullahAssi/Java-Practice/7568055838ec39cfc48944bc4f9c8be9431fa351/target/classes/module-info.class
--------------------------------------------------------------------------------