如何将按钮和字符串放到javafxml滚动窗格中?

时间:2019-05-01 12:47:00

标签: java javafx scrollpane

我试图将一个按钮和一个字符串彼此相邻放置到ArrayList中每个对象的滚动窗格中。这意味着我需要多次将此附加到滚动窗格。

@FXML
     private ScrollPane scrollElem; 


@FXML

     private void getElements(MouseEvent event){

            customer obj = writeCustomerToFile.getObject();
            ArrayList<customer> array = obj.putCustomersInArray();

            Label scrollContent = new Label();
            scrollContent.setText("");
            Button button = new Button(); 
            scrollElem.setContent(scrollContent,button); 
     }

//I am looking for something similar code shown above

0 个答案:

没有答案