浅学JAVAFX布局

news2024/9/25 1:20:32

JAVAFX

FlowPane布局

Flowpane是一个容器。它在一行上排列连续的子组件,并且如果当前行填充满了以后,则自动将子组件向下推到一行

public class FlowPanedemo extends Application {

    @Override

    public void start(Stage stage) throws Exception {

        stage.setTitle("FlowPanedemo");

        FlowPane flowPane = new FlowPane();

        //设置控件的垂直水平间距

        flowPane.setHgap(10);

        flowPane.setVgap(10);

        Button button1 = new Button("button1");

        Button button2 = new Button("button2");

        button2.setPrefSize(100,100);

        Text text = new Text();

        text.setText("hello world");

        text.setFill(Color.RED);

        //复选框

        CheckBox checkBox = new CheckBox();

        checkBox.setText("123");

        RadioButton radioButton = new RadioButton();

        radioButton.setText("radiobuttion");

        TextField textField = new TextField();

        textField.setText("111");

        flowPane.getChildren().addAll(button1,button2,text,checkBox,radioButton,textField);

        Scene scene = new Scene(flowPane,500,300);

        stage.setScene(scene);

        stage.show();

    }

    public static void main(String[] args) {

        launch();

    }

}

HBox水平布局

边框样式:

1. border-style边框样式(hidden隐藏、none无边框、dotted电线、dashed虚线、soild实线、double两个边框、groove3D沟槽边框、ridge3D脊边框、inset3D嵌入边框、outset3D突出边框)

缩写:

①border-style: 上 右 下 左;

②border-style: 上 左右 下;

③border-style: 上下 左右;

④border-style: 上下左右;

border-width边框宽度(5px、medium):可以单独设置一边的宽度。

border-top-width上边框、border-bottom-width下边框、border-right-width有边框、border-left-width左边框。

border-color边框颜色: 可以单独设置一边的颜色。

border-top-color、border-bottom-color、border-right-color、border-left-color

缩写:

①border: 5px solid red;

②border-top:5px solid red ;

③border-bottom:5px solid red ;

④border-right:5px solid red ;

⑤border-left:5px solid red ;

轮廓

轮廓样式:轮廓是在边框外面的一层,其用法同边框。

outline-style

outline-color

outline-width

缩写:outline:green dotted thick ;

边距

边距:(百分数、em、px)

margin-top

margin-bottom

margin-right

margin-left

缩写:margin: 上 右 下 左;

填充

填充:(百分数、em、px)

padding-top

padding-bottom

padding-left

padding-right

缩写:padding: 上 右 下 左;

尺寸

尺寸:(百分数、em、px)

包括height、width

height、max-height、min-height

width、max-width、min-width

   //设置控件间的间距

        hbox.setSpacing(10);

//设置内边距

Hbox.setPadding(new Insets(10));

//设置某个组件的边距

Hbos.setMargin(b1,new Insets(10))

//设置水平居中方式

Hbox.setAlignment(Pos.CENTER);

案例

public class HBoxDemo extends Application {


    @Override

    public void start(Stage stage) throws Exception {

        stage.setTitle("HBoxDemo");

        Group group = new Group();

            //创建水平布局

        HBox hbox = new HBox();

        //配置背后颜色

        hbox.setStyle("-fx-background-color: #336699;");

        hbox.setMinWidth(300);

        hbox.setMinHeight(50);

        group.getChildren().add(hbox);

        //设置控件间的间距

        hbox.setSpacing(10);

        Button button = new Button();

        button.setText("确定");

        Text text = new Text();

        text.setText("hello");

        text.setFont(Font.font("宋体",30));

        //Insets:设置偏移量 上右下左

        hbox.setMargin(button,new Insets(10,0,0,0));

        hbox.setMargin(text,new Insets(10,0,0,0));

        hbox.getChildren().addAll(button,text);

        Scene scene = new Scene(group,500,400);

        stage.setScene(scene);

        stage.show();

    }

    public static void main(String[] args) {

        launch();

    }

}

VBox垂直布局

Rectangle矩形、Label标签、TextArea文本域(输入框)、Alignment对齐

public void start(Stage stage) throws Exception {

        stage.setTitle("VBoxdemo");

        Group group = new Group();

        TextArea mytestArea =new TextArea();

        HBox hbox = new HBox(50);

        hbox.setMinWidth(600);

        hbox.setMinHeight(100);

        hbox.setStyle("-fx-background-color: #336699;");

        VBox vbox = new VBox(50);

        vbox.setMinWidth(100);

        vbox.setMinHeight(400);

        vbox.setStyle("-fx-background-color: #330000;");

        Rectangle r1 = new Rectangle(200,200);

        r1.setY(300);

        r1.setX(300);

        Label lbl =new Label("VBox");

        group.getChildren().addAll(hbox,vbox,r1);

        Scene scene =new Scene(group,600,500, Color.rgb(0,0,0,0));

        stage.setScene(scene);

        stage.show();

    }


public void start(Stage primaryStage) {

        TextArea myTextArea = new TextArea();

        VBox vbox = new VBox();

        vbox.getChildren().add(myTextArea);

        //设置以后跟随外边框增长

        VBox.setVgrow(myTextArea, Priority.ALWAYS);

       

        Scene scene = new Scene(hbox, 320, 112, Color.rgb(0, 0, 0, 0));

        primaryStage.setScene(scene);

        primaryStage.show();

    }

Bordderpane边框窗格

JavaFX BorderPane布局、HyperLink超级链接、Hyper超级、Insets插入、

BorderPane布局顶部,底部,左,右或中心区域中的子节点。每个区域只能有一个节点。BorderPane的顶部和底部区域允许可调整大小的节点占用所有可用宽度。 左边界区域和右边界区域占据顶部和底部边界之间的可用垂直空间。默认情况下,所有边界区域尊重子节点的首选宽度和高度。放置在顶部,底部,左侧,右侧和中心区域中的节点的默认对齐方式如下:

顶部: Pos.TOP_LEFT

底部: Pos.BOTTOM_LEFT

左侧: Pos.TOP_LEFT

右侧: Pos.TOP_RIGHT

中心: Pos.CENTER

案例:

public void start(Stage stage) throws Exception {

        stage.setTitle("borderpane测试");

        Image image = new Image(new FileInputStream("F:\\IDEADemo\\hello\\Snipaste_2022-10-12_20-03-32.jpg"));

        BorderPane borderPane = new BorderPane();

        borderPane.setStyle("-fx-background-color: #330000;");


        HBox top = new HBox();

        top.setMinWidth(30);

        top.setMinHeight(30);

        Text text = new Text("Welcome");

        text.setFont(Font.font("宋体", FontWeight.BOLD,30));

        top.setStyle("-fx-background-color: #336699;");

        //设置top居中

        top.setAlignment(Pos.CENTER);

        top.getChildren().addAll(text);


        VBox letf = new VBox();

        letf.setMinWidth(50);

        letf.setStyle("-fx-background-color: #226699;");

        Button b1 =new Button("改色");

        Button b2 = new Button("改色");

        Button b3 = new Button("改色");

        Button b4 = new Button("改色");

        letf.getChildren().addAll(b1,b2,b3,b4);




        VBox right = new VBox();

        Button r1 =new Button("11");

        Button r2 = new Button("22");

        Button r3 = new Button("33");

        Button r4 = new Button("44");

        right.setStyle("-fx-background-color: #111199;");

        right.setMinWidth(50);

        right.getChildren().addAll(r1,r2,r3,r4);


        HBox Bottom= new HBox();

        Hyperlink hl = new Hyperlink("www.baidu.com");

        Bottom.setMinHeight(30);

        Bottom.setStyle("-fx-background-color: #113339;");

        Button close = new Button("关闭系统");

        close.setOnAction((e)->{

            Platform.exit();

        });

        Bottom.getChildren().addAll(close,hl);

        Bottom.setAlignment(Pos.CENTER);


       GridPane Center = new GridPane();

       Center.setMinWidth(350);



        borderPane.setTop(top);

        borderPane.setLeft(letf);

       // borderPane.setRight(right);

        borderPane.setBottom(Bottom);

        borderPane.setCenter(Center);


        b1.setOnAction((e)->{

            Center.setStyle("-fx-background-color: #113339;");

        });

        b2.setOnAction((e)->{

            Center.setStyle("-fx-background-color: #222239;");

        });

        b3.setOnAction((e)->{

            Center.setStyle("-fx-background-color: #333339;");

        });

        b4.setOnAction((e)->{

            Center.setStyle("-fx-background-color: #444439;");

        });

        //获取鼠标移动坐标

        Center.addEventFilter(MouseEvent.MOUSE_MOVED, e->{

            String xy="鼠标坐标为:"+e.getX()+","+e.getY();

            text.setText(xy);

            text.setLayoutX(e.getX()+70);

            text.setLayoutY(e.getY()+70);

        });



        Scene scene =new Scene(borderPane,400,300);

        stage.getIcons().add(image);

        stage.setScene(scene);

        stage.show();

    }

GirdPane布局

Gird网格、pane窗格、Lines线、Visible可见的、ColumnConstraints列约束、priority优先事项、always总是、column列、

网格布局

GridPane通常用于布局:表单布局

GridPane可以在行,列或单元格级别指定约束。
例如,我们可以设置包含输入文本字段的第二列,以在窗口调整大小时调整大小。

使用Java FX创建表格的时候,这个布局非常方便。

包javafx.scene.layout名为GridPane这个类提供了 11 个属性,它们是 -

  • alignment- 此属性可以设置位置,使用方式setAlignment()方法设置此属性的值。

放置在顶部,底部,左侧,右侧和中心区域中的节点的默认对齐方式如下:

      • 顶部: Pos.TOP_LEFT
      • 底部: Pos.BOTTOM_LEFT
      • 左侧: Pos.TOP_LEFT
      • 右侧: Pos.TOP_RIGHT
      • 中心: Pos.CENTER
  • hgap- 此属性的类型为double,表示列之间的水平差距。
  • vgap- 属性的类型为double,它表示行之间的垂直间距。
  • gridLinesVisible- 此属性是布尔类型,显示表格线

案例一:

public class GridPanedemo extends Application {

    @Override

    public void start(Stage stage) throws Exception {

        stage.setTitle("gridpane测试");

        BorderPane borderpane = new BorderPane();

        GridPane gridPane = new GridPane();

        gridPane.setStyle("-fx-background-color: #C0C0C0;");


        //表格实线

        gridPane.setGridLinesVisible(true);

        gridPane.setPadding(new Insets(5));

        //水平间距

        gridPane.setHgap(5);

        //垂直间距

        gridPane.setVgap(50);


        //3列

        ColumnConstraints column1 = new ColumnConstraints(100);

        ColumnConstraints column2 = new ColumnConstraints(50, 150, 300);

        ColumnConstraints column3 = new ColumnConstraints(100);


        column2.setHgrow(Priority.ALWAYS);

        gridPane.getColumnConstraints().addAll(column1, column2,column3);


        Label userNameLabel = new Label("用户名");

        TextField userNameField = new TextField();

        Label passwordLabel = new Label("密码");

        PasswordField passwordField =new PasswordField();


        Text userNameWarn = new Text("用户名不能为空");

        Text passwordWarn = new Text("密码不能空");


        Button saveButt = new Button("保存");


        // userNameLabel  列 行

        GridPane.setHalignment(userNameLabel, HPos.RIGHT);

        gridPane.add(userNameLabel, 0, 0);

        gridPane.add(userNameWarn,3,0);

        gridPane.add(passwordWarn,3,1);



        // userNameField

        GridPane.setHalignment(userNameField, HPos.RIGHT);

        gridPane.add(userNameField, 1, 0);


        // passwordLabel

        GridPane.setHalignment(passwordLabel, HPos.LEFT);

        gridPane.add(passwordLabel, 0, 1);


        // passwordField

        GridPane.setHalignment(passwordField, HPos.LEFT);

        gridPane.add(passwordField, 1, 1);


        // Save button

        GridPane.setHalignment(saveButt, HPos.RIGHT);

        gridPane.add(saveButt, 1, 2);


        borderpane.setCenter(gridPane);

        Scene scene =new Scene(borderpane,600,500);

        stage.setScene(scene);

        stage.show();

    }


    public static void main(String[] args) {

        launch();

    }

}

案例二、

public void start(Stage stage) throws Exception {

        //舞台名称

        stage.setTitle("JavaFX Welcome");

        FileInputStream fileInputStream =new FileInputStream("F:\\IDEADemo\\hello\\Snipaste_2022-10-12_20-03-32.jpg");

        Image image =new Image(fileInputStream);

        stage.getIcons().add(image);

        GridPane grid = new GridPane();


        //grid.setBackground(new Background(new Image(fileinputStream)));

        //GridPane内容居中

        grid.setAlignment(Pos.CENTER);

        //水平间距

        grid.setHgap(10);

        //垂直间距

        grid.setVgap(10);

        //填充:距离上下左右外框

        grid.setPadding(new Insets(25, 25, 25, 25));

       // grid.setGridLinesVisible(true);

        Text scenetitle = new Text("欢迎");

        scenetitle.setFont(Font.font("宋体", FontWeight.NORMAL, 20));

        //、0列、0行、占用2列、占用1行

        grid.add(scenetitle, 0, 0, 2, 1);


        Label userName = new Label("账号:");

        grid.add(userName, 0, 1);


        TextField userTextField = new TextField();

        grid.add(userTextField, 1, 1);


        Label pw = new Label("密码:");

        grid.add(pw, 0, 2);


        PasswordField pwBox = new PasswordField();

        grid.add(pwBox, 1, 2);


        Button btn = new Button("登入");

        //登录按钮放到水平布局HBox中方便控制左右

        HBox hbBtn = new HBox(10);

        hbBtn.setAlignment(Pos.BOTTOM_RIGHT);

        hbBtn.getChildren().add(btn);

        grid.add(hbBtn, 1, 4);


        final Text actiontarget = new Text();

        grid.add(actiontarget, 1, 6);


        btn.setOnAction(new EventHandler<ActionEvent>() {


            @Override

            public void handle(ActionEvent e) {

                actiontarget.setFill(Color.FIREBRICK);

                actiontarget.setText("按下登录按钮");

            }

        });

        Scene scene = new Scene(grid, 300, 275);

        stage.setScene(scene);

        stage.show();

    }

FlowPane布局

public void start(Stage stage) throws Exception {

     stage.setTitle("FlowPaneDemo");

     Button button1 =new Button("button1");

     Button button2 =new Button("button1");

     Button button3 =new Button("button1");

     Button button4 =new Button("button1");

     Button button5 =new Button("button1");

     Button button6 =new Button("button1");

    

     FlowPane flow = new FlowPane();

     flow.setStyle("-fx-background-color:#f6d3ab");

     flow.setPadding(new Insets(10));

     //组件的水平间距

     flow.setHgap(10);

   flow.getChildren().addAll(button1,button2,button3,button4,button5,button6);

     Scene scene =new Scene(flow,300,400);

     stage.setScene(scene);

     stage.show();

   }

Titlepane布局 可折叠组件

Content内容、

public void start(Stage stage) throws Exception {

        HBox h1 = new HBox();

        CheckBox c1 =new CheckBox("ok");

        CheckBox c2 = new CheckBox("on");

        h1.getChildren().addAll(c1,c2);

        TitledPane titledPane = new TitledPane("标题", h1);

        //titledPane.setAlignment(Pos.BASELINE_CENTER);

        //

        GridPane grid = new GridPane();

        grid.setVgap(4);

        grid.setPadding(new Insets(5,5,5,5));

        grid.add(new Button("按钮1"),0,0);

        grid.add(new Button("按钮2"),1,0);

        grid.add(new Button("按钮3"),0,1);

        grid.add(new Button("按钮4"),1,1);

        TitledPane titledPane1 =new TitledPane("按钮",grid);

        HBox hbox = new HBox(10);

        hbox.setPadding(new Insets(20, 0, 0, 20));

        hbox.getChildren().setAll(titledPane,titledPane1);

        hbox.setAlignment(Pos.BASELINE_CENTER);

        Scene scene = new Scene(hbox, 350, 250);

        stage.setScene(scene);

        stage.show();

}

titledPane1.setGraphic(new Button("text"));

Accordion布局 手风琴布局

可以使用手风琴(accordion)控件对标题窗格进行分组。

public void start(Stage stage) throws Exception {

     Group g = new Group();

        TitledPane t1 = new TitledPane("T1", new Button("B1"));

        TitledPane t2 = new TitledPane("T2", new Button("B2"));

        TitledPane t3 = new TitledPane("T3", new Button("B3"));

        t3.setText("T3");

        t3.setContent(new Button("B3"));

        Accordion accordion = new Accordion();

        accordion.getPanes().addAll(t1, t2, t3);

        g.getChildren().add(accordion);

        //accordion事件

        accordion.expandedPaneProperty()

                .addListener((ObservableValue<? extends TitledPane> ov, TitledPane old_val, TitledPane new_val) -> {

                    if (new_val != null) {

                        System.out.println(accordion.getExpandedPane().getText());

                    }

                });


        Scene scene = new Scene(g, 550, 250);

        stage.setScene(scene);

        stage.show();


   }

AnchorPane布局(锚定)

锚定布局一般配合其他布局使用

public void start(Stage stage) throws Exception {

        stage.setTitle("hello AnchorPane");

        HBox hbox =new HBox();

        Button b1 =new Button("hello");

        Button b2 = new Button("World");

        hbox.getChildren().addAll(b1,b2);


        AnchorPane acpane = new AnchorPane();

        acpane.getChildren().addAll(hbox);


        //距离顶部50,距离左边10

        AnchorPane.setTopAnchor(hbox,50.0);

        AnchorPane.setLeftAnchor(hbox,10.0);

//        AnchorPane.setBottomAnchor();

//        AnchorPane.setRightAnchor();


        Scene scene = new Scene(acpane,500,400);

        stage.setScene(scene);

        stage.show();

    }


stage.setTitle("AbchorDemo");

     Button b1 =new Button("b1");

     Button b2 =new Button("b2");

    

     //锚点布局

     AnchorPane anchorPane =new AnchorPane();

     anchorPane.setStyle("-fx-background-color:#e8f2fe");

     anchorPane.getChildren().addAll(b1,b2);

     //距离Top10.0--可以自动适配屏幕大小

     anchorPane.setTopAnchor(b1, 10.0);

     anchorPane.setLeftAnchor(b1, 10.0);

     anchorPane.setBottomAnchor(b2, 10.0);

     //设置内边距

     anchorPane.setPadding(new Insets(10));

     //false解除父类对b1的管理

     //b1.setManaged(false);

     //false不可见

     //b1.setVisible(false);

     //设置透明度

     b1.setOpacity(0.1);

     anchorPane.setOnMouseClicked(new EventHandler<MouseEvent>() {

    

        @Override

        public void handle(MouseEvent event) {

           System.out.println("被点击了");

          

        }

     });

     Scene scene =new Scene(anchorPane,300,400);

     stage.setScene(scene);

     stage.show();

TextFlow布局类

public void start(Stage stage) throws Exception {

     stage.setTitle("TextFlowDemo");

     Text t1 =new Text("t1");

     Text t2 =new Text("t2freagrthbagragargaefacw");

     Text t3 =new Text("t3");

     t1.setFont(Font.font(20));

     t1.setFill(Paint.valueOf("#f8f8f8"));

    

     TextFlow textFlow =new TextFlow();

     textFlow.setStyle("-fx-background-color:#e1e6f6");

     textFlow.getChildren().addAll(t1,t2,t3);

     //边距

     textFlow.setPadding(new Insets(10));

     Scene scene =new Scene(textFlow,300,400);

     stage.setScene(scene);

     stage.show();

     stage.widthProperty().addListener(new ChangeListener<Number>() {

        @Override

        public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {

           System.out.println(textFlow.getWidth());

        }

     });

    

   }

TilePane布局

public void start(Stage stage) throws Exception {

     stage.setTitle("TilePaneDemo");

     Button button1 =new Button("button1");

     Button button2 =new Button("button1");

     Button button3 =new Button("button1");

     Button button4 =new Button("button1");

     Button button5 =new Button("button1");

     Button button6 =new Button("button1");

    

     TilePane tile =new TilePane();

     tile.setStyle("-fx-background-color:#e1e6f6");

     tile.setMargin(button1, new Insets(10));

     tile.setHgap(10);

     //tile.setPadding(new Insets(10));

     tile.setAlignment(Pos.BASELINE_CENTER);

   tile.getChildren().addAll(button1,button2,button3,button4,button5,button6);

    

    

     Scene scene =new Scene(tile,300,400);

     stage.setScene(scene);

     stage.show();

   }

DialogPane布局

@Override

   public void start(Stage stage) throws Exception {

     stage.setTitle("DialogPaneDemo");

     BorderPane bP =new BorderPane();

     TextArea textArea =new TextArea();

     Button button =new Button("帮助");

     bP.setCenter(textArea);

     bP.setTop(button);

    

     button.setOnAction((e)->{

        DialogPane daPe =new DialogPane();

        Stage s =new Stage();

        s.setTitle("帮助");

        daPe.setHeaderText("hello javafx");

        daPe.setContentText("the is text");

       

        daPe.getButtonTypes().add(ButtonType.APPLY);

        daPe.getButtonTypes().add(ButtonType.CANCEL);

        daPe.getButtonTypes().add(ButtonType.CLOSE);

       

        Button apply =(Button) daPe.lookupButton(ButtonType.APPLY);

        Button close =(Button) daPe.lookupButton(ButtonType.CLOSE);

       

        ImageView imgImageView =new ImageView("Img/Snipaste_2022-10-17_17-14-25.jpg");

        daPe.setGraphic(imgImageView);

        //设置扩展内容

        daPe.setExpandableContent(new Text("扩展内容"));

        daPe.setExpanded(true);//默认打开

        Scene sc =new Scene(daPe,400,200);

        s.setScene(sc);

        //模态化对话框

        s.initOwner(stage);

        s.initModality(Modality.WINDOW_MODAL);

        s.show();

       

        apply.setOnAction(new EventHandler<ActionEvent>() {

          

           @Override

           public void handle(ActionEvent event) {

             System.out.println("apply");

           }

        });

        close.setOnAction(new EventHandler<ActionEvent>() {


           @Override

           public void handle(ActionEvent event) {

             System.out.println("close");

           }

        });

       

     });

    

     Scene scene =new Scene(bP,300,400);

     stage.setScene(scene);

     stage.show();

   }

TabPane和Tab切换面板组件


 

public void start(Stage stage) throws Exception {

     stage.setTitle("TabPaneDemo");

     AnchorPane an =new AnchorPane();

     TabPane tabPane =new TabPane();

     tabPane.setStyle("-fx-background-color: #336699");

     tabPane.setPrefWidth(300);

     tabPane.setPrefHeight(300);

     Tab tab1 =new Tab("tab1");

     Tab tab2 =new Tab("tab2");

     Tab tab3 =new Tab("tab3");

    

     VBox vBox =new VBox(10);

     vBox.setStyle("-fx-background-color: #f7f9ff");

     vBox.getChildren().addAll(new Button("button1"),new Button("button2"));

     tab1.setContent(vBox);

     HBox hBox =new HBox(10);

     hBox.setStyle("-fx-background-color: #f77a49");

     hBox.getChildren().addAll(new Button("button1"),new TextField("text"));

     tab2.setContent(hBox);

    

     tabPane.getTabs().addAll(tab1,tab2,tab3);

     an.getChildren().add(tabPane);

    

     Scene scene =new Scene(an);

     stage.setScene(scene);

     stage.setWidth(600);

     stage.setHeight(400);

     stage.show();

   }

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1408793.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

C++入门篇章1(C++是如何解决C语言不能解决的问题的)

目录 1.C关键字(以C98为例)2.命名空间2.1 命名空间定义2.2命名空间使用 3.C输入&输出4.缺省参数4.1缺省参数概念4.2 缺省参数分类 5. 函数重载5.1函数重载概念5.2 C支持函数重载的原理--名字修饰(name Mangling) 1.C关键字(以C98为例) C总计63个关键字&#xff0c;C语言32…

go api(get post传参,数据库,redis) 测试

介绍&#xff1a;分别测试get请求&#xff0c;post请求&#xff0c;请求链接数据库&#xff0c;以及redis操作。 1.api代码 package mainimport (_ "database/sql""encoding/json""github.com/gin-gonic/gin""go-test/com.zs/database&quo…

【RT-DETR有效改进】交叉形窗口网络 | CSWinTransformer(附代码 + 修改教程)

前言 大家好&#xff0c;我是Snu77&#xff0c;这里是RT-DETR有效涨点专栏。 本专栏的内容为根据ultralytics版本的RT-DETR进行改进&#xff0c;内容持续更新&#xff0c;每周更新文章数量3-10篇。 专栏以ResNet18、ResNet50为基础修改版本&#xff0c;同时修改内容也支持Re…

【GitHub项目推荐--一款美观的开源社区系统】【转载】

推荐一款开源社区系统&#xff0c;该系统基于主流的 Java Web 技术栈&#xff0c;如果你是一名 Java 新手掌握了基本 JavaEE 框架知识&#xff0c;可以拿本项目作为练手项目。 开源社区系统功能还算完善包含发布帖子、发布评论、私信、系统通知、点赞、关注、搜索、用户设置、…

ToDesk/向日葵的MAC远程鼠标控制不了?如何解决

不知道各位使用Mac电脑的小伙伴们&#xff0c;在日常进行跨设备远控操作时是否曾遇到过远程鼠标控制不了的问题&#xff1f;其实这是因为有项系统权限没有开设导致的&#xff0c;本篇文章木木小编就给大家逐步教学一下针对该问题如何解决才有效&#xff01; 当通过ToDesk远程连…

vue中图片不显示问题 - vue中静态资源加载

文章目录 vue中图片不显示问题静态资源URL 转换规则webpack 静态资源处理 图片不显示问题问题描述解决办法1&#xff1a;使用require引入require is not defined 解决办法2&#xff1a;使用import引入解决办法3&#xff1a;将图片放进公共文件夹static或public vue中图片不显示…

当世界加速离你而去

当世界加速离你而去 会不会这个标题显的太悲观&#xff0c;也可能是耳机里正在放着To Be Frank的原因。 对于阳历跨年我是没有太多的感觉&#xff0c;而且跨年夜忙着约会&#xff0c;所以2023年的跨年文章今天才出来。 一年的时间一晃就过了。2022年12月9日时候彻底结束了风控…

基于EfficientNet(B0-B7)全系列不同参数量级模型开发构建中草药图像识别分析系统,实验量化对比不同模型性能

EfficientNet系列的模型在我们前面开发识别类项目或者是检测类项目都是比较少去使用的&#xff0c;一方面是技术本身迭代发展的速度是比较快的&#xff0c;可能新的东西还没学习更新的东西就出来了&#xff0c;另一方面是EfficientNet本身实际业务使用度并不高&#xff0c;可能…

maptalks 右键删除多边形 电子围栏

<!-- 地图组件 --> <template><div :id"id" class"container"></div> </template><script> import _ from "lodash"; import "maptalks/dist/maptalks.css"; import * as maptalks from "ma…

RDMA vs InfiniBand 网卡接口如何区分?

(该架构图来源于参考文献) 高性能计算网络&#xff0c;RoCE vs. InfiniBand该怎么选&#xff1f; 新 RoCEv2 标准可实现 RDMA 路由在第三层以太网网络中的传输。RoCEv2 规范将用以太网链路层上的 IP 报头和 UDP 报头替代 InfiniBand 网络层。这样&#xff0c;就可以在基于 IP…

虹科分享丨AR与AI融合加速,医疗护理更便捷!

来源&#xff1a;虹科数字化与AR 虹科分享丨AR与AI融合加速&#xff0c;医疗护理更便捷&#xff01; 原文链接&#xff1a;https://mp.weixin.qq.com/s/Fi0wNfk_TDXRo_1-6cSRNQ 欢迎关注虹科&#xff0c;为您提供最新资讯&#xff01; #AR眼镜 #医疗护理 根据Reports and Da…

【动态规划】【map】【C++算法】1289. 下降路径最小和 II

作者推荐 视频算法专题 本文涉及知识点 动态规划汇总 map LeetCode1289. 下降路径最小和 II 给你一个 n x n 整数矩阵 grid &#xff0c;请你返回 非零偏移下降路径 数字和的最小值。 非零偏移下降路径 定义为&#xff1a;从 grid 数组中的每一行选择一个数字&#xff0c;…

云计算项目五:部署数据库服务mysql |部署共享存储服务NFS | 配置网站服务

部署数据库服务mysql |部署共享存储服务NFS | 配置网站服务 案例1:配置逻辑卷步骤一:创建LV步骤二:格式化案例2:配置数据库服务器步骤一:安装软件MySQL服务软件(2台数据库服务器都要安装)步骤二:挂载lv设备步骤三:启动服务步骤四:管理员登录案例3:配置主从同步步骤一…

【自然语言处理】【深度学习】文本向量化、one-hot、word embedding编码

因为文本不能够直接被模型计算&#xff0c;所以需要将其转化为向量 把文本转化为向量有两种方式&#xff1a; 转化为one-hot编码转化为word embedding 一、one-hot 编码 在one-hot编码中&#xff0c;每一个token使用一个长度为N的向量表示&#xff0c;N表示词典的数量。 即&…

谷歌地球引擎Google Earth Engine针对不同地表类型分别自动生成随机采样点的方法

本文介绍在谷歌地球引擎&#xff08;Google Earth Engine&#xff0c;GEE&#xff09;中&#xff0c;按照给定的地表分类数据&#xff0c;对每一种不同的地物类型&#xff0c;分别加以全球范围内随机抽样点自动批量选取的方法。 本文是谷歌地球引擎&#xff08;Google Earth En…

05.Elasticsearch应用(五)

Elasticsearch应用&#xff08;五&#xff09; 1.目标 咱们这一章主要学习Mapping&#xff08;映射&#xff09; 2.介绍 Mapping是对索引库中文档的约束&#xff0c;类似于数据表结构&#xff0c;作用如下&#xff1a; 定义索引中的字段的名称定义字段的数据类型&#xff…

0124-2-算法题解析与总结(四)

5.5 如何去除有序数组的重复元素 本文对应的力扣题目&#xff1a; 26.删除排序数组中的重复项 83.删除排序链表中的重复元素 26.删除排序数组中的重复项&#xff1a; int removeDuplicates(int[] nums) {int n nums.length;if (n 0) return 0;int slow 0, fast 1;while…

Spring基于AbstractRoutingDataSource实现MySQL多数据源

目录 多数据源实现 yml配置文件 配置类 业务代码 案例演示 多数据源实现 yml配置文件 spring:datasource:type: com.alibaba.druid.pool.DruidDataSourcedatasource1:url: jdbc:mysql://127.0.0.1:3306/datasource1?serverTimezoneUTC&useUnicodetrue&characte…

第二百八十六回

文章目录 概念介绍实现方法示例代码 我们在上一章回中介绍了如何拦截路由相关的内容&#xff0c;本章回中将介绍页面转场动画.闲话休提&#xff0c;让我们一起Talk Flutter吧。 概念介绍 我们在上一章回中介绍了路由拦截相关的内容&#xff0c;本章回中将使用路由拦截实现转场…

《动手学深度学习(PyTorch版)》笔记3

注&#xff1a;书中对代码的讲解并不详细&#xff0c;本文对很多细节做了详细注释。另外&#xff0c;本书源代码是在Jupyter Notebook上运行的&#xff0c;较为分散&#xff0c;本文将代码集中起来&#xff0c;并加以完善&#xff0c;全部用vscode测试通过。 Chapter3 Linear …