org.objectweb.asm.Label.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(150)

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

Label.<init>介绍

[英]Constructs a new label.
[中]构造一个新标签。

代码示例

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

val incBtn = new Button("Increment")
val label = new Label("0")

label.text |= EventStreams.eventsOf(incBtn, ACTION)
  .accumulate(0, (n, a) => n + 1)
  .map(n => n.toString)

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

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.text.Text;
import javafx.stage.Stage;

// displays the width in pixels of an arbitrary piece of text.
public class MeasureText extends Application {
 public static void main(String[] args) { launch(args); }
 @Override public void start(Stage stage) throws Exception {
  final Text text = new Text("XYZZY");
  new Scene(new Group(text));

  // java 7 => 
  //    text.snapshot(null, null);
  // java 8 =>
  text.applyCss(); 

  final double width = text.getLayoutBounds().getWidth();

  stage.setScene(new Scene(new Label(Double.toString(width))));
  stage.show();
 }
}

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

primaryStage.setTitle("Extension Filter Example");
final Label fileLabel = new Label();
Button btn = new Button("Open FileChooser");
btn.setOnAction(new EventHandler<ActionEvent>() {
VBox vBox = new VBox(30);
vBox.getChildren().addAll(fileLabel, btn);
vBox.setAlignment(Pos.BASELINE_CENTER);
primaryStage.setScene(new Scene(root, 300, 250));
primaryStage.show();

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

);
searchButton = new Button("Search");
searchResults = new Label();
    searchResults
);
layout.setPadding(new Insets(10));

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

private static final Insets SAFETY_ZONE = new Insets(10);
private Label cowerInFear = new Label();
private Stage mainStage;
      cowerInFear.setText("The Wumpus " + nextAttack() + "!");
      mainStage.sizeToScene();
      mainStage.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) {
  VBox layout = new VBox(10);
  layout.setPadding(new Insets(10));
  layout.setAlignment(Pos.CENTER);

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

DialogPane pane = new DialogPane() {
  @Override
  public Node createButtonBar() {
    VBox vbox = new VBox(5);
    vbox.setAlignment(Pos.BOTTOM_RIGHT);
    vbox.setPadding(new Insets(5));
    vbox.getChildren().add(super.createButtonBar());
    vbox.getChildren().add(new Label("Additional text"));
    return vbox ;
  }
};

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

final Label response = new Label();
final ImageView imageView = new ImageView(
 new Image("http://icons.iconarchive.com/icons/gianni-polito/colobrush/128/software-emule-icon.png")
final VBox layout = new VBox(10);
layout.setPrefWidth(300);
layout.setAlignment(Pos.CENTER);
layout.getChildren().addAll(button, response);
layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 20; -fx-font-size: 20;");
stage.setScene(new Scene(layout));

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

);
final Label currentRaceStage = new Label();
currentRaceStage.textProperty().bind(
  taskMonitor.currentTaskNameProperty()
final Button startButton = new Button("Start Race");
startButton.disableProperty().bind(taskMonitor.idleProperty().not());
startButton.setOnAction(new EventHandler<ActionEvent>() {
final VBox layout = new VBox(10);
layout.getChildren().setAll(
 raceProgress,
 startButton

代码示例来源: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

Button button = new Button();
VBox threeLabels = new VBox();
threeLabels.setAlignment(Pos.CENTER);
threeLabels.getChildren.setAll(
 new Label("upper"),
 new Label("center"),
 new Label("lower")
);
button.setGraphic(threeLabels);

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

);
Label title = new Label("TRON");
title.getStyleClass().add("title");
Label caption = new Label("A sci-fi flick set in an alternate reality.");
caption.getStyleClass().add("caption");
caption.setMaxWidth(220);
caption.setTextAlignment(TextAlignment.CENTER);
VBox layout = new VBox(10);
layout.setStyle("-fx-padding: 20px; -fx-background-color: silver");
layout.setAlignment(Pos.CENTER);
layout.getChildren().setAll(
 title,
 new ImageView(
stage.setScene(scene);
stage.show();

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

Label label = new Label(WORDS);
label.setWrapText(true);
label.setStyle("-fx-font-family: \"Comic Sans MS\"; -fx-font-size: 20; -fx-text-fill: darkred;");
stage.setScene(new Scene(layout));
stage.show();

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

public class SecondStage extends Stage {
Label x = new Label("Second stage");
VBox y = new VBox();

SecondStage(){
  y.getChildren().add(x);
  this.setScene(new Scene(y, 300, 300));
  this.show();
  }    
}

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

Button incBtn = new Button("Increment");
Label label = new Label("0");

EventStreams.eventsOf(incBtn, ACTION)
    .accumulate(0, (n, a) -> n + 1)
    .map(Object::toString)
    .feedTo(label.textProperty());

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

Button b = new Button();
VBox box = new VBox();
box.getChildren().addAll(new Label("line1"), new Label("line2"));
b.setGraphic(box);

代码示例来源: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())) {
 Button invisiblePause = new Button("Pause");
 invisiblePause.setVisible(false);
 play.prefHeightProperty().bind(invisiblePause.heightProperty());

代码示例来源: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

imageView.setFitWidth(228);
final Label label = new Label("The Once\nand\nFuture King");
label.setStyle("-fx-text-fill: goldenrod; -fx-font: italic 20 \"serif\"; -fx-padding: 0 0 20 0; -fx-text-alignment: center");
layout.getChildren().addAll(imageView, glass);
layout.setStyle("-fx-background-color: silver; -fx-padding: 10;");
stage.setScene(new Scene(layout));
stage.show();

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

public class CustomGroup extends Group {

  private VBox contentPane = new VBox();

  public CustomGroup() {
    getChildren().add(contentPane);
    contentPane.getChildren().add(new Label("First Label"));
    contentPane.getChildren().add(new Label("Second Label"));
  }

  public void setItems(Node...nodes) {
    contentPane.getChildren().addAll(nodes);
  }

  public ObservableList<Node> getItems() {
    return contentPane.getChildren();
  }

}

相关文章