将ImageView设置为全屏,并在其上显示图标。

时间:2018-01-25 09:36:14

标签: java javafx imageview fullscreen scenebuilder

其他ImageView上有不同的图像视图。我可以将其设置为全屏而不更改其他图像位置吗?当我启动程序时,即使窗格是Fullsreen,图像也保持相同的大小。 我的FXML:

 <?xml version="1.0" encoding="UTF-8"?>
 <?import javafx.scene.control.Button?>
 <?import javafx.scene.image.Image?>
 <?import javafx.scene.image.ImageView?>
 <?import javafx.scene.layout.Pane?>

<Pane id="pane" maxHeight="-Infinity" maxWidth="-Infinity"minHeight="-Infinity" minWidth="-Infinity" prefHeight="537.0" prefWidth="713.0" style="-fx-background-color: white;" type="Pane" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="studiprojekt.Studi_Controller">
<children>
  <Button fx:id="buttonBuch" layoutX="200.0" layoutY="88.0" mnemonicParsing="false" onAction="#pressButton" prefHeight="60.0" prefWidth="61.0" />
  <ImageView fx:id="bildAuto" fitHeight="537.0" fitWidth="721.0" pickOnBounds="true" preserveRatio="true">
     <image>
        <Image url="file:/C:/Users/buerv/Documents/NetBeansProjects/StudiProjekt/Skyline.JPG" />
     </image>
  </ImageView>
  <ImageView id="bildAuto" fitHeight="50.0" fitWidth="43.0" layoutX="210.0" layoutY="97.0" pickOnBounds="true" preserveRatio="true">
     <image>
        <Image url="file:/C:/Users/buerv/Documents/NetBeansProjects/StudiProjekt/Icons/contacts-book.png" />
     </image>
  </ImageView>
  <ImageView fitHeight="50.0" fitWidth="50.0" layoutX="534.0" layoutY="86.0" pickOnBounds="true" preserveRatio="true">
     <image>
        <Image url="file:/C:/Users/buerv/Documents/NetBeansProjects/StudiProjekt/Icons/earth-and-laptop.png" />
     </image>
  </ImageView>
  <ImageView fitHeight="60.0" fitWidth="73.0" layoutX="379.0" layoutY="344.0" pickOnBounds="true" preserveRatio="true">
     <image>
        <Image url="file:/C:/Users/buerv/Documents/NetBeansProjects/StudiProjekt/Icons/sedan-car-model.png" />
     </image>
  </ImageView>
  <ImageView fitHeight="50.0" fitWidth="50.0" layoutX="111.0" layoutY="294.0" pickOnBounds="true" preserveRatio="true">
     <image>
        <Image url="file:/C:/Users/buerv/Documents/NetBeansProjects/StudiProjekt/Icons/code-signs-on-laptop-screen.png" />
     </image>
  </ImageView>
  <ImageView fitHeight="50.0" fitWidth="50.0" layoutX="383.0" layoutY="250.0" pickOnBounds="true" preserveRatio="true">
     <image>
        <Image url="file:/C:/Users/buerv/Documents/NetBeansProjects/StudiProjekt/Icons/rectangular-closed-padlock-lock-interface-symbol.png" />
     </image>
  </ImageView>
  <ImageView fitHeight="50.0" fitWidth="50.0" layoutX="545.0" layoutY="310.0" pickOnBounds="true" preserveRatio="true">
     <image>
        <Image url="file:/C:/Users/buerv/Documents/NetBeansProjects/StudiProjekt/Icons/car-chassis.png" />
      </image>
   </ImageView>
</children>
</fx:root>

0 个答案:

没有答案