This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes GWT and the fly likes Layout three GWT panels Horizontally Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "Layout three GWT panels Horizontally" Watch "Layout three GWT panels Horizontally" New topic
Author

Layout three GWT panels Horizontally

Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

Hello,
GWT Layout is quit strange for a programmer comming from swing desktop GUI dev. I know GWT Layout rely on browser layout engine which uses html and css to layout objects in browser window.
i'm writing a GWT application . but I run into a dilemma. if i use DockLayoutPanel which uses absolute positioning my Composites are not automatically resized to fit the size of it's children (i need this feature in my app). so i gave up using DockLayoutPanel and used HorizontalPanel and VerticalPanel. but HorizontalPanel doesn’t allow me to stack widgets beside each other then have last right most widgets fill all remaining horizontal space. when i add two panels to a HorizontalPanel i see they are layed out one on the east and one on the west (sse image below). If i use FlowPanel to add these two Panels they stack over each other. these are kinds of GWT UI oddities that i experienced. I want to layout many panels horizontally and want them to be aligned in the right by each other while the last Panel should fill all remaining available horizontal space. by simply adding Panels to a Parent HorizontalPanel i don't get my expected layout. below is a link of a screenshot for my three Panels Layed out by a parent HorizontalPanel. as you can see there is a Blank space separating Panels from each others. how we can work out to make them next to each other without the blank space? .
In fact I'm looking for advice on how to write this GWT Layout code elegantly perhaps using CSS without coding all Layout logic in java /GWT. can you propose some good solutions ?

screenshot is at http://flic.kr/p/94mSnh

thanks
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10268
    
    8

Instead of using panels, use a FlexTable instead. You can obtain a reference to the FlexCellFormatter to manipulate lots of attributes such as row/col span, v/hor alignment, width etc.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

Maneesh Godbole wrote:Instead of using panels, use a FlexTable instead. You can obtain a reference to the FlexCellFormatter to manipulate lots of attributes such as row/col span, v/hor alignment, width etc.

Hello,
How would you code the editor UI in screeshot using FlexTable?
how to use Flextable to make three cells that fit height of their children widgets automatically. and also fits children widgets width automatically but last cell with TextArea would span to fill all remaining horizontal space.
can you give a hint how to do that with FlexTable?
Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

using FlexTable is worse than vertical and Horizontal Panels.

I really tried to figure out how to layout these 3 Forms horizontally and having them resize h/v correctly but I'm stuck now! I have no clue what's ever how to do this Layout using standard GWT.
can someone help on this please?


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Layout three GWT panels Horizontally