show Info In JavaFX Alert - Java JavaFX

Java examples for JavaFX:Alert

Description

show Info In JavaFX Alert

Demo Code


import javafx.scene.control.Alert;
import java.util.Optional;

public class Main{
    public static void showInfoI18n(Optional<String> headerProperty,
            String messageProperty) {
        String header = headerProperty.isPresent() ? I18n.resourceBundle
                .getString(headerProperty.get()) : null;

        Alert alert = new Alert(Alert.AlertType.INFORMATION);
        alert.setTitle(I18n.resourceBundle.getString("general.info.title"));
        alert.setHeaderText(header);// w ww . j  a  v  a2  s  . c  o  m
        alert.setContentText(I18n.resourceBundle.getString(messageProperty));
        alert.show();
    }
}

Related Tutorials