BUG in 1.1: FocusPanel and font size

Skip to first unread message

Konstantin Scheglov

Aug 11, 2006, 5:07:06 PM8/11/06
to Google Web Toolkit
When I run code below with GWT 1.1, I see very-very small label in
upper left corner of FocusPanel. In 1.0.21 it works fine.

package com.mycompany.project.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.FocusPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
* Entry point classes define <code>onModuleLoad()</code>.
public class ImageViewer implements EntryPoint {
public void onModuleLoad() {
RootPanel rootPanel = RootPanel.get();
final FocusPanel focusPanel = new FocusPanel();
rootPanel.add(focusPanel, 142, 72);
focusPanel.setSize("338px", "253px");
final Label label = new Label();
label.setText("New Label");


Aug 11, 2006, 5:35:45 PM8/11/06
to Google Web Toolkit

Congratulations -- you caught one of the more embarassing bugs I've
shipped in recent memory! It looks like the default implementation of
FocusImpl.createFocusable() has a block-copy bug that sets the
FocusPanel's default font-size to 0. I believe we managed to miss this
because our samples have font sizes set on the elements added to
FocusPanels, Menus, and Trees, which hides the problem.

Which leads us to a workaround: set the font size (either in code or
in CSS) of the widget that you add to a FocusPanel, and it will
override the default that it inherits.


Reply all
Reply to author
0 new messages