我想为黑莓上的弹出屏幕添加一个白色边框。我使用此代码添加边框
Popup x = new Popup();
Border borderFocus = BorderFactory.createRoundedBorder(new XYEdges(10, 10, 10, 10), 0xffffff, Border.STYLE_SOLID);
x.getDelegate().setBorder(borderFocus);
/////////////////弹出类//////////////////
public class Popup extends PopupScreen {
public Popup() {
super(new VerticalFieldManager(), Field.FOCUSABLE);
HorizontalFieldManager hfm = new HorizontalFieldManager(
Field.USE_ALL_WIDTH | FIELD_VCENTER);
HorizontalFieldManager hfmBtn = new HorizontalFieldManager(
Field.USE_ALL_WIDTH | FIELD_VCENTER | FIELD_HCENTER);
LabelField title_screen = new LabelField("ddd");
title_screen.setPadding(11, 5, 0, 0);
hfm.add(title_screen);
add(hfm);
add(new SeparatorField());
add(new LabelField(""));
final LabelField labelVersion = new LabelField("ffffffffffffff");
ButtonField btn_cancel = new ButtonField(
"cancel");
ButtonField btn_ok = new ButtonField("Yes");
btn_ok.setPadding(0, 0, 0, 60);
add(labelVersion);
hfmBtn.add(btn_cancel);
hfmBtn.add(btn_ok);
add(new LabelField(""));
add(hfmBtn);
}
public void sublayout(int width, int height){
super.sublayout(width,height);
setPosition(35,65);
}
public boolean onClose() {
UiApplication.getUiApplication().popScreen();
return true;
}
但是我将边框放入弹出窗口,并且弹出窗口没有白色边框。