View RSS Feed

All Blog Entries

  1. How to Filter JavaFX Events in a Scene Graph

    by , 12-11-2016 at 07:45 PM (A JavaFX Blog)
    JavaFX has a powerful event dispatch mechanism that allows different Node elements in a scene graph to intercept GUI events before and after they are delivered to their target node. Every time a new event is generated, an event dispatch chain is built for that event: this chain starts from the stage of the application window, continues with the scene displayed on that stage, and then follows the scene graph down to the target node of the event. For example, when a user clicks on a button in an application, ...
  2. Understanding JavaFX Event Types

    by , 12-11-2016 at 07:41 PM (A JavaFX Blog)
    In JavaFX, every event generated within an application has a type, which is represented by the EventType<T extends Event> class. An EventType<T> object represents a specific type of event within the T Event subclass. To identify common event types, most Event subclasses in JavaFX contain a set of static constants representing the different types of events within a given subclass. For example, the MouseEvent class contains static constants such as MouseEvent.MOUSE_PRESSED, MouseEvent.MOUSE_RELEASED ...
    Categories
    JavaFX Events
  3. Reacting to User Input in a JavaFX Application with Event Handlers

    by , 12-11-2016 at 07:33 PM (A JavaFX Blog)
    In a GUI application environment, events are generated every time a user interacts with the application using the input devices of the computer where the application is running; typical examples of events are a click with the mouse or a key press on the keyboard. In JavaFX, events are represented by the javafx.event.Event class; this is a subclass of java.util.EventObject, which is the base class representing a generic event in Java. The EventObject class offers a basic functionality related events, ...
  4. Where GUI events happen: the JavaFX Application Thread

    by , 12-11-2016 at 07:20 PM (A JavaFX Blog)
    When a JavaFX application is launched, the JavaFX framework creates a thread (generally referred to as the application thread, or the event thread) that handles the GUI of the application: for example, all GUI-generated events (mouse clicks, key presses, etc.) are processed in this thread, and any event handlers defined by the application programmer are executed in this thread. This is also the thread that manages all the updates to the application GUI, so in order to keep the interface responsive ...

    Updated 12-11-2016 at 07:34 PM by JavaFX

    Categories
    JavaFX Application , JavaFX Events
  5. The building blocks of a JavaFX GUI: Stages, Scenes and Nodes

    by , 12-11-2016 at 06:02 PM (A JavaFX Blog)
    In JavaFX, the central metaphors used to represent a graphical user interface are the stage and the scene.

    A stage is the “location” where graphic elements will be displayed; it corresponds to a window in a desktop environment. The javafx.stage.Stage class represents a stage; the so-called “primary stage” (which corresponds to the main window of an application) is created automatically by the JavaFX framework as soon as an application is launched, and is supplied as argument to the ...

    Updated 12-11-2016 at 07:17 PM by JavaFX

    Categories
    JavaFX Examples , JavaFX Node , JavaFX Stage , JavaFX Scene
  6. The Life-Cycle Methods of a JavaFX Application

    by , 12-09-2016 at 07:51 PM (A JavaFX Blog)
    The methods of the javafx.application.Application class that define the life cycle of a JavaFX application are the following:

    • public void init()
    • public abstract void start(Stage primaryStage)
    • public void stop()


    The init() method is called right after an Application object is instantiated, and can be used for application-specific initializations; however, GUI operations such as creating stages or scenes cannot be done from within this method, because at the time ...

    Updated 12-11-2016 at 07:16 PM by JavaFX

    Categories
    JavaFX Application
  7. How to Launch a JavaFX Application

    by , 12-09-2016 at 07:13 PM (A JavaFX Blog)
    The javafx.application.Application class, which defines a JavaFX application, can be launched by calling one of its two static launch() methods:

    • public static void launch(String... args)
    • public static void launch(Class<? extends Application> appClass, String... args)


    The first method takes as argument a set of application parameters, while the second method takes an additional argument indicating an Application subclass. The difference between the two methods ...

    Updated 12-11-2016 at 06:34 PM by JavaFX

    Categories
    JavaFX Application
  8. Solved : Problem saving and retrieving images in android

    by , 01-23-2015 at 01:08 PM
    This blog may be help you to solve this issue.

    Step 1 :
    call the gallery to select the image

    Step 2 :
    By using ActivityResultSet() we can receive the image

    Step 3 :
    Compress the image and convert into string

    Code:

    Java Code:
    ImageView imv_tst_img;   // to set the output of the image
    private static Bitmap Image = null; // Bitmap for handle the image compression
    Button btn_rg_image;     // for action purpose
    ...
    Categories
    Uncategorized
  9. Future Cheat Sheets

    by , 10-30-2012 at 09:38 PM
    Just trying to think of the topics that I want to create cheat sheets about. In the next few weeks I plan on making many more of these, here are a few topics that I think I will start with:
    • Linked Lists
    • Abstract Data Types
    • Abstract Algorithmic Analysis
    • AWT Event Handling
    • Swing Components
    • Swing Event Handling?
    • Inheritance
    • Polymorphism
    • Interfaces
    • Exception Handling



    This is in no particular order, and I will probably be hopping around this list ...
    Categories
    Uncategorized
  10. File Input Output Cheat Sheet

    by , 10-30-2012 at 05:18 AM
    File Input Output Cheat Sheet

    Importing Libraries
    The primary library that deals with files:
    Java Code:
    import java.io.File;
    The library that deals with writing to files:
    Java Code:
    import java.io.PrintWriter;

    FYI
    If there is more then one type of information that is being transferred to or from a file, it is usually best to use a record; IMO.


    Writing to a File

    Declare ...
  11. AWT Component Cheat Sheet

    by , 10-30-2012 at 03:15 AM
    AWT Components Cheat Sheet

    Importing Libraries
    There are two main libraries that involve the AWT tools. This package contains the core AWT graphics classes. Contains component classes for buttons, text fields, labels, frames, panels, dialogs, and scroll panes. It also contains the layout managers such as flow layout, border layout, and grid layout. Also included are the cusrom graphics classes such as graphics, color and font.
    Java Code:
    import java.awt.*;
    ...

    Updated 10-30-2012 at 07:02 AM by penguinCoder

    Categories
    Cheat Sheet
  12. ArrayList Cheat Sheet

    by , 10-29-2012 at 12:17 PM
    Importing the Library
    Before you can use an ArrayList, you must first import the necessary library.
    Java Code:
    import java.util.ArrayList
    Creating a Generic ArrayList
    Generic ArrayList is an ArrayList with a type; no other type is allowed to be inserted into the ArrayList.
    Java Code:
    ArrayList<type> listName = new ArrayList<type>();
    Example of this would be:
    Java Code:
    ArrayList<String> myArrayList = new ArrayList<String>();
    ...
  13. Virtual Memory Cheat Sheet

    by , 10-27-2012 at 04:39 AM
    Brief Description:
    'Virtual' Memory is the mental model, or abstraction, that the programming language provides to the programmer to explain how computer memory is managed while you program is running. It is NOT the same as physical memory.

    Run Time:
    At run time, the operating system handles the translation from 'virtual' memory addresses to physical memory addresses, and the programmer does no need to be aware of this process.

    Static Region:
    This ...

    Updated 10-30-2012 at 05:19 AM by penguinCoder

    Categories
    Cheat Sheet
  14. Records Cheat Sheet

    by , 10-27-2012 at 04:25 AM
    Brief Description:
    A record is pretty much just a programmer defined data type. It combines one or more pieces of information, or potentially different data types, into one unit. Structure wise, it is just a template that defines how to interpret the contents of a sequence of memory locations.

    First outside of any class, define the new data type:
    Java Code:
    class recordName{
      public [dataType] fieldName;
      ..repeat for any number of types..
    }
    ...
  15. Random Number Cheat Sheet

    by , 10-27-2012 at 04:00 AM
    Just for FYI, computers cannot generate actual random numbers. They are machines, and they do what they are told; and therefore cannot just choose a number at random. Mathematicians would call the process this process 'psuedo-random' number generation, but I didn't feel that made a good title so, whatever.. Just covering all the bases.

    First you will have to import the library:
    Java Code:
    import java.util.Random;
    Next, you create a random number generator; ...
  16. Scanner Class Cheat Sheet

    by , 10-18-2012 at 12:26 AM
    The Scanner class can be used for many things other then just getting input from the user; however this cheat sheet/tutorial is just going to be about getting input from the user.

    Defining the Scanner Class
    Java Code:
    import java.util.Scanner;
    
    public class ClassName{
      ...code...
    }
    It will tell the translator to look in that directory for the code defining the Scanner class.


    Declaring the Scanner
    If you ...

    Updated 10-18-2012 at 12:29 AM by penguinCoder

    Categories
    Cheat Sheet
  17. String Cheat Sheet

    by , 10-18-2012 at 12:05 AM
    A string is a piece of text, that is zero or more characters in length. In Java, strings are considered to be pre-built objects. The variable for a string does not store the value of the string, rather it is a reference point, or pointer, to the storage location of where the string is kept.


    Declaring a String:
    Java Code:
    String s1;
    Assigning a Value On Declaration:
    Java Code:
    String s1 = "Hello World!";
    Assigning ...

    Updated 10-18-2012 at 12:29 AM by penguinCoder

    Categories
    Cheat Sheet
  18. Class and Method Terminology Cheat Sheet

    by , 10-17-2012 at 10:45 PM
    Class Body - the area between the braces, that contains all the code.

    Constructors - used for initializing new objects

    Declarations - fields that provide the state of the class and its objects

    Methods - implement the behaviour of the class and its objects

    Fields - member variables in a class

    Local Variables - variables in a method or a block of code

    Parameters - is the list of variables in a method declaration ...

    Updated 10-18-2012 at 12:30 AM by penguinCoder

    Categories
    Cheat Sheet
  19. Class and Method Cheat Sheet

    by , 10-17-2012 at 10:42 PM
    Declaring a Class
    Java Code:
    class ClassName{
      ...code...
    }

    Declaring a Class with Parent
    Java Code:
    class ClassName extends parentClassName{
      ...code...
    }

    Declaring a class with Interface
    Java Code:
    class ClassName implements interface1, interface2, interface3{
       ...code...
    }

    Declaring a Class with Fields
    Java Code:
    class ClassName{
      public
    ...

    Updated 10-18-2012 at 12:30 AM by penguinCoder

    Categories
    Cheat Sheet
  20. Some Basic Technical Terminolgy Cheat Sheet

    by , 10-10-2012 at 04:08 AM
    Well I just got out of class, and I thought I would do a brain dump of some of the terminology that is utilized in Programming and Computer Science. This is going to be in more human readable format then most places I have found on the Internet.

    Abstract Algorithm Analysis
    What is O(N)?
    Big O of N, and it is commonly pronounced, is when the run-time of an algorithm is approximately proportional to the size of the data (N), when there are large amounts of data; in the ...

    Updated 10-18-2012 at 12:30 AM by penguinCoder

    Categories
    Cheat Sheet
  21. java (7) equivalent of .Net timespan

    by , 07-28-2012 at 07:03 AM
    Quote Originally Posted by .paul. View Post
    i used Dates in this particular case, as they were better suited to the application.

    but i also created a java TimeSpan class, similar to the .Net Framework TimeSpan class:

    Java Code:
    package javaTimeSpans;
    
    /**
     *
     * @author Paul
     */
    public class TimeSpan {
        
        private int _days;
        private int _hours;
        private int _minutes;
        private int _seconds;
        
        public int Days(){
    ...
    Categories
    Uncategorized
  22. Windows Screen Grabber JNA methods that I'm working on

    by , 05-26-2012 at 05:50 AM
    This of course requires JNA jar files, platform.jar and jna.jar. The ultimate goal of this code is to create a "bot" that can control a work program. Since the work program uses a Citrix client to interact with the user, if the controller program resides on the client it is impossible to get the program state through the usual methods, and instead I will be required to check for changes in the program display to obtain this information. This code is far from done, but does show some ways ...

    Updated 05-26-2012 at 05:56 AM by Fubarable

    Tags: -1' Add / Edit Tags
    Categories
    Uncategorized
  23. My Goal

    by , 05-20-2012 at 07:30 AM
    Some people on this site may not like how I am posting on this site and for that I am sorry. I am not very good at forums, but my goal not with just this site but with my career in computer science using networking is the follow that I have typed out...

    I want to go all the way down the Networking programming rabbit hole, I want to learn everything I can about computer science, programming, and the world inside of the internet. I have choose Java to do this because I like the syntax ...
    Categories
    Uncategorized
  24. Get the info of a socket

    by , 05-16-2012 at 12:50 AM
    This program reads a list of hostnames from the command-line, attempts to open a socket to each host, and then prints to the remote host, the remote port, and the local address, and the local port.

    ** Happy Coding**

    Java Code:
    /* SocketInfo.java
     * Get the info of a socket
     */
    import java.net.*;
    import java.io.*;
    public class SocketInfo{
        public static void main(String[] args){
            for(int index=0; index<args.length; index++){
    ...
  25. Java Logging - Practical Usage

    by , 04-25-2012 at 03:53 PM
    Introduction
    The intent of the post is not to delve into all the detail around setting up Java logging for an application. So you won't find any information here about Filters, Formatter and Handlers. For all those details, I invite you to visit Oracle's JavaTM Logging Technology documentation site and read the Overview.

    When problems occur in complex Java applications, symptoms are generally detected as incorrect data or as exceptions. In the case of exceptions, we get stack ...
  26. isTheStringPalinDrome, reverseTheWordOrder, fibonaciWithoutRecursion, removeDuplicates

    by , 04-03-2012 at 11:51 PM
    Java Code:
    package assignmentOne;
    
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.Set;
    
    public class PartOneAssignments {
    	
    	// This method accepts a String as the argument and checks whether it is palindrome or not
    	static boolean isTheStringPalinDrome(String s) {
    		
    		// Be positive and assume that the String provided is Palindrome
    		boolean stringIsPalinDrome = true;
    ...
    Categories
    Uncategorized
  27. Simple Frame Transitions without Complex Code

    by , 03-22-2012 at 08:18 PM
    I've spent the past few days looking up Java window transitions that work with Swing components & containers (JFrame, JPanel, etc.).

    Yes, there are packages such as JavaFX which includes a Timeline & Transition framework. I also came across these:

    Trident:
    Project Kenai &mdash; We're More Than Just a Forge

    FRC:
    Filthy Rich Clients (find the Animation jar (org.jdesktop.animation))

    However, I've been impatient lately ...
  28. A recursive method for searching an array of integers...

    by , 03-08-2012 at 09:49 PM
    Java Code:
    public class ArrayLister {
    	
    	private static int arraySearcher(int[] arrayToSort,int numberToFind,int left,int right){
    		
    		int middle = (left + right) / 2 ;
    		System.out.println(middle);
    
    		if(middle==arrayToSort.length-1)
    		{
    			if(arrayToSort[middle] == numberToFind) {
    				return middle;
    			}
    			else
    				return -1;
    		}
    		
    		if(arrayToSort[middle] == numberToFind) {
    			return
    ...
    Categories
    Uncategorized
  29. Factory Pattern Example

    by , 03-04-2012 at 09:10 PM
    Java Code:
    package factoryPattern2;
    
    public abstract class Product {
    	
    	private String productName;
    	
    	public void setName(String name) {
    		this.productName = name;
    	}
    	
    	public String getName() {
    		return productName;
    	}
    
    	public void putInABox() {
    		System.out.println("Putting the product in a box..");
    	}
    
    }
    
    
    package factoryPattern2;
    ...
    Categories
    Uncategorized
  30. Self Made Observable Pattern

    by , 03-03-2012 at 11:50 PM
    Java Code:
    package observerPatternSelfMade;
    
    public class MyObservableClass implements MyObservableInterface {
    
    	
    	
    	@Override
    	public void registerObserver(MyObserverInterface o) {
    		observers.add(o);
    	}
    
    	@Override
    	public void removeObserver(MyObserverInterface o) {
    		observers.remove(o);
    	}
    
    	@Override
    	public void notifyObservers() {
    		
    		for(int i = 0; i<observers.size();i++)
    ...
    Categories
    Uncategorized
Page 1 of 17 12311 ... LastLast