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 / fetch_data_in_react.js
Created August 14, 2019 14:48 — forked from mittalyashu/fetch_data_in_react.js
Fetch Data From RSS Feed In React
class FetchDataFromRSSFeed extends Component {
constructor() {
super();
this.state = {
recentBlogPost: {
name: '',
url: ''
}
}
}
@ctnels
ctnels / Sample JavaFX WebView
Created February 26, 2018 23:33 — forked from ajiniesta/Sample JavaFX WebView
A simple JavaFX WebView sample
public class WebTesting extends Application{
public static void main(String[] args){
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
VBox vbox = new VBox(10);
@ctnels
ctnels / LoginController.java
Created February 4, 2018 23:32 — forked from jewelsea/LoginController.java
JavaFX sample for an fxml based Login screen to main application transition with login session data transfer
package login;
import javafx.event.*;
import javafx.fxml.FXML;
import javafx.scene.control.*;
/** Controls the login screen */
public class LoginController {
@FXML private TextField user;
@FXML private TextField password;
@ctnels
ctnels / H2Tasks.java
Created February 1, 2018 05:00 — forked from jewelsea/H2Tasks.java
Sample for accessing a local database from JavaFX using concurrent tasks for database operations so that the UI remains responsive.
package h2app;
import javafx.application.Application;
import javafx.collections.*;
import javafx.concurrent.Task;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.Stage;
@ctnels
ctnels / WebViewWithPromptHandler.java
Created February 1, 2018 02:04 — forked from jewelsea/WebViewWithPromptHandler.java
Demonstrates adding a basic alert handler to a JavaFX WebView.
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.scene.web.*;
import javafx.stage.*;
public class WebViewWithPromptHandler extends Application {
@ctnels
ctnels / WebViewCaptureDemo.java
Created February 1, 2018 02:04 — forked from jewelsea/WebViewCaptureDemo.java
Captures web pages to image files using JavaFX WebView and ImageIO
import javafx.animation.PauseTransition;
import javafx.application.Application;
import javafx.beans.value.*;
import javafx.embed.swing.SwingFXUtils;
import javafx.event.*;
import javafx.geometry.Bounds;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.image.*;
import javafx.scene.layout.*;
@ctnels
ctnels / LoadTimer.java
Created February 1, 2018 02:04 — forked from jewelsea/LoadTimer.java
Report progress and time taken for JavaFX WebEngine loading
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.beans.property.*;
import javafx.beans.value.*;
import javafx.concurrent.Worker;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.*;
@ctnels
ctnels / StripedProgress.java
Created February 1, 2018 02:04 — forked from jewelsea/StripedProgress.java
Boostrap style striped progress bar in JavaFX
import javafx.animation.*;
import javafx.application.Application;
import javafx.event.*;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import javafx.util.Duration;
@ctnels
ctnels / Main.java
Created February 1, 2018 02:04 — forked from jewelsea/Main.java
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.
@ctnels
ctnels / WhereIsHe.java
Created February 1, 2018 02:04 — forked from jewelsea/WhereIsHe.java
JavaFX viewfinder application
import javafx.application.Application;
import javafx.beans.value.*;
import javafx.event.EventHandler;
import javafx.geometry.Bounds;
import javafx.scene.*;
import javafx.scene.image.*;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.scene.shape.*;