GUI和写入文件

时间:2019-03-23 00:37:52

标签: user-interface

我正在上一个OOP课,我想知道是否有人可以解决我的应用控制器中出现的问题。

此方法由我的GUI中的按钮激活:


    @FXML public void handleClick() {
            String v1 = (String) velg1.getValue();
            String v2 = (String) velg2.getValue(); 
            Ses s1 = new Ses();
            int antall = (int) antallK.getValue();
            for(int i = 0; i

What I want to do is to create another button that when clicked writes the information stored in s1 in the code example abovet to file.. The methods for writing to file is already made, but I struggle to connect the buttons.. How can I integrate another button that allows me to access te object created within handleClick?

@FXML public void saver(){ When the button is clicked and this method is activated I want to access s1 in the method above.. }

0 个答案:

没有答案