当前位置: 首页 > news >正文

wordpress整站无刷新google广告投放技巧

wordpress整站无刷新,google广告投放技巧,大学生网站建设,网站构建工具java-快速将普通main类变为javafx类,并加载自定义fxml 前提步骤1. 普通类继承Application2. 实现main方法3. 写一个controller4. 写一个fxml文件5. 写start方法加载fxml6. 具体代码7. 运行即可 前提 使用自带javafx的jdk,这里使用的是jdk1.834&#xff…

java-快速将普通main类变为javafx类,并加载自定义fxml

    • 前提
    • 步骤
      • 1. 普通类继承Application
      • 2. 实现main方法
      • 3. 写一个controller
      • 4. 写一个fxml文件
      • 5. 写start方法加载fxml
      • 6. 具体代码
      • 7. 运行即可

前提

使用自带javafx的jdk,这里使用的是jdk1.834,当然你可以使用其他的可行版本。

步骤

1. 普通类继承Application

public class server extends Application {

2. 实现main方法

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

3. 写一个controller

普通类实现implements Initializable即可

import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;import java.net.URL;
import java.util.ResourceBundle;public class controller implements Initializable {@FXMLprivate TextArea allStatus;@FXMLprivate TextArea pkRecord;@FXMLprivate Label mount;@FXMLprivate Label monitorStatus;@Overridepublic void initialize(URL location, ResourceBundle resources) {System.out.println(2222);}
}

4. 写一个fxml文件

将fxml文件放在项目的resources目录下,后面好引用。另外,重要的是在GridPane节点上增加和controller类的关系,使用fx:controller=“controller”

<?xml version="1.0" encoding="UTF-8"?><?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?><GridPane fx:controller="controller" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"><columnConstraints><ColumnConstraints hgrow="SOMETIMES" maxWidth="302.0" minWidth="10.0" prefWidth="158.0" /><ColumnConstraints hgrow="SOMETIMES" maxWidth="324.0" minWidth="10.0" prefWidth="285.0" /><ColumnConstraints hgrow="SOMETIMES" maxWidth="140.0" minWidth="10.0" prefWidth="140.0" /></columnConstraints><rowConstraints><RowConstraints maxHeight="128.0" minHeight="4.0" prefHeight="4.0" vgrow="SOMETIMES" /><RowConstraints maxHeight="303.0" minHeight="10.0" prefHeight="303.0" vgrow="SOMETIMES" /><RowConstraints maxHeight="124.0" minHeight="10.0" prefHeight="41.0" vgrow="SOMETIMES" /></rowConstraints><children><TextArea fx:id="allStatus" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1"><GridPane.margin><Insets right="10.0" /></GridPane.margin></TextArea><TextArea fx:id="pkRecord" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1"><GridPane.margin><Insets left="10.0" right="10.0" /></GridPane.margin></TextArea><VBox alignment="TOP_CENTER" prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="2" GridPane.rowIndex="1"><children><Label fx:id="mount" prefHeight="36.0" prefWidth="140.0" text="Label"><opaqueInsets><Insets /></opaqueInsets><VBox.margin><Insets bottom="20.0" /></VBox.margin></Label><Label fx:id="monitorStatus" prefHeight="39.0" prefWidth="140.0" text="Label" /></children></VBox></children>
</GridPane>

5. 写start方法加载fxml

  @Overridepublic void start(Stage primaryStage) throws IOException {Parent root = FXMLLoader.load(getClass().getResource("/monitor.fxml"));primaryStage.setTitle("KeDD");primaryStage.setResizable(false);primaryStage.setScene(new Scene(root, 800, 500));primaryStage.show();}

6. 具体代码

import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.Unpooled;
import io.netty.channel.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.LineBasedFrameDecoder;
import io.netty.handler.codec.string.StringDecoder;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import org.omg.CORBA.portable.ApplicationException;
import java.io.IOException;public class server extends Application {public static void main(String[] args) {launch();}@Overridepublic void start(Stage primaryStage) throws IOException {Parent root = FXMLLoader.load(getClass().getResource("/monitor.fxml"));primaryStage.setTitle("KeDD");primaryStage.setResizable(false);primaryStage.setScene(new Scene(root, 800, 500));primaryStage.show();}
}

7. 运行即可

运行后会弹出窗口,然后打印出上面的2222

http://www.ds6.com.cn/news/30163.html

相关文章:

  • 纺织品公司网站建设南宁百度推广代理公司
  • 如何做seo和网站口碑营销策略
  • 郑州做网站推广电交换友链
  • 济南网站优化推广方案优化设计全部答案
  • 企石仿做网站优化教程网
  • 科技展厅设计方案谷歌seo什么意思
  • 松江泗泾网站建设北京seo地址
  • wordpress全局透明主题太原seo排名公司
  • 鹤壁建设网站推广哪家靠谱如何做好seo优化
  • 做网站常用的插件百度入口官网
  • 网站建设标准流程短视频seo排名系统
  • 网站开发费用是研发费用免费广告投放网站
  • 网站写动态新闻有什么好处湖南网站seo
  • 上海微信网站设计制作友情链接系统
  • wordpress 商品站关键词网站排名查询
  • 有没有教做韩餐的网站网站快速排名优化报价
  • 网站建设宝安饥饿营销案例
  • 连州网站建设国外免费源码共享网站
  • 邢台网站优化有创意的营销策划案例
  • 手机网站专业代做万网域名查询官网
  • 网站的基本价格药品网络营销公司
  • 做任务 网站百度网盘网页
  • wordpress给帖子打分seo关键词快速获得排名
  • 网站建设开发案例手机端网站排名
  • 淄博做网站跟优化seo营销网站
  • 购物网站开发计划书优化师是做什么的
  • 网站建立的说说seo论坛
  • 开发wap网站 转郑州网络推广效果
  • 网站开发的技术可行性怎么写武汉seo
  • 网站建设的意思软件开发培训