I'm trying to add a scrollbar to a text area component. I could use FlowPanel, but I need to use GridBagPanel for my other components and when I tried to add a flowpanel inside the gridbagpanel it was empty and like 2x2 pixels.
Is there a way to add two panels to a MainFrame or add the scrollbar some other way?
Related
I'm a newbie to GWT.And i wonder when to use panels and when to use layout panels.I'm really confused.Can anyone provide a legit use case , where we need to use panels instead of layout panels and vice versa?.Thanks.
When you need a child to take its initial size from a parent and then resize when a parent resizes, use a LayoutPanel or another panel that implements ProvidesResize() interface. This way, for example, you can split the browser window into top menu and main area parts, and make the main area change its size as the browser windows is resized.
When you want a panel to take its size from its own content, use HTMLPanel or FlowPanel.
I have used the EventManager.onWindowResize event to handle window resize to adjust my layout. It works fine only for the Viewport. I want my inner commponents, viz. Grids and Panels to be adjusted accordingly. Is there a way to achieve this? I have written custom code to handle the resize individually for every component. Which works fine for my grids and panels. But, the panel headers don't resize! They are just stuck there.
My layout is as follows:
[Viewport]
[Form Panel]
[Panel containing Grid] [Panel containing Grid]
[/Form Panel]
[/Viewport]
The Grids resize but not the Panel which contains the Grid. Moreover, I've used anchor, but my percent widths are ignored.
Any default way to implement resize?
Used anchor layout everywhere. The Viewport required some JS code, but anchor solved my problem. Thanks everyone for their inputs.
I have a vertical panel in gwt and I want to add widgets into it from bottom to top.
In some reasons I want this.
Is that possible?
Actually I want to show results vice versa.
You can use
insert(Widget w, int beforeIndex)
Here, for bottom to top, you need to set beforeIndex to 0
Refer to GWT Vertical Panel
I think a best approach is to create your own VerticalPanel by creating a class that extends Composite, and implementing desired behavior.addToButtom() , addtoTop() ...
I'm trying to build a GWT GUI, but I'm not sure if it's possible. Basically, I need to be able to stack three layouts/panels, one on top of another like this:
Bottom Layout: Panel that fills the whole screen (will actually contain SVG stuff).
Middle Layout: DockLayoutPanel with tools docked around the edges, also full screen.
Top Layout: Transparent panel, again filling the whole screen.
Is it possible to stack panels like this? I assume I could use AbsolutePanel to do it somehow, but I was hoping for a nicer solution.
Thanks,
Jon
Because you want a DockLayoutPanel inside, try with a LayoutPanel (or the RootLayoutPanel) and simply add your widgets in order as, by default, a child of a LayoutPanel fills its parent.
I'm building a toolbar in PyGTK and attaching a combo box to it. The result that I got is that the combo box stretches to fill all the vertical space available:
I have been trying every trick in the book that I can think of in order to avoid it, but I'm starting to admit that maybe it's just GTK style and I won't be able to get rid of it.
I can post some code but this should be quite simple to recreate. Any idea?
Wrap the combobox in a gtk.Alignment. You can create the latter with 0.5 vertical alignment to have the combobox centered vertically.