小编Dja*_*nis的帖子

将按钮添加到 TableView 中的单元格 (JAVAFX)

我正在尝试向我的表格添加一个编辑按钮。当我单击该按钮时,它将打开一个窗口,其中包含选定的项目,我尝试了多种方法来添加按钮,但没有人适合我。谢谢,这是我的控制器的代码:

public class AmdinConsolcontroler implements Initializable{



@FXML
// here we add the create new user window the the event butto
private void ActionCreateNewUser (ActionEvent evt)
{
    try {
  Parent root =     FXMLLoader.load(SimpleFXapp.class.getResource("/Views/CreateUser.fxml"));
  Stage primaryStage = new Stage();
  Scene Scene = new Scene(root);
  primaryStage.setScene(Scene);
  primaryStage.setTitle("Create");
  primaryStage.show();
      }
  catch(Exception Err)
  {
   System.out.println("exception from create user");
  }
}

      // Creating the Observable list to be data for the table  
     ObservableList<Users> data1 =     FXCollections.observableList(Users.GetShortedUsrs());
    // Declaring the Table 
   @FXML
    TableView<Users> ShortedUserList;
   //Declaring the Columns …
Run Code Online (Sandbox Code Playgroud)

java javafx tableview

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

java ×1

javafx ×1

tableview ×1