tags:

views:

102

answers:

4
A: 

both approaches are feasable though i would probably rule out #2 on account of it being difficult to implement.

if i went route 1 I'd probably try something like FlowlLayout with some JPanels but in the past I've never really gotten decent results from trying to get things to the size I really want them, usually layout managers like to size everything for you.

Victor
+1  A: 

to expand on Thought #1: you could do this with a succession of JPanels. Your parent JPanel would layout a set of Tour panels in fixed width columns. the Tour classes could be panels that contain a TourHeader panel and a set of ItineraryItem panels. This might be heavier weight, but potentially easier for others to follow.

you could also reconsider the JTable option. take a look at some of the JTable examples on this ancient site for some ideas for cells spanning rows.

akf
+1  A: 

Somehow, I think a use of the Infonode library (Docking Windows) could help, it includes D&D, you could move panels easily. The only problem with it would be to "force" it, for example using one RootWindow (the base component per Tour, i'm not sure.

Infonode is a GPL library, for commercial use, there is a commercial license too, depending on your need.

For information, i'm not related to them, but I use this framework, and I like it, and it could be a solution, maybe

http://www.infonode.net/index.html?idwdemo (check demo)

Gnoupi
+1 for the hint on docking frameworks. I will evaluate if using a docking framework (not necessary infonode, but it looks nice) for this task.
Tobias Schulte
+1  A: 

The approach #1 should work. I did it several times.

But if you want to make your drag and drop simpler I would suggest using JLists(without scroll panes) for your orders. You will be able to implement D&D within lists as well as between them if needed. To customize how order looks you can use renderers. On top of lists you can use panels or labels as tour headers.

So I would create specialized TourView component with header on top and JList on the bottom. Then add many of TourViews to panel as you thought in case #1.

In all cases, except when using JTable, you have to implement column enlarging yourself.

eugener
+1 for the idea of using a JList. This seems to be a nice idea and I will definitely try it.
Tobias Schulte