选择整行并在JAVAFX gui上显示;

时间:2016-03-27 00:11:25

标签: java javafx

  

这是click事件的代码然后我调用我的tableID(我的tableview的id见图片);我的tableview有多个单元格;这是从sqlite数据库中获取然后显示在javafx gui中;请帮忙

tableID.setOnMousePressed(new EventHandler<MouseEvent>(){
            public void handle(MouseEvent event){
                tableID.getSelectionModel().getSelectedCells();
                Stage detailStage= new Stage();
                FXMLLoader detailloader =new FXMLLoader();
                try {
                    Pane detailroot =(Pane)detailloader.load(getClass().getResource("/Admin/DetailsFXML.fxml").openStream());
                    DetailsContr detailcontr = (DetailsContr)detailloader.getController();
                    Scene scene = new Scene (detailroot);

                    detailStage.setScene(scene);
                    detailStage.setTitle("Details Interface");
                    detailStage.setResizable(false);
                    detailStage.show();


                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

            }

        });

this is my tableview and i would like to click on any row then edit or delete

1 个答案:

答案 0 :(得分:0)

$("#b4").click(function(){

etat.outbox.push({
    "to":$("#at").val(),
    "msg":$("#msg").val(),
    "date":new Date()
});
$("#showoutbox").append($("<h3>").text(JSON.stringify(etat.outbox[0 or 1 or 2])));
alert("Message envoyer");});