-
-
Save anonymous/eec97cbe34dd1635eda72e59487a5a5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javafx.application.Application; | |
import javafx.event.ActionEvent; | |
import javafx.event.EventHandler; | |
import javafx.scene.Scene; | |
import javafx.scene.control.Button; | |
import javafx.scene.layout.StackPane; | |
import javafx.stage.Stage; | |
import javafx.scene.image.Image; | |
import javafx.scene.image.ImageView; | |
import javafx.geometry.Rectangle2D; | |
public class PP4o11TEST extends Application { | |
public void start(Stage primaryStage) | |
{ | |
Image img= new Image("gull.jpg"); | |
ImageView imgView = new ImageView(getClass().getResource("gull.jpg").toExternalForm()); | |
Image img2= new Image("gull.jpg"); | |
ImageView imgView2 = new ImageView(getClass().getResource("gull.jpg").toExternalForm());; | |
imgView.setViewport(new Rectangle2D(200,80,70,60)); | |
imgView2.setViewport(new Rectangle2D(400,100,30,90)); | |
StackPane pane= new StackPane(imgView); | |
StackPane pane2= new StackPane(imgView2); | |
pane.setStyle("-fx-background-color:cornsilk"); | |
Scene scene= new Scene(pane, 500, 350); | |
primaryStage.setTitle("Viewport Gull"); | |
primaryStage.setScene(scene); | |
primaryStage.show(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment