Re: Best Layout?



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

.



Relevant Pages

  • Re: GUI best practices question
    ... but the number of containers (panels, frames...) and layout managers. ...
    (comp.lang.java.help)
  • Re: ASP.NET newbie - how to align panels horizontally
    ... but there is an additional setting for the hacks line) - the * in front of the display is important as all browsers except for IE7 ignore it. ... Border should be set to 0 for the finished product, I am displaying as dashed to see how my browsers render the panels. ... The only thing this is missing is a nice "flex" attribute to grow selected hpanels and make the layout even more fluid. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: what are panels for?
    ... Panels can encapsulate layouts and components. ... It is generally referred to as a nested layout. ... to encapsulate the comonents in a parent container in the ...
    (comp.lang.java.gui)
  • Best Layout?
    ... I am kind of new to Java in general, much less Swing, but ... representing each box in the "flow chart" with a JPanel. ... mind that I will need to draw lines between panels, ... What I am looking for is a layout where I can say ...
    (comp.lang.java.gui)
  • Re: Panel/Div/Table Overhead Costs
    ... retrieve types, and extensively use a DetailsView type of layout. ... you are laying out the content of your page then use DIVs (or Panels). ...
    (microsoft.public.dotnet.framework.aspnet)