您现在的位置是:主页 > news > 国内做进口的电商网站/最新的域名网站

国内做进口的电商网站/最新的域名网站

admin2025/5/2 10:06:48news

简介国内做进口的电商网站,最新的域名网站,wordpress调用文章列表,网站设置二级域名好吗JavaFX 提供了多种形状类,用于绘制文本、直线、圆、矩形、椭圆、孤、多边形以及折线。 Shape 类是一个抽象基类,定义了所有形状的共同属性。这些属性有fill、stroke,strokeWidth。 fill 属性指定一个填充形状内部区域的颜色。 Stroke 属性指定用于绘制形…

国内做进口的电商网站,最新的域名网站,wordpress调用文章列表,网站设置二级域名好吗JavaFX 提供了多种形状类,用于绘制文本、直线、圆、矩形、椭圆、孤、多边形以及折线。 Shape 类是一个抽象基类,定义了所有形状的共同属性。这些属性有fill、stroke,strokeWidth。 fill 属性指定一个填充形状内部区域的颜色。 Stroke 属性指定用于绘制形…

JavaFX 提供了多种形状类,用于绘制文本、直线、圆、矩形、椭圆、孤、多边形以及折线。

Shape 类是一个抽象基类,定义了所有形状的共同属性。这些属性有fill、stroke,strokeWidth。

fill 属性指定一个填充形状内部区域的颜色。

Stroke 属性指定用于绘制形状边缘的颜色。

strokeWidth 属性指定形状边缘的宽度。

Shape的子类:

 

1、Text

    Pane pane = new Pane();Text text1 = new Text(20,20,"Java is interesting");text1.setFont(Font.font("Courier",FontWeight.BOLD,FontPosture.ITALIC,15));text1.setFill(Color.RED);text1.setUnderline(true);       // underlinetext1.setStrikethrough(true);   // strikethroughpane.getChildren().add(text1);Scene scene1 = new Scene(pane, 500, 500);   // create a scene   primaryStage.setTitle("ShowBorderdPane");primaryStage.setScene(scene1);     // place the scene in the stageprimaryStage.show();

 

2、Line

1条直线通过4 个参数(startX、startY、endX 以及endY) 连接两个点.

    //lineLine line1 = new Line(70,70,120,120);   Line line2 = new Line(70,120,120,70);  // line1.endXProperty().bind(pane.widthProperty().divide(2));// line1.endYProperty().bind(pane.heightProperty().divide(2));    line1.setStrokeWidth(5);line2.setStrokeWidth(5);line1.setStroke(Color.MEDIUMAQUAMARINE);line2.setStroke(Color.MEDIUMAQUAMARINE);pane.getChildren().addAll(line1,line2);

 

3、Rectangle

— 个矩形通过参数x、y、width、height、arcWidth 以及arcHeight 定义。矩形的左上角点处于(x,y), 参数aw(arcWidth) 表示圆角处弧的水平直径,ah(arcHeight)表示圆角处弧的垂直直径。

    Rectangle r1 = new Rectangle(10,130,40,50);r1.setStroke(Color.TAN);r1.setFill(Color.WHITE);           // r1.setFill(null);pane.getChildren().add(r1);

 

4、Circle   Ellipse

    Circle circle = new Circle(90,160,15);Ellipse ellipse = new Ellipse(160,160,20,10);

 

还有一些子类,例如Arc 一段弧,Polygon 多边形,Polyline 不会自动闭合的多点连线。

总程序如下:

public class MyJavaFX extends Application {@Override // Override the start method in the Application classpublic void start(Stage primaryStage) {     //set a primary stagePane pane = new Pane();// textText text1 = new Text(50,50,"Java is interesting");text1.setFont(Font.font("Courier",FontWeight.BOLD,FontPosture.ITALIC,15));text1.setFill(Color.RED);text1.setUnderline(true);       // underlinetext1.setStrikethrough(true);   // strikethrough//lineLine line1 = new Line(70,70,120,120);   Line line2 = new Line(70,120,120,70);  // line1.endXProperty().bind(pane.widthProperty().divide(2));// line1.endYProperty().bind(pane.heightProperty().divide(2));    line1.setStrokeWidth(5);line2.setStrokeWidth(5);line1.setStroke(Color.MEDIUMAQUAMARINE);line2.setStroke(Color.MEDIUMAQUAMARINE);// rectangleRectangle r1 = new Rectangle(10,130,40,50);r1.setStroke(Color.TAN);r1.setFill(Color.WHITE);           // r1.setFill(null);// circleCircle circle = new Circle(90,160,15);Ellipse ellipse = new Ellipse(160,160,20,10);pane.getChildren().addAll(text1,line1,line2,r1,circle,ellipse);Scene scene1 = new Scene(pane, 500, 500);   // create a scene   primaryStage.setTitle("ShowBorderdPane");primaryStage.setScene(scene1);     // place the scene in the stageprimaryStage.show();}
}

转载于:https://www.cnblogs.com/l20902/p/10610914.html