Skip to content

Instantly share code, notes, and snippets.

@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
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 / 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 / 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 / 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;
package sample;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import java.io.File;
import java.util.Random;
@Da9el00
Da9el00 / Controller.java
Created December 3, 2021 18:48
Magic 8-ball
package sample;
import javafx.fxml.FXML;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.text.Text;
import java.util.Random;
@Da9el00
Da9el00 / Animal.Java
Created November 23, 2021 18:21
JavaFX and Scene Builder - Edit TableView
package sample;
public class Animal {
private int id;
private String type;
private String name;
public Animal(int id, String type, String name) {
this.id = id;
@Da9el00
Da9el00 / Controller.java
Created November 10, 2021 15:19
Quadratic Equation Solver
package sample;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
@Da9el00
Da9el00 / Controller.java
Created November 4, 2021 08:33
JavaFX and Scene Builder - Option Picker
package sample;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;