Skip to content

Instantly share code, notes, and snippets.

View jpt1122's full-sized avatar

Jay Thakkar jpt1122

  • My Dream
  • Ahmedabad
View GitHub Profile
package jayfx;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Cursor;
import javafx.scene.Group;
/*
* Handling mouse events with event filters
*/
package draggablepanelsexample;
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.collections.FXCollections;
class Child extends Parent{
}
/**
* @param args
*/
public static void main(String[] args) {
Parent parent = new Parent();
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class RobotDemo implements ActionListener {
JFrame fr;
JLabel lb1;
JLabel lb2;
JTextField tf1;
JTextField tf2;
JButton btn1;
import java.net.*;
import java.io.*;
import java.util.*;
public class SocketClient
{
public static void main(String args[]) throws IOException
{
Socket s1 = new Socket("localhost",4444);
import java.net.*;
import java.io.*;
public class SocketServer
{
public static void main(String args[]) throws IOException
{
ServerSocket s = new ServerSocket(4444);
/**
* (C) 2013 HealthConnect NV. All rights reserved.
*/
package magnifierdemo;
import javafx.beans.binding.DoubleBinding;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.BooleanPropertyBase;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.DoublePropertyBase;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package magnifierdemo;
import java.text.DecimalFormat;
import javafx.application.Application;
import javafx.beans.binding.StringBinding;
import javafx.beans.property.BooleanProperty;
@jpt1122
jpt1122 / SphereAndBox
Last active December 31, 2015 14:49
To compile JavaFX with 3D features you have to get the early access version of the JDK8. At the moment as far as I know there is only a windows support for the 3D features, but a build for Mac and Linux will soon be released. (Luckily enough 3D support also works for a virtualized Windows running on Mac - this is how i got to the screeenshots.) …
package application;
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.geometry.Point3D;
import javafx.scene.Group;
import javafx.scene.PerspectiveCamera;
import javafx.scene.PointLight;
import javafx.scene.Scene;
import javafx.scene.image.Image;
@jpt1122
jpt1122 / ZipUtil.java
Last active March 23, 2020 14:38
Zip and Unzip are a very common activities for a computer user. A user normally uses the zip utility to compress a directory to create a zip file. There are many ready-made software such as winzip,7zip, and winrar that are available to achieve this. However, it is also possible to protect the zip file with a password so that the end user has to …
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.util.Arrays;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;