Skip to content

Instantly share code, notes, and snippets.

View sciPher80s's full-sized avatar
☣️
Don't Panic!

sciPher80s sciPher80s

☣️
Don't Panic!
View GitHub Profile
@jewelsea
jewelsea / Main.java
Last active May 18, 2025 01:17
Small JavaFX framework for swapping in and out child panes in a main FXML container. Code is for Java 8+.
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import java.io.IOException;
/**
* Main application class.
@jewelsea
jewelsea / TextAreaTabAndEnterHandler.java
Created May 21, 2013 23:34
Allow a Tab key press in a TextArea to focus on the next field and an Enter key press in a TextArea to trigger a default button.
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.beans.value.*;
import javafx.collections.ObservableList;
import javafx.event.*;
import javafx.scene.*;
import javafx.scene.control.*;
import static javafx.scene.input.KeyCode.ENTER;
import static javafx.scene.input.KeyCode.TAB;
import javafx.scene.input.KeyEvent;
@jewelsea
jewelsea / Greed.java
Last active April 5, 2023 11:53
Demo of interaction of various concurrency aspects with JavaFX
import javafx.animation.*;
import javafx.application.*;
import javafx.beans.*;
import javafx.beans.Observable;
import javafx.beans.property.*;
import javafx.collections.*;
import javafx.concurrent.Task;
import javafx.event.*;
import javafx.scene.Scene;
import javafx.scene.control.*;
@jewelsea
jewelsea / ImageScaler.java
Created April 18, 2013 20:17
Demonstrates different methods of scaling images in JavaFX and the effects of scaling with each.
import javafx.application.*;
import javafx.geometry.HPos;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.image.*;
import javafx.scene.layout.*;
import javafx.stage.Stage;
public class ImageScaler extends Application {
@jewelsea
jewelsea / PromptingTaskDemo.java
Last active April 5, 2023 11:53
Demonstrates a JavaFX task which runs in the background reading data and, when required, pauses from reading data to prompt the user for extra input before continuing processing.
import java.util.concurrent.*;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.application.Platform;
import javafx.beans.property.*;
import javafx.concurrent.Task;
import javafx.event.*;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.control.*;
@jewelsea
jewelsea / ImageFill.java
Created January 26, 2012 01:05
Size an image to fit a Region in JavaFX.
package imagefill;
import javafx.application.Application;
import javafx.beans.property.*;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.ScrollPane;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.Pane;