鱼C论坛

 找回密码
 立即注册
查看: 557|回复: 19

[已解决]jawa scene builder 和 tableview 不会设置控制器

[复制链接]
发表于 2023-7-5 15:43:00 | 显示全部楼层 |阅读模式
60鱼币
本帖最后由 wow7jiao 于 2023-7-7 18:42 编辑

就差一点点,表里不出数据,我不知道怎么设置控制器MainController ,应该是scene里面设置或者样表改,请前辈解决
  1. package application;

  2. import javafx.application.Application;
  3. import javafx.fxml.FXMLLoader;
  4. import javafx.stage.Stage;
  5. import javafx.scene.Scene;
  6. import javafx.scene.layout.Pane;

  7. public class Main extends Application {
  8.     @Override
  9.     public void start(Stage primaryStage) {
  10.         try {
  11.             Pane root = (Pane) FXMLLoader.load(getClass().getResource("Sample.fxml"));
  12.             Scene scene = new Scene(root,400,400);
  13.             scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
  14.             primaryStage.setScene(scene);
  15.             primaryStage.show();
  16.         } catch(Exception e) {
  17.             e.printStackTrace();
  18.         }
  19.     }

  20.     public static void main(String[] args) {
  21.         launch(args);
  22.     }
  23. }
复制代码

  1. package application;

  2. import javafx.fxml.FXML;
  3. import javafx.fxml.Initializable;
  4. import javafx.collections.FXCollections;
  5. import javafx.collections.ObservableList;
  6. import javafx.scene.control.TableColumn;
  7. import javafx.scene.control.TableView;
  8. import javafx.beans.property.*;

  9. import java.net.URL;
  10. import java.util.ResourceBundle;

  11. public class MainController implements Initializable {
  12.     @FXML
  13.     private TableView<Person> table;
  14.     @FXML
  15.     private TableColumn<Person, Integer> ageCol;
  16.     @FXML
  17.     private TableColumn<Person, String> nameCol;

  18.     // 创建并初始化数据
  19.     private final ObservableList<Person> cellData = FXCollections.observableArrayList();

  20.     @Override
  21.     public void initialize(URL url, ResourceBundle rb) {
  22.         cellData.add(new Person(20,"Jack"));
  23.         cellData.add(new Person(18,"Jerry"));
  24.         cellData.add(new Person(21,"Mike"));

  25.         // 配置 TableColumn 列
  26.         ageCol.setCellValueFactory(cellData -> cellData.getValue().getAge().asObject());
  27.         nameCol.setCellValueFactory(cellData -> cellData.getValue().getName());

  28.         // 为 TableView 添加数据
  29.         table.setItems(cellData);
  30.     }

  31.     public class Person {
  32.         private IntegerProperty age;
  33.         private StringProperty name;

  34.         public Person(Integer age, String name) {
  35.             super();
  36.             this.age = new SimpleIntegerProperty(age);
  37.             this.name = new SimpleStringProperty(name);
  38.         }

  39.         public IntegerProperty getAge() {
  40.             return age;
  41.         }

  42.         public void setAge(Integer age) {
  43.             this.age = new SimpleIntegerProperty(age);
  44.         }

  45.         public StringProperty getName() {
  46.             return name;
  47.         }

  48.         public void setName(String name) {
  49.             this.name = new SimpleStringProperty(name);
  50.         }
  51.     }
  52. }
复制代码

  1. <?xml version="1.0" encoding="UTF-8"?>

  2. <?import java.lang.*?>
  3. <?import javafx.scene.control.*?>
  4. <?import javafx.scene.layout.*?>
  5. <?import javafx.scene.layout.BorderPane?>


  6. <BorderPane xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8">
  7.    <center>
  8.       <TableView fx:id="table" prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
  9.         <columns>
  10.           <TableColumn fx:id="ageCol" prefWidth="75.0" text="C1" />
  11.           <TableColumn fx:id="nameCol" prefWidth="75.0" text="C2" />
  12.         </columns>
  13.       </TableView>
  14.    </center>
  15. </BorderPane>
复制代码



最佳答案
2023-7-5 15:43:01
wow7jiao 发表于 2023-7-7 17:25
用了,运行不了,你少写一部分,MainController.java 没有实例化

根据报错信息,错误的原因是找不到"MainController"类。请确保在`Sample.fxml`文件中正确指定了`controller`属性,并且`MainController`类位于`application`包中。

具体来说,你需要在`Sample.fxml`文件中添加一个`fx:controller`属性,指向`MainController`类的完全限定名,例如:

  1. <BorderPane xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" fx:controller="application.MainController">
  2.    ...
  3. </BorderPane>
复制代码


这样,FXML加载器才能正确地将`Sample.fxml`与`MainController`关联起来。

test.zip

7.6 KB, 下载次数: 1

完整附件

test.zip

7.26 KB, 下载次数: 4

可运行

最佳答案

查看完整内容

根据报错信息,错误的原因是找不到"MainController"类。请确保在`Sample.fxml`文件中正确指定了`controller`属性,并且`MainController`类位于`application`包中。 具体来说,你需要在`Sample.fxml`文件中添加一个`fx:controller`属性,指向`MainController`类的完全限定名,例如: 这样,FXML加载器才能正确地将`Sample.fxml`与`MainController`关联起来。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2023-7-5 15:43:01 | 显示全部楼层    本楼为最佳答案   
wow7jiao 发表于 2023-7-7 17:25
用了,运行不了,你少写一部分,MainController.java 没有实例化

根据报错信息,错误的原因是找不到"MainController"类。请确保在`Sample.fxml`文件中正确指定了`controller`属性,并且`MainController`类位于`application`包中。

具体来说,你需要在`Sample.fxml`文件中添加一个`fx:controller`属性,指向`MainController`类的完全限定名,例如:

  1. <BorderPane xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" fx:controller="application.MainController">
  2.    ...
  3. </BorderPane>
复制代码


这样,FXML加载器才能正确地将`Sample.fxml`与`MainController`关联起来。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2023-7-5 15:43:15 | 显示全部楼层
关于JavaFX中的Scene Builder和TableView的控制器设置问题,您可以按照以下步骤进行操作:

1. 首先,打开Scene Builder并加载FXML文件(Sample.fxml)。
2. 在Scene Builder中,选择TableView,并在右侧的"Code"选项卡中编辑器区域中选择控制器类(MainController)。
3. 在控制器类(MainController)中,使用@FXML注释标记TableView和TableColumn字段,以便可以在FXML文件中引用它们。

  
  1. java
  2.    @FXML
  3.    private TableView<Person> table;
  4.    
  5.    @FXML
  6.    private TableColumn<Person, Integer> ageCol;
  7.    
  8.    @FXML
  9.    private TableColumn<Person, String> nameCol;
  10.    
复制代码

4. 在FXML文件中,为TableView和TableColumn设置FXID,以便与控制器类中的字段进行关联。

  
  1. xml
  2.    <TableView fx:id="table" ...>
  3.        <columns>
  4.            <TableColumn fx:id="ageCol" ... />
  5.            <TableColumn fx:id="nameCol" ... />
  6.        </columns>
  7.    </TableView>
  8.    
复制代码

5. 在控制器类(MainController)的initialize方法中,通过调用setCellValueFactory方法为TableColumn设置数据值工厂。您可以使用Lambda表达式来简化代码。

  
  1. java
  2.    @Override
  3.    public void initialize(URL url, ResourceBundle rb) {
  4.        // ...
  5.        ageCol.setCellValueFactory(cellData -> cellData.getValue().getAge().asObject());
  6.        nameCol.setCellValueFactory(cellData -> cellData.getValue().getName());
  7.        // ...
  8.    }
  9.    
复制代码

6. 最后,在控制器类(MainController)的initialize方法中,将数据(cellData)设置到TableView中。

  
  1. java
  2.    @Override
  3.    public void initialize(URL url, ResourceBundle rb) {
  4.        // ...
  5.        table.setItems(cellData);
  6.        // ...
  7.    }
  8.    
复制代码

通过以上步骤,您可以使用Scene Builder和控制器类(MainController)来设置TableView和TableColumn的相关属性,并将数据显示在TableView中。请确保FXML文件与控制器类中的字段、FXID和方法名称正确匹配。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2023-7-5 17:01:48 | 显示全部楼层
试试这个
MainApp.java:
  1. import javafx.application.Application;
  2. import javafx.fxml.FXMLLoader;
  3. import javafx.scene.Scene;
  4. import javafx.stage.Stage;

  5. public class MainApp extends Application {

  6.     @Override
  7.     public void start(Stage primaryStage) throws Exception {
  8.         FXMLLoader loader = new FXMLLoader(getClass().getResource("Sample.fxml"));
  9.         primaryStage.setScene(new Scene(loader.load()));
  10.         primaryStage.show();
  11.     }

  12.     public static void main(String[] args) {
  13.         launch(args);
  14.     }
  15. }
复制代码

MainController.java:

  1. import javafx.collections.FXCollections;
  2. import javafx.collections.ObservableList;
  3. import javafx.fxml.FXML;
  4. import javafx.scene.control.TableColumn;
  5. import javafx.scene.control.TableView;

  6. public class MainController {

  7.     @FXML
  8.     private TableView<Person> table;
  9.     @FXML
  10.     private TableColumn<Person, String> nameCol;
  11.     @FXML
  12.     private TableColumn<Person, Integer> ageCol;

  13.     private ObservableList<Person> cellData = FXCollections.observableArrayList();

  14.     public void initialize() {
  15.         // 初始化数据
  16.         loadData();

  17.         // 配置列的CellValueFactory
  18.         nameCol.setCellValueFactory(cellData -> cellData.getValue().nameProperty());
  19.         ageCol.setCellValueFactory(cellData -> cellData.getValue().ageProperty().asObject());

  20.         // 将数据设置到表格中
  21.         table.setItems(cellData);
  22.     }

  23.     private void loadData() {
  24.         // 添加示例数据
  25.         cellData.add(new Person("Alice", 25));
  26.         cellData.add(new Person("Bob", 30));
  27.         cellData.add(new Person("Charlie", 35));
  28.     }
  29. }
复制代码


Person.java:

  1. import javafx.beans.property.SimpleIntegerProperty;
  2. import javafx.beans.property.SimpleStringProperty;

  3. public class Person {
  4.     private SimpleStringProperty name;
  5.     private SimpleIntegerProperty age;

  6.     public Person(String name, int age) {
  7.         this.name = new SimpleStringProperty(name);
  8.         this.age = new SimpleIntegerProperty(age);
  9.     }

  10.     public String getName() {
  11.         return name.get();
  12.     }

  13.     public SimpleStringProperty nameProperty() {
  14.         return name;
  15.     }

  16.     public int getAge() {
  17.         return age.get();
  18.     }

  19.     public SimpleIntegerProperty ageProperty() {
  20.         return age;
  21.     }
  22. }
复制代码


Sample.fxml:

  1. <?xml version="1.0" encoding="UTF-8"?>

  2. <?import javafx.scene.control.TableColumn?>
  3. <?import javafx.scene.control.TableView?>
  4. <?import javafx.scene.layout.BorderPane?>

  5. <BorderPane xmlns:fx="http://javafx.com/fxml/1" fx:controller="MainController">
  6.     <center>
  7.         <TableView fx:id="table">
  8.             <columns>
  9.                 <TableColumn fx:id="nameCol" text="Name" prefWidth="100" />
  10.                 <TableColumn fx:id="ageCol" text="Age" prefWidth="50" />
  11.             </columns>
  12.         </TableView>
  13.     </center>
  14. </BorderPane>
复制代码

这是一个简单的示例,演示了如何在TableView中显示数据。你可以根据需要进行修改和扩展。

请注意,为了使代码完整运行,你需要在同级目录下创建一个名为"MainApp.fxml"的FXML文件,并将上面所提供的Sample.fxml内容复制到其中。

希望这能帮到你!如果你有其他问题,请随时提问。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2023-7-5 17:19:25 | 显示全部楼层
sfqxx 发表于 2023-7-5 17:01
试试这个
MainApp.java:

提示在13行错误?
--------------------------
Exception in Application start method
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
        at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
        at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$156(LauncherImpl.java:182)
        at java.lang.Thread.run(Thread.java:745)
Caused by: javafx.fxml.LoadException:
/E:/JavaProjects/test/bin/application/Sample.fxml:7

        at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)
        at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:103)
        at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:922)
        at javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:971)
        at javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:220)
        at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:744)
        at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2707)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
        at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
        at application.MainApp.start(MainApp.java:13)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$163(LauncherImpl.java:863)
        at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$176(PlatformImpl.java:326)
        at com.sun.javafx.application.PlatformImpl.lambda$null$174(PlatformImpl.java:295)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(PlatformImpl.java:294)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$null$149(WinApplication.java:191)
        ... 1 more
Caused by: java.lang.ClassNotFoundException: MainController
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:920)
        ... 17 more
Exception running application application.MainApp
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2023-7-5 17:19:52 | 显示全部楼层
sfqxx 发表于 2023-7-5 17:01
试试这个
MainApp.java:

提示错误在13行?
=================
Exception in Application start method
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
        at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
        at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$156(LauncherImpl.java:182)
        at java.lang.Thread.run(Thread.java:745)
Caused by: javafx.fxml.LoadException:
/E:/JavaProjects/test/bin/application/Sample.fxml:7

        at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)
        at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:103)
        at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:922)
        at javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:971)
        at javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:220)
        at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:744)
        at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2707)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
        at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
        at application.MainApp.start(MainApp.java:13)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$163(LauncherImpl.java:863)
        at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$176(PlatformImpl.java:326)
        at com.sun.javafx.application.PlatformImpl.lambda$null$174(PlatformImpl.java:295)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(PlatformImpl.java:294)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$null$149(WinApplication.java:191)
        ... 1 more
Caused by: java.lang.ClassNotFoundException: MainController
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:920)
        ... 17 more
Exception running application application.MainApp
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2023-7-5 17:21:09 | 显示全部楼层
本帖最后由 wow7jiao 于 2023-7-5 17:22 编辑
sfqxx 发表于 2023-7-5 17:01
试试这个
MainApp.java:


没有运行,提示 maiapp 13行错误
捕获.PNG
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2023-7-5 17:22:46 | 显示全部楼层
wow7jiao 发表于 2023-7-5 17:21
没有运行,提示 maiapp 13行错误

报错信息粘贴过来
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2023-7-5 18:36:25 | 显示全部楼层
sfqxx 发表于 2023-7-5 17:22
报错信息粘贴过来

发了
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2023-7-5 18:37:31 From FishC Mobile | 显示全部楼层
wow7jiao 发表于 2023-7-5 18:36
发了

粘贴到论坛上,不是图片。是文字
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2023-7-5 18:42:26 | 显示全部楼层
sfqxx 发表于 2023-7-5 18:37
粘贴到论坛上,不是图片。是文字

在上面,字太多了,要审核,一共发了2次
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2023-7-5 19:31:08 From FishC Mobile | 显示全部楼层
wow7jiao 发表于 2023-7-5 18:42
在上面,字太多了,要审核,一共发了2次

明白了
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2023-7-7 17:07:47 | 显示全部楼层
wow7jiao 发表于 2023-7-5 18:42
在上面,字太多了,要审核,一共发了2次

你是怎么组合代码的?发过来,总代码
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2023-7-7 17:09:50 | 显示全部楼层
sfqxx 发表于 2023-7-7 17:07
你是怎么组合代码的?发过来,总代码

一楼的test zip 包,我全打包了
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2023-7-7 17:10:29 | 显示全部楼层
wow7jiao 发表于 2023-7-7 17:09
一楼的test zip 包,我全打包了

我是手机党,看不了附件
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2023-7-7 17:16:39 | 显示全部楼层
sfqxx 发表于 2023-7-7 17:10
我是手机党,看不了附件

代码都在1楼,

MainController.java 应该是要到  sample fxml 里面设置一下
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2023-7-7 17:24:14 | 显示全部楼层
wow7jiao 发表于 2023-7-7 17:16
代码都在1楼,

MainController.java 应该是要到  sample fxml 里面设置一下

所以你没用我给的代码?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2023-7-7 17:25:44 | 显示全部楼层
本帖最后由 wow7jiao 于 2023-7-7 17:27 编辑
sfqxx 发表于 2023-7-7 17:24
所以你没用我给的代码?


用了,运行不了,你少写一部分 提示错误mainapp 15行,                primaryStage.setScene(new Scene(loader.load()));
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2023-7-7 17:28:57 | 显示全部楼层
sfqxx 发表于 2023-7-7 17:26
根据报错信息,错误的原因是找不到"MainController"类。请确保在`Sample.fxml`文件中正确指定了`controll ...

ok,谢谢。好了!
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2023-7-7 17:30:00 | 显示全部楼层
wow7jiao 发表于 2023-7-7 17:28
ok,谢谢。好了!

不客气
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-28 05:48

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表