本文整理匯總了Java中jcurses.widgets.DefaultLayoutManager類的典型用法代碼示例。如果您正苦於以下問題:Java DefaultLayoutManager類的具體用法?Java DefaultLayoutManager怎麽用?Java DefaultLayoutManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DefaultLayoutManager類屬於jcurses.widgets包,在下文中一共展示了DefaultLayoutManager類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: Message
import jcurses.widgets.DefaultLayoutManager; //導入依賴的package包/類
/**
* The constructor
*
* @param title the message's title
* @param text the message's text
* @param buttonLabel the label on the message's button
*
*/
@SuppressWarnings("LeakingThisInConstructor")
public Message(String title, String text, String buttonLabel)
{
super(getWidth(text, title) + 4, getHeight(text) + 7, true, title);
DefaultLayoutManager manager = (DefaultLayoutManager) getRootPanel().getLayoutManager();
_label = new Label(text);
_button = new Button(buttonLabel);
_title = title;
_button.addListener(this);
manager.addWidget(_label, 0, 0, getWidth(text, _title) + 2, getHeight(text) + 2, WidgetsConstants.ALIGNMENT_CENTER,
WidgetsConstants.ALIGNMENT_CENTER);
manager.addWidget(_button, 0, getHeight(text) + 2, getWidth(text, _title) + 2, 5, WidgetsConstants.ALIGNMENT_CENTER,
WidgetsConstants.ALIGNMENT_CENTER);
}
示例2: Message
import jcurses.widgets.DefaultLayoutManager; //導入依賴的package包/類
/**
* The constructor
*
* @param title the message's title
* @param text the message's text
* @param buttonLabel the label on the message's button
*
*/
public Message(String title, String text, String buttonLabel) {
super(getWidth(text, title)+4, getHeight(text)+7,true,title);
DefaultLayoutManager manager = (DefaultLayoutManager)getRootPanel().getLayoutManager();
_label = new Label(text);
_button = new Button(buttonLabel);
_title = title;
_button.addListener(this);
manager.addWidget(_label,0,0,getWidth(text, _title)+2, getHeight(text)+2, WidgetsConstants.ALIGNMENT_CENTER,
WidgetsConstants.ALIGNMENT_CENTER);
manager.addWidget(_button,0,getHeight(text)+2,getWidth(text, _title)+2, 5, WidgetsConstants.ALIGNMENT_CENTER,
WidgetsConstants.ALIGNMENT_CENTER);
}