本文整理汇总了Java中com.googlecode.lanterna.gui.Component类的典型用法代码示例。如果您正苦于以下问题:Java Component类的具体用法?Java Component怎么用?Java Component使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Component类属于com.googlecode.lanterna.gui包,在下文中一共展示了Component类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getForm
import com.googlecode.lanterna.gui.Component; //导入依赖的package包/类
private Component getForm() {
Panel panel = new Panel(new Border.Invisible(), Orientation.VERTICAL);
for (IFieldDefinition field : tabDefinition.getFieldList()) {
Panel panel2 = new Panel(new Border.Invisible(), Orientation.HORISONTAL);
LanternaEditor editor = windowManagerService.getEditor(field, LanternaEditor.class);
// Label label = new Label(field.getName());
// TextBox textBox = new TextBox(getStringProperty(getActiveObject(), field));
panel2.addComponent(editor.getLabel());
Field fieldComponent = editor.getField();
fieldComponent.setValue(getActiveObject().get(field.getProperty()));
fieldComponent.addValueChangeListener(this);
fieldComponent.setCustomObject(field);
panel2.addComponent(editor.getField());
panel.addComponent(panel2);
}
return panel;
}
示例2: createMainTable
import com.googlecode.lanterna.gui.Component; //导入依赖的package包/类
private Component createMainTable() {
ActionListBox listBox = new ActionListBox();
for (int i = 0; i < menu.getSubMenuList().size(); i++) {
final IMenuDefinition subMenu = menu.getSubMenuList().get(i);
listBox.addAction(subMenu.getName(), new MenuAction(subMenu));
}
return listBox;
}
示例3: addComponent
import com.googlecode.lanterna.gui.Component; //导入依赖的package包/类
@Override
public void addComponent(Component component, LayoutParameter... layoutParameters) {
if (layoutParameters.length > 0) {
throw new IllegalArgumentException("layoutParamters must be null adding component in ScrollPanel");
}
removeAllComponents();
super.addComponent(component, layoutParameters);
}