📜  Javafx 按钮颜色 - Java 代码示例

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

代码示例3
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);