私の目標は、背景画像とこれらの上にラベルを持つボタンを持つことです。ボタンの中央にラベルを配置し、テキストを垂直方向に揃えたいと思います。ラベルの文字数に比例してボタンを拡大したい。このタイプの複合ウィジェットを構築するために使用するのに最適なタイプのパネルは何ですか?
private PushButton button;
private Label label = new Label();
private AbsolutePanel panel = new AbsolutePanel();
private Image image = new Image("images/rectangle_blue.png");
public ExpandingRectangularButton(String text)
{
label.setText(text);
String width = "120px";
String height = "160px";
image.setWidth(width);
image.setHeight(height);
button = new PushButton(image);
panel.add(button, 0, 0);
panel.setWidth(width);
panel.setHeight(height);
initWidget( panel );
}
この場合、どのタイプのパネルを使用するのが最適ですか? フロー、水平、およびフレックステーブルを試しましたが、これらをウィジェットを互いに正しく積み重ねることができません