本文整理了Java中com.vaadin.ui.Button.setWidth()
方法的一些代码示例,展示了Button.setWidth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setWidth()
方法的具体详情如下:
包路径:com.vaadin.ui.Button
类名称:Button
方法名:setWidth
暂无
代码示例来源:origin: stackoverflow.com
OnCreate(Bundle bundle) {
//set content layout, etc up here
//now adjust button sizes
Button B = (Button) findViewById(R.id.somebutton);
int someDimension = 50; //50pixels
B.setWidth(someDimension);
B.setHeight(someDimension);
}
代码示例来源:origin: stackoverflow.com
inviteButton.setWidth(30);
inviteButton.setHeight(30);
代码示例来源:origin: stackoverflow.com
int height = metrics.heightPixels;
int width = metrics.widthPixels;
Button Button1 = (Button) findViewById(R.id.button1);
Button Button2 = (Button) findViewById(R.id.button2);
Button1.setWidth(width / 2);
Button2.setWidth(width / 2);
代码示例来源:origin: stackoverflow.com
public void fillview(android.support.v7.widget.GridLayout gl)
{
Button buttontemp;
//Stretch buttons
int idealChildWidth = (int) ((gl.getWidth()-20*gl.getColumnCount())/gl.getColumnCount());
for( int i=0; i< gl.getChildCount();i++)
{
buttontemp = (Button) gl.getChildAt(i);
buttontemp.setWidth(idealChildWidth);
}
}
代码示例来源:origin: stackoverflow.com
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.emailpopup);
Button btn = (Button) findViewById(R.id.btnmarwa);
btn.setWidth(width/2);
代码示例来源:origin: stackoverflow.com
public void fillview(android.support.v7.widget.GridLayout gl)
{
Button buttontemp;
//Stretch buttons
int idealChildWidth = (int) ((gl.getWidth()-20*gl.getColumnCount())/gl.getColumnCount());
for( int i=0; i< gl.getChildCount();i++)
{
buttontemp = (Button) gl.getChildAt(i);
buttontemp.setWidth(idealChildWidth);
}
}
代码示例来源:origin: stackoverflow.com
OnCreate(Context ctx){
int w = getWidth();
int h = getHeight();
Button B1 = findViewById(R.id.button1);
B1.setWidth(w/3);
--repeat for button2,3 textview--
}
代码示例来源:origin: KrailOrg/krail
/**
* See {@link ButtonOption#apply(MessageBox, Button)}
*/
@Override
public void apply(MessageBox messageBox, Button button) {
button.setWidth(width);
}
代码示例来源:origin: stackoverflow.com
public void fillview(android.support.v7.widget.GridLayout gl)
{
Button buttontemp;
//Stretch buttons
int idealChildWidth = (int) ((gl.getWidth()-20*gl.getColumnCount())/gl.getColumnCount());
for( int i=0; i< gl.getChildCount();i++)
{
buttontemp = (Button) gl.getChildAt(i);
buttontemp.setWidth(idealChildWidth);
}
}
代码示例来源:origin: stackoverflow.com
final Button button = (Button) findViewById(R.id.Button01);
int pixels = 30;
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
button.setWidth(pixels);
}
});
代码示例来源:origin: com.vaadin/vaadin-server
resize.setWidth("100%");
resize.setHeight("10px");
resize.setPrimaryStyleName("resize-button");
ok.setWidth("70px");
ok.addClickListener(this::okButtonClick);
cancel.setWidth("70px");
cancel.addClickListener(this::cancelButtonClick);
代码示例来源:origin: stackoverflow.com
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
btnWidth = metrics.heightPixels/3 - 50;//gap
btnHeight = btnWidth;
Button b1 = (Button) findViewById(R.id.b1);
b1.setHeight(btnWidth);
b1.setWidth(btnWidth);
代码示例来源:origin: stackoverflow.com
private void setButtonSize(AlertDialog dialog) {
Button button = dialog.getButton(AlertDialog.BUTTON_POSITIVE);
int height = getResources().getDimensionPixelSize(R.dimen.alertdialog_button_height);
int width = getResources().getDimensionPixelSize(R.dimen.alertdialog_button_width);
button.setHeight(height);
button.setWidth(width);
}
代码示例来源:origin: stackoverflow.com
Button bt=(Button)findViewById(R.id.button);
bt.setWidth(width);//screen width(fill_parent)
bt.setHeight(height/6);//1/6 of the screen height
代码示例来源:origin: stackoverflow.com
final Button button1 = (Button) findViewById(R.id.button1);
final Button button2 = (Button) findViewById(R.id.button2);
button1.post(new Runnable() {
@Override
public void run() {
int width = button1.getWidth();
button2.setWidth(width);
}
});
代码示例来源:origin: com.github.markash/components
public static Button build(final String caption, final String styleName, final ClickListener listener) {
Button button = new Button(caption);
if (StringUtils.isNotBlank(styleName)) {
button.setStyleName(styleName);
}
button.setWidth(100.0f, Unit.PERCENTAGE);
if (listener != null) {
button.addClickListener(listener);
}
return button;
}
代码示例来源:origin: com.github.markash/components
public static Button build(final String caption, final VaadinIcons icon, final ClickListener listener) {
Button button = new Button(caption);
button.setIcon(icon);
button.setWidth(100.0f, Unit.PERCENTAGE);
if (listener != null) {
button.addClickListener(listener);
}
return button;
}
代码示例来源:origin: org.aperteworkflow/gui-commons
public static Button link(String caption, Resource icon, Button.ClickListener listener) {
Button b = button(caption, null, "link", listener);
b.setIcon(icon);
b.setWidth(b.getWidth() + 10, Sizeable.UNITS_PIXELS);
return b;
}
代码示例来源:origin: kingbbode/spring-boot-ehcache-monitor
private HorizontalLayout createSearchBox() {
HorizontalLayout horizontalLayout = new HorizontalLayout();
this.searchTextField.setWidth("70%");
horizontalLayout.addComponent(this.searchTextField);
Button button = new Button(VaadinIcons.SEARCH);
button.addClickListener(event -> searchAction());
button.setWidth("30%");
horizontalLayout.addComponent(button);
return horizontalLayout;
}
代码示例来源:origin: org.activiti/activiti-explorer
protected Button addMenuButton(String type, String label, Resource icon, boolean active, float width) {
Button button = new Button(label);
button.addStyleName(type);
button.addStyleName(ExplorerLayout.STYLE_MAIN_MENU_BUTTON);
button.addStyleName(Reindeer.BUTTON_LINK);
button.setHeight(54, UNITS_PIXELS);
button.setIcon(icon);
button.setWidth(width, UNITS_PIXELS);
addComponent(button);
setComponentAlignment(button, Alignment.TOP_CENTER);
return button;
}
内容来源于网络,如有侵权,请联系作者删除!