-2

LEC Cube Software as seen below.

enter image description here

Any good idea how to draw the component on the left side in a Java application?

Thought about Java2D. But I think with Java2D you can only draw those lines and no checkboxes. Perhaps any good LayoutManager to solve this?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • 1
    That doesn't look like a cube to me, I'm guessing someone calculated the points on the paper and hard-coded them. – nullpotent Dec 26 '12 at 01:01
  • Out of curiousity, can't you use the [standard Swing checkbox](http://docs.oracle.com/javase/6/docs/api/javax/swing/JCheckBox.html)? For the positions, you need to [choose a projection](http://en.wikipedia.org/wiki/Graphical_projection) and do the math. – Carsten Dec 26 '12 at 01:05
  • Of course i would use the standard JCheckbox. I thought about drawing with Graphics2D. There i think you cannot use JCheckbox. You only can use methodes loke drawLine, etc. – user1830608 Dec 26 '12 at 01:19
  • Click on this [`AnimationTest`](http://stackoverflow.com/a/3256941/230513) to add text fields; resize to see the effect of the default layout. – trashgod Dec 26 '12 at 03:37

1 Answers1

2

With checkboxes and lines, using some model of a cube (if it's resizable; see below) and no layout manager.

cube

miku
  • 181,842
  • 47
  • 306
  • 310
  • This cube model is nice. But how to position a JCheckbox within this cube?? – user1830608 Dec 26 '12 at 01:14
  • Well, every awt.Component has a [`setLocation`](http://goo.gl/ZVHQG) method; the task would be to recalculate the correct positions based on the cube model (which itself would change it's size when the window is resized (again, only if the whole thing is resizable)). – miku Dec 26 '12 at 01:17