📜  cgange 背景来自按钮单击 java fx - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:11.462000             🧑  作者: Mango

代码示例1
BackgroundImage backgroundImage = new BackgroundImage( new Image( getClass().getResource("/testing/background.jpg").toExternalForm()), BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, BackgroundSize.DEFAULT);
        Background background = new Background(backgroundImage);

        Button button = new Button( "Click me!");
        button.setBackground(background);