MainDisplay.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:SnapDup 作者:
@FXML
private void btnMapDevicesAction()
{
    try
    {
        FXMLLoader loader = new FXMLLoader(MainDisplay.class.getResource("/fxml/MapDevicesDialog.fxml"));
        Parent root = loader.load();
        Scene scene = new Scene(root);
        Stage stage = new Stage();
        stage.initModality(Modality.APPLICATION_MODAL);
        stage.initStyle(StageStyle.UNDECORATED);
        stage.setScene(scene);
        stage.show();

        Node node = scene.lookup("#tblMapDevice");

        if(node instanceof TableView)
        {
            TableView<Pair<String, String>> table = (TableView)node;
            ArrayList<Pair<String, String>> pairList = new ArrayList<>();

            dataContainer.getDeviceMap().entrySet().forEach(entry -> pairList.add(new Pair<String, String>(entry.getKey(), entry.getValue())));

            ObservableList<Pair<String, String>> tableModel = FXCollections.<Pair<String, String>> observableArrayList(pairList);

            table.setItems(tableModel);
        }
    }
    catch(IOException e)
    {
        e.printStackTrace();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号