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

网站开发还是软件开发如何设计网站制作方案

网站开发还是软件开发,如何设计网站制作方案,物联网平台是什么意思,视频拍摄合同springboot整合javafx时候#xff0c;很多问题就在于controller没有被spring容器管理#xff0c;无法注入bean#xff0c;在这里提供一套自己的解决思路 执行逻辑 这里仅仅提供一个演示#xff0c;我点击按钮之后#xff0c;从service层返回一个文本并显示 项目结构 创…springboot整合javafx时候很多问题就在于controller没有被spring容器管理无法注入bean在这里提供一套自己的解决思路 执行逻辑 这里仅仅提供一个演示我点击按钮之后从service层返回一个文本并显示 项目结构 创建一个springboot项目 关键代码 springboot启动类中 FXApplication启动类中 全部代码 仅作示例自行修改   pom.xml ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersionparentgroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-parent/artifactIdversion3.4.0/versionrelativePath/ !-- lookup parent from repository --/parentgroupIdcom.shkj/groupIdartifactIdvideo-classification/artifactIdversion0.0.1-SNAPSHOT/versionnamevideo-classification/namedescriptionvideo-classification/descriptionurl/licenseslicense//licensesdevelopersdeveloper//developersscmconnection/developerConnection/tag/url//scmpropertiesjava.version17/java.versionjavafx.version21-ea24/javafx.versionmybatis-plus-boot-stater.version3.5.6/mybatis-plus-boot-stater.versionmysql-connector-java.varsion8.0.18/mysql-connector-java.varsiondruid.version1.1.23/druid.version/propertiesdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter/artifactId/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependencydependencygroupIdorg.openjfx/groupIdartifactIdjavafx-base/artifactIdversion${javafx.version}/version/dependencydependencygroupIdorg.openjfx/groupIdartifactIdjavafx-controls/artifactIdversion${javafx.version}/version/dependencydependencygroupIdorg.openjfx/groupIdartifactIdjavafx-fxml/artifactIdversion${javafx.version}/version/dependencydependencygroupIdorg.openjfx/groupIdartifactIdjavafx-media/artifactIdversion${javafx.version}/version/dependencydependencygroupIdmysql/groupIdartifactIdmysql-connector-java/artifactIdversion${mysql-connector-java.varsion}/version/dependencydependencygroupIdcom.baomidou/groupIdartifactIdmybatis-plus-annotation/artifactIdversion${mybatis-plus-boot-stater.version}/version/dependencydependencygroupIdcom.baomidou/groupIdartifactIdmybatis-plus-boot-starter/artifactIdversion${mybatis-plus-boot-stater.version}/version/dependencydependencygroupIdcom.baomidou/groupIdartifactIdmybatis-plus-annotation/artifactIdversion${mybatis-plus-boot-stater.version}/version/dependencydependencygroupIdcom.alibaba/groupIdartifactIddruid/artifactIdversion${druid.version}/version/dependency/dependenciesbuildpluginsplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactId/plugin/plugins/build/project VideoClassificationApplication package com.shkj.videoclassification;import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ConfigurableApplicationContext;SpringBootApplication(scanBasePackages com.shkj.videoclassification) public class VideoClassificationApplication {public static ConfigurableApplicationContext applicationContext;public static void main(String[] args) {applicationContextSpringApplication.run(VideoClassificationApplication.class, args);FXApplication.main(args);}} FXApplication package com.shkj.videoclassification;import com.shkj.videoclassification.controller.HelloController; import com.shkj.videoclassification.service.impl.TestServiceImpl; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.util.Callback; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;import java.io.IOException;/*** author shkj-大地* create 2024-12-13 21:41* description:*/ public class FXApplication extends Application {Overridepublic void start(Stage stage) throws IOException {FXMLLoader fxmlLoader new FXMLLoader(VideoClassificationApplication.class.getResource(/view/hello.fxml));// 注入fxmlLoader.setControllerFactory(VideoClassificationApplication.applicationContext::getBean);Scene scene new Scene(fxmlLoader.load());stage.setTitle(Hello!);stage.setScene(scene);stage.show();}public static void main(String[] args) {launch(args);}}application.yaml 这里也就是你自己平时用的连接数据库的配置还想看我的hello.fxml 一个简单的页面 ?xml version1.0 encodingUTF-8??import javafx.scene.control.Button? ?import javafx.scene.control.Label? ?import javafx.scene.layout.AnchorPane?AnchorPane prefHeight400.0 prefWidth600.0 xmlnshttp://javafx.com/javafx/23.0.1xmlns:fxhttp://javafx.com/fxml/1fx:controllercom.shkj.videoclassification.controller.HelloControllerchildrenButton onAction#onButtonClick layoutX210.0 layoutY272.0 mnemonicParsingfalseprefHeight63.0 prefWidth181.0 textButton /Label fx:idtextLabel layoutX181.0 layoutY83.0 prefHeight95.0 prefWidth239.0 textLabel //children /AnchorPane HelloController package com.shkj.videoclassification.controller;import com.shkj.videoclassification.service.TestService; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.control.Label; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component;/*** author shkj-大地* create 2024-12-13 21:36* description:*/ Component public class HelloController {Autowiredprivate TestService testService;FXMLpublic Label textLabel;FXMLpublic void onButtonClick(ActionEvent actionEvent) {String test testService.test();textLabel.setText(Hello World!test);} } TestServiceImpl package com.shkj.videoclassification.service.impl;import com.shkj.videoclassification.service.TestService; import org.springframework.stereotype.Service;/*** author shkj-大地* create 2024-12-13 21:45* description:*/ Service public class TestServiceImpl implements TestService {Overridepublic String test() {//你自己去写数据库查询语句吧//到这里了还用我教你return 我是service测试信息;} } TestService package com.shkj.videoclassification.service;/*** author shkj-大地* create 2024-12-13 21:44* description:*/ public interface TestService {String test(); }
http://www.w-s-a.com/news/869622/

相关文章:

  • 企业网站公众号广东网站建设方便
  • 2008r2网站建设张店网站建设方案
  • 企业网站首页学生做的网站成品
  • 网站开发 架构设计企业信息管理系统的组成不包括
  • 网站维护模式网页传奇游戏平台排行
  • 企业网站改自适应蛋糕方案网站建设
  • 网站开发技术职责网站升级中html
  • 天网网站建设百度权重高的网站
  • 明年做哪些网站致富网站站长 感受
  • 东莞营销网站建设优化怎么做微信网站推广
  • 网站建设一个多少钱php网站服务器怎么来
  • 引流用的电影网站怎么做2012服务器如何做网站
  • 什么网站可以做推广广州安全信息教育平台
  • 网站开发具备的相关知识wordpress简约文字主题
  • asp网站伪静态文件下载seo外包公司哪家好
  • 淘宝客网站根目录怎么建个废品网站
  • 网站备案更改需要多久百度免费网站空间
  • 外发加工是否有专门的网站wordpress主页 摘要
  • 企业网站优化系统浙江建设信息港证书查询
  • 很多年前的51网站如何做跨境电商需要哪些条件
  • 网站建设中 请稍后访问互联网营销设计
  • 软文网站名称用户浏览网站的方式
  • 大兴模版网站搭建哪家好网站建设与管理管理课程
  • 四川成都网站制作微信广告平台推广
  • 网站价格网页制作网站开发实训步骤
  • cms 导航网站鹤壁做网站价格
  • 微信营销软件免费版郑州关键词优化费用
  • 邢台专业做网站哪家好临沂网站建设中企动力
  • 建设网站是主营成本吗wordpress 后台
  • 猎头可以做单的网站企业网站建设