JavaFX and Facebook, the solution

When I started this blog, I was rambling with Facebook, JavaFX and alternative technologies.
It turned out that JavaFX is not ideal for social application development, because of various reasons.
Let alone JavaFX, applets are also not very ideal for social application development, if a RIA is necessary Flash is the solution, not even Flex.
Anyway Turning a [...]

Solution of * doesnt contain ObjectFactory.class or jaxb.index

For some reason while unmarshalling something you get this error
Solution is:
Instead of

javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance("oasis.names.specification.ubl.schema.xsd.invoice_2");
or
JAXBContext context = JAXBContext.newInstance(inv.getClass().getPackage().getName());

Use a notation like this

javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(oasis.names.specification.ubl.schema.xsd.invoice_2.InvoiceType.class);

Where InvoiceType will be the thing you [...]

How to validate XML with XSD in Java

After initializing xsd with JAXB Binding on Netbeans, you can use a method like this.
Both JAXB binding and schema are same but as far as i see, JAXB unmarshalling doesn’t validate XML, it just transforms it.

package unmarshallertest;

import java.io.*;
import javax.xml.bind.*;
import javax.xml.validation.*;
import oasis.names.specification.ubl.schema.xsd.invoice_2.*;

public class Main {
public static void main(String[] args) {
[...]

JXTA

Trying to write multi-user applications, the need of a server always disturbs me
It would be good to achieve a connection between two peers without openning a port, for example in web applications, without going through server
For this reason i searched about P2P a little bit
The best solution seems to be JXTA
I thought maybe it may [...]

JavaFX and Facebook – Part 2

My first post describes how to deploy a JavaFX application to Facebook but I realized that it gives some errors on most computers, and it is not very practical
Here I will give a more clear example
My application is a Sudoku Solver, you can see it from the Pages of my site
One major problem that i [...]

Laying out non-visible items with HBox,VBox on JavaFX

It turns out that if you lay out non-visible items with HBox( or VBox) , they don’t align as usual
So if you have a binded value to the visibility of the item, if you make that visible it won’t align as you wish
On the contrary if you make something unvisible that is already aligned with [...]

JavaFX/Java Chat Program

Here is another chat program, using JavaFX for GUI and Java on the background for SQL transactions.
One thing I realized is that you can’t bind to variables from JavaFX to Java Threads.
Using timelines instead of threads are better.
Code is pretty self explanatory:
( You should add mysql-connector-java-5.1.7-bin.jar (or newer) mysql library in order to connect mysql [...]

METU CENG242 Hw3 Solution

The problem statement and input outputs are here
The task was to implement a QuadTree
The good thing about functional languages is that when you have a specification, writing the code is trivial and extremely fun
Also unlike programming in languages like C, performance is not a worry, rather than performance, style and practicality of the program matters
I [...]

A function that returns the show function for a given type of argument

The question was: “Can we write a function in Haskell, which takes a formal parameter of any type, and returns the ’show’ function for the type of the argument?” Cem Bozşahin
Answer is:

f x=b
where
[...]

Turning any JavaFX application into a Facebook application in 5 minutes

I say 5 minutes but it took hours for me to figure out.
On this post i will explain how simple it is to make any JavaFX application, a Facebook application, with complete source codes and step by step explanations.
There is already an app with JavaFX on Facebook but unfortunately they didn’t share their source code.
First [...]