Quadtree graphic display in Java
I am writing a class in Java (Eclipse) that implements the quadtree framework. For those of you unfamiliar with this structure, it is just a square that is recursively divided into four other squares, as shown in the image below.
I want to display a data structure as shown below. Does anyone have a good idea for a simple implementation?
Thanx
+3
kande
source
to share
2 answers
You can use Java AWT or Swing to create a window and draw a square tree. For example, in Swing you can create JPanel
and render a drawing there. It doesn't have to be very difficult as it is only a matter of drawing lines and possibly squares.
+2
Simeon visser
source
to share
ACM Java Task Force has a nice and simple graphics package for this kind of thing.
You can find a good tutorial here .
+1
Edwin dalorzo
source
to share