Skip to content

Instantly share code, notes, and snippets.

@Da9el00
Da9el00 / Controller.java
Created January 2, 2022 14:15
Brick Breaker
package sample;
import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.geometry.Bounds;
@Da9el00
Da9el00 / HelloController.java
Created January 19, 2022 13:37
TableView Custom row hieghts
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.ListView;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
@Da9el00
Da9el00 / AdversarialSearchTicTacToe.java
Created March 28, 2022 14:33
Tic-Tac-Toe Minimax search AI
import java.util.ArrayList;
public class AdversarialSearchTicTacToe {
public int minMaxDecision(State state){
ArrayList<State> possibleMoves = successorsOf(state);
ArrayList<Integer> movesList = new ArrayList<>();
for (State states: possibleMoves) {
@Da9el00
Da9el00 / Application.java
Created April 9, 2022 17:54
JavaFX and Scene Builder - Flappy Bird
package com.example.flappybird;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
public class Application extends javafx.application.Application {
@Override
@Da9el00
Da9el00 / Controller.java
Created April 11, 2022 09:27
JavaFX - Sierpinski Triangle
package sample;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
@Da9el00
Da9el00 / Application.java
Last active May 29, 2022 17:44
JavaFX Grid-based draggable nodes
package com.example.gridbaseddraggable;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
public class Application extends javafx.application.Application {
@Override
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
public class Application extends javafx.application.Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(Application.class.getResource("hello-view.fxml"));
@Da9el00
Da9el00 / HelloController.java
Created June 21, 2022 10:56
Javafx alert repeating every x seconds
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Platform;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import javafx.util.Duration;
import java.net.URL;
import java.util.Optional;
import java.util.ResourceBundle;
@Da9el00
Da9el00 / Application.java
Created July 6, 2022 17:34
Memory game in JavaFX
package com.example.memorygame;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
public class Application extends javafx.application.Application {
@Override
@Da9el00
Da9el00 / MovementController.java
Last active January 21, 2023 09:45
Moving Spites in JavaFX
import javafx.animation.AnimationTimer;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.fxml.FXML;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCode;
import javafx.scene.layout.AnchorPane;
import javafx.scene.shape.Rectangle;