package com.caci.highview.imaging.client.integrated;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import java.awt.Desktop;

/**
 *
 * @author ldreyer
 */
public class FXMLDocumentController implements Initializable {

    @FXML
    private Label label;

    @FXML
    private void handleButtonAction(ActionEvent event) {
        System.out.println("You clicked me!");

        try {
            Desktop d = Desktop.getDesktop();
        } catch (Exception e) {
            StringBuilder sb = new StringBuilder(e.toString());
            for (StackTraceElement ste : e.getStackTrace()) {
                sb.append("\nat ");
                sb.append(ste);
            }
            String trace = sb.toString();

            label.setText("Desktop.getDesktop() threw exception: \n" + trace);
            return;
        }

        label.setText("Desktop.getDesktop() succeeded");

    }

    @Override
    public void initialize(URL url, ResourceBundle rb) {
        // TODO
    }

}
