org.gwtbootstrap3.client.ui.Button.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中org.gwtbootstrap3.client.ui.Button.<init>()方法的一些代码示例,展示了Button.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.<init>()方法的具体详情如下:
包路径:org.gwtbootstrap3.client.ui.Button
类名称:Button
方法名:<init>

Button.<init>介绍

[英]Creates button with DEFAULT type.
[中]创建默认类型的按钮。

代码示例

代码示例来源:origin: stackoverflow.com

LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);

LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
   LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);

layoutParams.setMargins(30, 20, 30, 0);

Button okButton=new Button(this);
okButton.setText("some text");
ll.addView(okButton, layoutParams);

代码示例来源:origin: stackoverflow.com

LinearLayout myLayout = findViewById(R.id.main);

Button myButton = new Button(this);
myButton.setLayoutParams(new LinearLayout.LayoutParams(
                   LinearLayout.LayoutParams.MATCH_PARENT,
                   LinearLayout.LayoutParams.MATCH_PARENT));

myLayout.addView(myButton);

代码示例来源:origin: stackoverflow.com

Button bt = new Button(this);
bt.setText("A Button");
bt.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 
                  LayoutParams.WRAP_CONTENT));
linerLayout.addView(bt);

代码示例来源:origin: stackoverflow.com

LinearLayout gameWidgets = new LinearLayout (this);
Button endGameButton = new Button(this);
TextView myText = new TextView(this);
endGameButton.setText("Start Game");
myText.setText("rIZ..i");
gameWidgets.addView(myText);
gameWidgets.addView(endGameButton);       
endGameButton.setOnClickListener(this);

代码示例来源:origin: stackoverflow.com

Button startButton = new Button("Start");
startButton.setOnAction(event -> {
  MessageProducer producer = new MessageProducer(messageQueue);
  Thread t = new Thread(producer);
primaryStage.setScene(scene);
primaryStage.show();

代码示例来源:origin: stackoverflow.com

Stage dialogStage = new Stage();
 dialogStage.initModality(Modality.WINDOW_MODAL);
 VBox vbox = new VBox(new Text("Hi"), new Button("Ok."));
 vbox.setAlignment(Pos.CENTER);
 vbox.setPadding(new Insets(15));
 dialogStage.setScene(new Scene(vbox));
 dialogStage.show();

代码示例来源:origin: stackoverflow.com

final Group root = new Group();
Button button = new Button("Add more windows");     
primaryStage.setScene(new Scene(root, 600, 500));
button.setOnAction(new EventHandler<ActionEvent>() {            
  @Override
  public void handle(ActionEvent arg0) {
    w.getContentPane().getChildren().add(new Label("Content... \nof the window#"+counter++));

代码示例来源:origin: stackoverflow.com

final Label currentlyPlaying = new Label();
final ProgressBar progress = new ProgressBar();
private ChangeListener<Duration> progressChangeListener;
 final Button skip = new Button("Skip");
 final Button play = new Button("Pause");
 skip.setOnAction(new EventHandler<ActionEvent>() {
  @Override public void handle(ActionEvent actionEvent) {
   final MediaPlayer curPlayer = mediaView.getMediaPlayer();
 play.setOnAction(new EventHandler<ActionEvent>() {
  @Override public void handle(ActionEvent actionEvent) {
   if ("Pause".equals(play.getText())) {
    mediaView.getMediaPlayer().pause();
    play.setText("Play");
   } else {
    mediaView.getMediaPlayer().play();
    play.setText("Pause");
 Button invisiblePause = new Button("Pause");
 invisiblePause.setVisible(false);
 play.prefHeightProperty().bind(invisiblePause.heightProperty());

代码示例来源:origin: stackoverflow.com

public class AlertDialogTestActivity extends Activity
{

  AlertDialog alert;

  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Button connect = new Button(this);
    connect.setText("Don't push me");

    AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
    alertBuilder.setTitle("Profile");
    alertBuilder.setView(connect);

    connect.setOnClickListener(new View.OnClickListener() {

      public void onClick(View v) {
        alert.dismiss();
      }
    });

    alert = alertBuilder.create();
  }
}

代码示例来源:origin: stackoverflow.com

Button b = new Button();
b.setOnAction(new EventHandler<ActionEvent>() {
  @Override public void handle(ActionEvent e) {
    Stage stage = new Stage();
    //Fill stage with content
    stage.show();
  }
});

代码示例来源:origin: stackoverflow.com

@Override
public void start(final Stage primaryStage) {
  Button btn = new Button();
  btn.setText("Open Dialog");
  btn.setOnAction(
    new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        final Stage dialog = new Stage();
        dialog.initModality(Modality.APPLICATION_MODAL);
        dialog.initOwner(primaryStage);
        VBox dialogVbox = new VBox(20);
        dialogVbox.getChildren().add(new Text("This is a Dialog"));
        Scene dialogScene = new Scene(dialogVbox, 300, 200);
        dialog.setScene(dialogScene);
        dialog.show();
      }
     });
  }

代码示例来源:origin: stackoverflow.com

public class MainActivity
   extends Activity
   implements View.OnClickListener {
   @Override
   public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     TableLayout layout = new TableLayout (this);
     layout.setLayoutParams( new TableLayout.LayoutParams(4,5) );
     layout.setPadding(1,1,1,1);
     for (int f=0; f<=13; f++) {
       TableRow tr = new TableRow(this);
       for (int c=0; c<=9; c++) {
         Button b = new Button (this);
         b.setText(""+f+c);
         b.setTextSize(10.0f);
         b.setTextColor(Color.rgb( 100, 200, 200));
         b.setOnClickListener(this);
         tr.addView(b, 30,30);
       } // for
       layout.addView(tr);
     } // for
     super.setContentView(layout);
   } // ()
   public void onClick(View view) {
     ((Button) view).setText("*");
     ((Button) view).setEnabled(false);
   }
 } // class

代码示例来源:origin: stackoverflow.com

vb.setPadding( new Inset(10,10,10,10) );
vb.setSpacing( 10 );
Button yesButton = new Button( "Yes" );
yesButton.setOnAction( new EventHandler<ActionEvent>() {
  @Override public void handle( ActionEvent e ) {
    dial.close();
Button noButton = new Button( "No" );
noButton.setOnAction( new EventHandler<ActionEvent>() {
  @Override public void handle( ActionEvent e ) {
    dial.close();
vb.setPadding( new Inset(10,10,10,10) );
vb.setSpacing( 10 );
Button okButton = new Button( "OK" );
okButton.setAlignment( Pos.CENTER );
okButton.setOnAction( new EventHandler<ActionEvent>() {
  @Override public void handle( ActionEvent e ) {
    dial.close();

代码示例来源:origin: stackoverflow.com

Button myButton = new Button(this);
myButton.setText("Push Me");

LinearLayout ll = (LinearLayout)findViewById(R.id.buttonlayout);
LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
ll.addView(myButton, lp);

代码示例来源:origin: stackoverflow.com

mainLayout = new LinearLayout(this);
tv = new TextView(this);
but = new Button(this);
but.setText("Click Me");
but.setOnClickListener(new OnClickListener() {
layout.setOrientation(LinearLayout.VERTICAL);
tv.setText("Hi this is a sample text for popup window");
layout.addView(tv, params);
popUp.setContentView(layout);
mainLayout.addView(but, params);
setContentView(mainLayout);

代码示例来源:origin: stackoverflow.com

final Label label = new Label();
final Model model = new Model();
final NumberFormat formatter = NumberFormat.getIntegerInstance();
final Button startButton = new Button("Start");
startButton.setOnAction(new EventHandler<ActionEvent>() {
 @Override
 public void handle(ActionEvent event) {
primaryStage.setScene(scene);
primaryStage.show();

代码示例来源:origin: stackoverflow.com

btns[i] =   new Button(this);
btns[i].setBackgroundColor(getResources().getColor(android.R.color.transparent));
btns[i].setText(""+(i+1));
ll.addView(btns[i], lp);

代码示例来源:origin: stackoverflow.com

Button configure = new Button("Configure");
changeBackgroundOnHoverUsingBinding(configure);
Button update = new Button("Update");
changeBackgroundOnHoverUsingEvents(update);
layout.setStyle("-fx-padding: 10;");
layout.getChildren().addAll(configure, update);
stage.setScene(new Scene(layout));
stage.show();

代码示例来源:origin: stackoverflow.com

private final Button runButton = new Button("Run");
private final Label label = new Label();
      );
  runButton.setOnAction(new EventHandler<ActionEvent>() {
    @Override
    public void handle(ActionEvent event) {

代码示例来源:origin: stackoverflow.com

public class MyActivity extends Activity {
  protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    final Button button = new Button(this);
    button.setText("Press me!");
    setContentView(button);
    button.setOnClickListener(new View.OnClickListener() {
      public void onClick(View v) {
        // Perform action on click
      }
    });
  }
}

相关文章