Skip to content

Instantly share code, notes, and snippets.

View nezarjhons's full-sized avatar
🎯
Focusing

nezar nezarjhons

🎯
Focusing
View GitHub Profile
@jewelsea
jewelsea / Survey.java
Created June 1, 2012 09:40
Sample Wizard implementation in JavaFX
import javafx.application.Application;
import javafx.beans.property.*;
import javafx.beans.value.*;
import javafx.collections.*;
import javafx.event.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.Stage;
@rponte
rponte / JasperReportBuilder.java
Last active November 15, 2024 09:35
Automatic compilation of subreports with JasperReports
package br.com.triadworks.controller.relatorios.jasper;
import java.io.ByteArrayOutputStream;
import java.sql.Connection;
import java.util.Map;
import javax.sql.DataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRExporter;
import net.sf.jasperreports.engine.JRExporterParameter;
import net.sf.jasperreports.engine.JasperCompileManager;
@jewelsea
jewelsea / LoginController.java
Created January 25, 2013 02:47
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;
@marcanuy
marcanuy / MYDB.cnf
Last active December 6, 2021 04:57
Database maintenance from console.
[client]
host=
user=
password=
@abhinayagarwal
abhinayagarwal / EditableTableViewWithTab
Last active January 27, 2021 01:52
EditableTableView With Tab Functionality Only for same Row
import java.util.ArrayList;
import java.util.List;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
@jewelsea
jewelsea / JavaFXTrayIconSample.java
Last active July 22, 2024 07:42
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;
@TheItachiUchiha
TheItachiUchiha / ToggleSwitch
Last active March 31, 2023 07:15
A simple Toggle Switch using JavaFX
import javafx.beans.property.SimpleBooleanProperty;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
public class ToggleSwitch extends HBox {
private final Label label = new Label();
@james-d
james-d / EditCell.java
Created February 13, 2015 03:18
(Fairly) reusable edit cell that commits on loss of focus on the text field. Overriding the commitEdit(...) method is difficult to do without relying on knowing the default implementation, which I had to do here. The test code includes a key handler on the table that initiates editing on a key press.
import javafx.event.Event;
import javafx.scene.control.ContentDisplay;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableColumn.CellEditEvent;
import javafx.scene.control.TablePosition;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
@james-d
james-d / LineItemTable.java
Last active April 21, 2021 20:58
Demonstrates using a TransformationList to create a "total line" in a TableView.
import java.util.function.Function;
import java.util.stream.Collectors;
import javafx.application.Application;
import javafx.beans.Observable;
import javafx.beans.binding.Bindings;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyIntegerProperty;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.beans.property.ReadOnlyObjectWrapper;
@Faoc
Faoc / AutoCompleteTextBox.java
Last active April 12, 2023 05:47 — forked from floralvikings/AutoCompleteTextBox.java
Simple JavaFX TextBox with AutoComplete functionality based on a supplied set.
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Side;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.CustomMenuItem;
import javafx.scene.control.TextField;