Search in sources :

Example 71 with Label

use of javafx.scene.control.Label in project bitsquare by bitsquare.

the class BindingTest method start.

@Override
public void start(Stage primaryStage) {
    VBox root = new VBox();
    root.setSpacing(20);
    Label label = new Label();
    StringProperty txt = new SimpleStringProperty();
    txt.set("-");
    label.textProperty().bind(txt);
    Button button = new Button("count up");
    button.setOnAction(e -> {
        txt.set("counter " + counter++);
    });
    root.getChildren().addAll(label, button);
    primaryStage.setScene(new Scene(root, 400, 400));
    primaryStage.show();
}
Also used : Button(javafx.scene.control.Button) Label(javafx.scene.control.Label) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) StringProperty(javafx.beans.property.StringProperty) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) Scene(javafx.scene.Scene) VBox(javafx.scene.layout.VBox)

Example 72 with Label

use of javafx.scene.control.Label in project Gargoyle by callakrsos.

the class CodeAnalysisJavaTextArea method initialize.

@FXML
public void initialize() {
    choMethod = new ChoiceBox<>();
    choMethod.setConverter(new StringConverter<SourceAnalysisDVO>() {

        @Override
        public String toString(SourceAnalysisDVO d) {
            return d.getMethodName();
        }

        @Override
        public SourceAnalysisDVO fromString(String string) {
            return null;
        }
    });
    // jdk1.8.73이후버젼부터 사용가능
    choMethod.setOnAction(event -> {
        SourceAnalysisDVO selectedItem = choMethod.getSelectionModel().getSelectedItem();
        String methodName = selectedItem.getMethodName();
        int methodBlockStart = selectedItem.getMethodBlockStart();
        int finallyBlockIdx = methodBlockStart - 1;
        String string = newInstance.getReadLines().get(finallyBlockIdx);
        if (!string.contains(methodName)) {
            for (int i = methodBlockStart - 2; i < methodBlockStart + 1; i++) {
                if (i < 0)
                    continue;
                if (i == (methodBlockStart - 1))
                    continue;
                string = newInstance.getReadLines().get(i);
                if (string.contains(methodName)) {
                    finallyBlockIdx = i;
                    break;
                }
            }
        }
        IntStream mapToInt = Stream.of(txtJavaTextArea.getText().split("\n")).limit(finallyBlockIdx).mapToInt(mapper -> {
            return mapper.length() + 1;
        });
        int length = string.split("\t").length - 1;
        int sum = mapToInt.sum() + length;
        System.out.println(string);
        txtJavaTextArea.selectRange(sum, sum + methodName.length());
    });
    this.setTop(new HBox(5, new Label("Method Name : "), choMethod));
}
Also used : HBox(javafx.scene.layout.HBox) Label(javafx.scene.control.Label) IntStream(java.util.stream.IntStream) SourceAnalysisDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.SourceAnalysisDVO) FXML(javafx.fxml.FXML)

Example 73 with Label

use of javafx.scene.control.Label in project Gargoyle by callakrsos.

the class DesignerFx method createCodeEditorPanel.

private BorderPane createCodeEditorPanel() {
    BorderPane p = new BorderPane();
    //		JPanel p = new JPanel();
    //		p.setLayout(new BorderLayout());
    //		codeEditorPane.setBorder(BorderFactory.createLineBorder(Color.black));
    //		makeTextComponentUndoable(codeEditorPane);
    p.setTop(new Label("Source code:"));
    //		SwingNode fxScrollPane = new SwingNode();
    //		createSwingContent(fxScrollPane, new JScrollPane(codeEditorPane));
    p.setCenter(codeEditorPane);
    //		createSwingContent(swingNode, p);
    return p;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) Label(javafx.scene.control.Label) JLabel(javax.swing.JLabel)

Example 74 with Label

use of javafx.scene.control.Label in project Gargoyle by callakrsos.

the class MergedRowSkin method getNode.

@Override
public Node getNode() {
    TableView<T> tableView = this.row.getTableView();
    TableColumn<T, S> tableColumn = this.row.getTableColumn();
    ObservableValue<S> cellObservableValue = tableColumn.getCellObservableValue(0);
    Label label = new Label();
    label.setText(cellObservableValue.getValue().toString());
    return label;
}
Also used : Label(javafx.scene.control.Label)

Example 75 with Label

use of javafx.scene.control.Label in project trex-stateless-gui by cisco-system-traffic-generator.

the class LogsView method getMsgLabel.

private Label getMsgLabel(String msgText, String className) {
    Label msgLabel = new Label(msgText);
    msgLabel.getStyleClass().add(className);
    return msgLabel;
}
Also used : Label(javafx.scene.control.Label)

Aggregations

Label (javafx.scene.control.Label)148 Insets (javafx.geometry.Insets)51 Button (javafx.scene.control.Button)42 Scene (javafx.scene.Scene)31 HBox (javafx.scene.layout.HBox)27 VBox (javafx.scene.layout.VBox)27 TextField (javafx.scene.control.TextField)23 GridPane (javafx.scene.layout.GridPane)23 BorderPane (javafx.scene.layout.BorderPane)19 Node (javafx.scene.Node)17 Stage (javafx.stage.Stage)14 ArrayList (java.util.ArrayList)13 ImageView (javafx.scene.image.ImageView)13 List (java.util.List)12 InputTextField (io.bitsquare.gui.components.InputTextField)11 Tooltip (javafx.scene.control.Tooltip)11 ActionEvent (javafx.event.ActionEvent)10 Image (javafx.scene.image.Image)10 StackPane (javafx.scene.layout.StackPane)10 Map (java.util.Map)9