Skip to content

Instantly share code, notes, and snippets.

View ctnels's full-sized avatar
🏠
Working from home

ctnels

🏠
Working from home
View GitHub Profile
@ctnels
ctnels / WebViewFormPost.java
Created February 1, 2018 02:04 — forked from jewelsea/WebViewFormPost.java
Performing an automated form post of login credentials using a JavaFX WebView.
import javafx.application.Application;
import javafx.beans.property.*;
import javafx.beans.value.*;
import javafx.event.*;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.scene.web.*;
import javafx.stage.Stage;
import org.w3c.dom.*;
@ctnels
ctnels / Hoverboard.java
Created February 1, 2018 02:03 — forked from jewelsea/Hoverboard.java
Hover over a JavaFX Label to reveal a ComboBox to change the label's text.
import javafx.application.Application;
import javafx.geometry.*;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.Stage;
public class Hoverboard extends Application {
public class TextChooser extends StackPane {
@ctnels
ctnels / ShadowedRoundedImage.java
Created February 1, 2018 02:03 — forked from jewelsea/ShadowedRoundedImage.java
Creates a JavaFX ImageView which contains an image displayed in as a rounded rectangle with a drop shadow effect.
import javafx.application.Application;
import javafx.fxml.*;
import javafx.scene.*;
import javafx.scene.effect.DropShadow;
import javafx.scene.image.*;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
@ctnels
ctnels / SimpleDocking.java
Created February 1, 2018 02:03 — forked from jewelsea/SimpleDocking.java
Simplistic docking setup for JavaFX
import javafx.application.Application;
import javafx.geometry.Orientation;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.*;
public class SimpleDocking extends Application {
public void start(final Stage stage) throws Exception {
final SplitPane rootPane = new SplitPane();
@ctnels
ctnels / DoughnutChart.java
Created February 1, 2018 02:03 — forked from jewelsea/DoughnutChart.java
Creating a Doughnut chart in JavaFX
import javafx.collections.ObservableList;
import javafx.geometry.Bounds;
import javafx.scene.Node;
import javafx.scene.chart.PieChart;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
public class DoughnutChart extends PieChart {
private final Circle innerCircle;
@ctnels
ctnels / ClippedShadow.java
Created February 1, 2018 02:02 — forked from jewelsea/ClippedShadow.java
Demonstrates adding a halo effect (a drop shadow) around a translucent window.
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.scene.shape.*;
import javafx.stage.*;
import org.scenicview.ScenicView;
// Java 8 code
public class ClippedShadow extends Application {
@ctnels
ctnels / JavaFXTrayIconSample.java
Created February 1, 2018 02:02 — forked from jewelsea/JavaFXTrayIconSample.java
Demonstrate using the System Tray (AWT) to control a JavaFX application.
import javafx.application.*;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.control.Label;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.stage.*;
import javax.imageio.ImageIO;
import java.io.IOException;
@ctnels
ctnels / ModalConfirmExample.java
Created February 1, 2018 02:01 — forked from jewelsea/ModalConfirmExample.java
JavaFX Modal Confirm Dialog Box Example
import javafx.application.Application;
import javafx.beans.value.*;
import javafx.concurrent.Worker;
import javafx.event.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.effect.BoxBlur;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;