Jest taki problem...

Nie wiem jak dostosować obszar wyświetlania filmu do ramki.

user image

mediaView.setScaleX(2); 
mediaView.setScaleY(2); 

to przynosi rezultat ale niestety obszar wyświetlania wchodzi na menu górne i zasłania wszystko, jak to ogarnąć?

Druga sprawa, jak do licha ciężkiego napisać button_fullscreen, żeby po naciśnięciu przechodziło do pełnego ekranu?

Kod programu:

1 ) MainController:

 package pl.goraj.media.app;

import java.io.File;
import java.net.URL;
import java.util.ResourceBundle;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.MenuItem;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaView;
import javafx.stage.FileChooser;
import javafx.stage.FileChooser.ExtensionFilter;
import javafx.stage.Stage;

public class MainController implements Initializable {

    @FXML
    private MenuItem fileMenuItem;

    @FXML
    private MediaView mediaView;

    @Override
    public void initialize(URL location, ResourceBundle resources) {

        configureMenu();

    }

    private void configureMenu() {

        fileMenuItem.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                FileChooser fc = new FileChooser();
                fc.getExtensionFilters().add(
                        new ExtensionFilter("flv", "*.flv")); // filter jakiego
                                                                // typu pliki
                                                                // mogą być
                File file = fc.showOpenDialog(new Stage());
                if (file != null) {
                    String path = file.toURI().toASCIIString();
                    System.out.println(path);
                    try {
                        Media media = new Media(path);
                        MediaPlayer player = new MediaPlayer(media);
                        player.setAutoPlay(true);

                        mediaView.setMediaPlayer(player);
                        mediaView.setVisible(true);

                    } catch (Exception e1) {
                        e1.printStackTrace();
                    }
                }
            }
        });
    }
}

main:

package pl.goraj.media.app;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class Main extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        Parent parent = FXMLLoader.load(getClass().getResource("/pl/goraj/media/app/MainPane2.fxml"));
        Scene scene = new Scene(parent);

        primaryStage.setScene(scene);
        primaryStage.show();
    }

} 

MainPane:

 <?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.media.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.BorderPane?>

<BorderPane prefHeight="267.0" prefWidth="315.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="pl.goraj.media.app.MainController">
   <top>
      <MenuBar BorderPane.alignment="CENTER">
        <menus>
          <Menu mnemonicParsing="false" text="File">
            <items>
              <MenuItem fx:id="fileMenuItem" mnemonicParsing="false" text="Otwórz film" />
            </items>
          </Menu>
          <Menu mnemonicParsing="false" text="Edit">
            <items>
              <MenuItem mnemonicParsing="false" text="Delete" />
            </items>
          </Menu>
          <Menu mnemonicParsing="false" text="Help">
            <items>
              <MenuItem mnemonicParsing="false" text="About" />
            </items>
          </Menu>
        </menus>
      </MenuBar>
   </top>
   <center>
      <AnchorPane prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
         <children>
            <MediaView fx:id="mediaView" fitHeight="200.0" fitWidth="200.0" layoutX="58.0" layoutY="21.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
         </children>
      </AnchorPane>
   </center>
</BorderPane>

Dzięki wielkie...