Skip to content

Instantly share code, notes, and snippets.

View abhinayagarwal's full-sized avatar

Abhinay Agarwal abhinayagarwal

View GitHub Profile
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=
$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1
@abhinayagarwal
abhinayagarwal / PhoneNumberTextFieldSample.java
Last active September 2, 2019 05:33
Creates a TextField which only accepts digits and adds hypen after 3 and 6 digit.
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.TextField;
import javafx.scene.control.TextFormatter;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import javafx.util.StringConverter;
public class PhoneNumberTextFieldSample extends Application {
@abhinayagarwal
abhinayagarwal / ImageViewBackgroundColor
Created June 12, 2014 09:57
Backgroung Color for ImageView/Screen
public class ImageViewBackgroundColor extends Application {
@Override
public void start(Stage stage) throws Exception {
try {
stage.setWidth(Screen.getPrimary().getBounds().getWidth());
stage.setHeight(Screen.getPrimary().getBounds().getHeight());
BorderPane borderPane = new BorderPane();
ImageView imageView = new ImageView();
Image image = new Image(getClass().getResource("huskar.jpg")
@abhinayagarwal
abhinayagarwal / HorizontalScrollImageGallery
Created March 28, 2014 13:08
HorizontalScrollImageGallery
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ScrollPane;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseButton;
@abhinayagarwal
abhinayagarwal / TableViewDeleteSample
Created March 24, 2014 07:38
Delete Rows using row buttons in Javafx TableView
import javafx.application.Application;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
@abhinayagarwal
abhinayagarwal / ClipboardImageCopying
Created March 12, 2014 10:41
A simple application to show the feature of Clipboard and its usage with only Image
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.image.ImageView;
import javafx.scene.input.Clipboard;
import javafx.scene.input.DataFormat;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.StackPane;
@abhinayagarwal
abhinayagarwal / BarChartwithLabelandRefresh
Created March 10, 2014 21:28
BarChart with Label and refresh Data
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.text.DecimalFormat;
import javafx.application.Application;
@abhinayagarwal
abhinayagarwal / TextFieldFocus
Last active August 29, 2015 13:57
Focus Property of TextField
This is a small example doing what you want ! I have used the `focus property` of `textfield` to add and remove miles from it !
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.Scene;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
@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;