• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

New to GWT - struggling with a component arrangement issue

 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All,

I'm trying to accomplish what I thought would be the simple task of creating a GUI such that there is a left side navigation bar, and a central main-data screen.

That is, say, the left 20% or so of the screen will be a vertical panel.

The remainder will have data displayed. It very likely will not take up the remainder of the screen, and thus should be centered in the remaining area.

I've tried using a HorizontalPanel as the main component added to the root panel - and setting the left side to a style that has:
width:20%;

and setting the data area to:
margin-left: auto;
margin-right: auto;
width: 75%;

However, it seems to just cram everything to the left into as small a space as possible, as if readying for more sub-Panels to be added to the HorizontalPanel.

So, what I have, in terms of what is inside what, is:
RootPanel
- HorizontalPanel
-- VerticalPanel (navigation stuff - width: 20%)
-- DockPanel (main data - width 75%, left and right margin auto)

What am I doing wrong? How do I get the arrangement that I want to get?

Thanks in advance.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why are you using the HorizontalPanel when you can add the DockPanel directly?
I would prefer a DockLayoutPanel instead of DockPanel.
 
Joe Vahabzadeh
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, the reason for that is because, sometimes, I can't quite see the forest for the trees.

Pardon me while I smack my palm against my forehead. Twice.
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Based on your reply I can't figure out if your problem is solved or not.

Ah, the reason for that is because, sometimes, I can't quite see the forest for the trees.


Wrapping the tree inside a ScrollPanel would help
 
Joe Vahabzadeh
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yep, problem was solved. Had to wrestle with the arrangement a bit, but basically using the DockPanel directly did the trick.
 
Legend has it that if you rub the right tiny ad, a genie comes out.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic