-
-
Save anonymous/76565799ee6d71716538618993449b8e 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) | |
{ | |
final Image img= new Image(PP4o11TEST.class.getResourceAsStream("gull.jpg")); | |
ImageView imgView = new ImageView(img); | |
ImageView imgView2= new ImageView(img); | |
imgView.setViewport(new Rectangle2D(200,80,70,60)); | |
imgView2.setViewport(new Rectangle2D(400,100,30,90)); | |
StackPane pane= new StackPane(imgView); | |
Scene scene= new Scene(pane, 500, 350); | |
pane.setStyle("-fx-background-color:cornsilk"); | |
StackPane pane2= new StackPane(imgView2); | |
Scene scene2= new Scene(pane2,700, 150); | |
pane2.setStyle("-fx-background-color:cornsilk"); | |
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