【发布时间】:2017-03-30 06:45:08
【问题描述】:
我正在使用以下代码创建一个对话框:
Dialog dlg = new Dialog();
dlg.setUIID("AboutDialog");
dlg.setTitle("About");
dlg.setScrollableY(true);
dlg.setScrollVisible(true);
dlg.setLayout(new BorderLayout());
SpanLabel spl = new SpanLabel(DialogText.aboutTxt[txtItem]);
dlg.addComponent(BorderLayout.CENTER, spl);
height = screenHorizontalSize / 9;
width = screenVerticalSize / 10;
Button close = new Button("Close");
close.addActionListener((ee) -> dlg.dispose());
dlg.addComponent(BorderLayout.SOUTH, close);
dlg.show(height, height, width, width);
DialogText 包含几行需要在低分辨率设备上滚动的行,但上面的代码没有实现这一点。我错过了什么?还尝试使 SpanLabel 可滚动,但没有奏效。 刚刚将此项目从 Eclipse 移至 Netbeans(对此是新的)。使用旧的 GUI 构建器,但不适用于此对话框。
【问题讨论】:
标签: java codenameone