4.1 GridPane - Introduction [learn JavaFX]

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

how to make a row single column only???

Автор

Basic animation:

import javafx.animation.*;
import
import javafx.fxml.FXMLLoader;
import javafx.scene.Group;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import
import
import javafx.stage.Stage;
import javafx.scene.shape.Rectangle;
import javafx.util.Duration;
import javax.swing.*;
import java.awt.*;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Group root = new Group();
Rectangle R1= new Rectangle(350, 200, 100, 200);

R1.setStroke(Color.ORANGE);
TranslateTransition st = new
st.setByX(200);
st.setByY(0);

ParallelTransition pt1 =new ParallelTransition(R1, st);
pt1.play();

primaryStage.setTitle("Hello World");
Scene S=new Scene(root, 800, 800);
S.setFill(Color.PINK);
primaryStage.setScene(S);
primaryStage.show();
}


public static void main(String[] args) {
launch(args);
}
}

dhinakaranupala
Автор

SCALING

package sample;

import javafx.animation.*;
import
import javafx.fxml.FXMLLoader;
import javafx.scene.Group;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import
import
import javafx.scene.transform.Scale;
import javafx.stage.Stage;
import javafx.scene.shape.Rectangle;
import javafx.util.Duration;
import javax.swing.*;
import java.awt.*;

public class Main extends Application {

@Override
public void start(Stage primaryStage) throws Exception{
Group root = new Group();
Rectangle R1= new Rectangle(10, 20, 100, 200);

R1.setStroke(Color.ORANGE);
Scale t1= new Scale(3, 2);


primaryStage.setTitle("Hello World");
Scene S=new Scene(root, 800, 800);
S.setFill(Color.PINK);
primaryStage.setScene(S);
primaryStage.show();
}


public static void main(String[] args)
{
launch(args);
}
}




TRANSLATE:
package sample;

import javafx.animation.*;
import
import javafx.fxml.FXMLLoader;
import javafx.scene.Group;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import
import
import javafx.stage.Stage;
import javafx.scene.shape.Rectangle;
import javafx.util.Duration;
import javax.swing.*;
import java.awt.*;

public class Main extends Application {

@Override
public void start(Stage primaryStage) throws Exception{
Group root = new Group();
Rectangle R1= new Rectangle(350, 200, 100, 200);

R1.setStroke(Color.ORANGE);
Translate t1= new Translate(200, 0);


primaryStage.setTitle("Hello World");
Scene S=new Scene(root, 800, 800);
S.setFill(Color.PINK);
primaryStage.setScene(S);
primaryStage.show();
}

public static void main(String[] args) {
launch(args);
}
}
ROTATE:
package sample;

import javafx.animation.*;
import
import javafx.fxml.FXMLLoader;
import javafx.scene.Group;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import
import
import javafx.stage.Stage;
import javafx.scene.shape.Rectangle;
import javafx.util.Duration;
import javax.swing.*;
import java.awt.*;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Group root = new Group();
Rectangle R1= new Rectangle(350, 200, 100, 200);

R1.setStroke(Color.ORANGE);
Rotate t1= new Rotate(30, 400, 400);


primaryStage.setTitle("Hello World");
Scene S=new Scene(root, 800, 800);
S.setFill(Color.PINK);
primaryStage.setScene(S);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}

dhinakaranupala
welcome to shbcf.ru