Re: Best Layout?
- From: bcr07548@xxxxxxxxxxxxx
- Date: 26 Jun 2006 21:58:36 -0700
Is there really no layout that allows you to position a component using
(X,Y) coordinates instead of "directions" like north and center, or
resorting to a more rigid system like a grid? If there isn't such a
system, then what is the purpose of methods like setLocation(x,y) ?!
I think the GraphLayout example was on the right track but is a little
more roundabout than I was hoping for. Although a flowchart is
probably the best way of describing the style I am after (draggable
panels connected by lines,) I have something a little more custom in
mind and I would like the boxes to be more like a standard JPanel that
I can add other widgets to. I suppose I could do something like the
demo did and draw everything myself but I feel like I would be
reinventing the wheel.
-Brandon
Hi everyone. I am kind of new to Java in general, much less Swing, but
I am working on a project where I want to create somewhat of a flow
chart with draggable boxes and lines connecting them. I plan on
representing each box in the "flow chart" with a JPanel. Keeping in
mind that I will need to draw lines between panels, what would be the
best layout to use? What I am looking for is a layout where I can say
"put panel A at location (X,Y)" but Sun's explanation of layouts didn't
seem to explain anything like that. If anyone has any input, I would
appreciate it.
-Brandon
You may want to look at these examples in the Sun JDK sample Demo
Applets subdirectories. They maybe a little to hard being you are new to
java.
..\jdk1.5.0_07\demo\applets\DrawTest (example1)
..\jdk1.5.0_07\demo\applets\GraphLayout (example1 to example4)
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
.
- Follow-Ups:
- Re: Best Layout?
- From: David Segall
- Re: Best Layout?
- References:
- Best Layout?
- From: bcr07548
- Re: Best Layout?
- From: IchBin
- Best Layout?
- Prev by Date: Re: The Adapter Design Pattern - Relates two otherwise incompatible interfaces
- Next by Date: Re: Best Layout?
- Previous by thread: Re: Best Layout?
- Next by thread: Re: Best Layout?
- Index(es):
Relevant Pages
|