Skip to content

Instantly share code, notes, and snippets.

View nezarjhons's full-sized avatar
🎯
Focusing

nezar nezarjhons

🎯
Focusing
View GitHub Profile
@nezarjhons
nezarjhons / CalendarView.java
Created October 15, 2022 03:32 — forked from james-d/CalendarView.java
Simple demo of creating a appointment-calendar like view (similar to the default calendar view in Google Calendar), in JavaFX 8. Just manages selection of time slots in the grid.
package calendarview;
import java.time.DayOfWeek;
import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
@nezarjhons
nezarjhons / AutoCompleteTextBox.java
Created August 29, 2022 03:12 — forked from Faoc/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;
@nezarjhons
nezarjhons / Survey.java
Created April 19, 2022 02:41 — forked from jewelsea/Survey.java
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;
@nezarjhons
nezarjhons / Controller.java
Created January 15, 2022 02:59 — forked from Da9el00/Controller.java
Alarm Clock
package sample;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.TextField;
import javafx.scene.text.Text;
import javafx.util.Duration;
@nezarjhons
nezarjhons / MYDB.cnf
Created December 6, 2021 04:57 — forked from marcanuy/MYDB.cnf
Database maintenance from console.
[client]
host=
user=
password=
@nezarjhons
nezarjhons / WhatsappSender.java
Created November 3, 2021 02:57 — forked from whatsmate/WhatsappSender.java
Sending a WhatsApp message in Java
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class WhatsappSender {
// TODO: Replace the following with your instance ID, Forever Green Client ID and Secret:
private static final String INSTANCE_ID = "YOUR_INSTANCE_ID_HERE";
private static final String CLIENT_ID = "YOUR_CLIENT_ID_HERE";
@nezarjhons
nezarjhons / APIConnector.java
Created October 31, 2021 02:25 — forked from Da9el00/APIConnector.java
JavaFX weather app setuop using maven
package org.example;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Scanner;
@nezarjhons
nezarjhons / ToggleSwitch
Created August 25, 2021 02:34 — forked from TheItachiUchiha/ToggleSwitch
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();
.root {
-fx-accent: #1e74c6;
-fx-focus-color: -fx-accent;
-fx-base: #373e43;
-fx-control-inner-background: derive(-fx-base, 35%);
-fx-control-inner-background-alt: -fx-control-inner-background ;
}
.label{
@nezarjhons
nezarjhons / JasperReportBuilder.java
Created July 1, 2021 01:38 — forked from rponte/JasperReportBuilder.java
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;