有看起來像一個方法: def some_thing(user)
x = user.age
y = user.height
end
我有一個對象,看起來像: x = other.info[0]
y = other.info[1]
我怎麼能將此信息傳遞給方法SOME_THING? some_thing(other)
將不起作用,因爲它沒有以這種方式暴露的屬性
這是我的第一個JavaFX程序,我想通過ePass通過eUser和密碼接受用戶名。當我嘗試檢查,如果文本框爲空,使用驗證我得到這個錯誤: Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.inv
所以,我創建了2矩形,並檢查他們是否有交叉,但每次都得到不同的結果: Rectangle a = new Rectangle(10.00, 10.00);
Rectangle b = new Rectangle(30.00, 20.00);
a.setFill(Color.RED);
_centerPane.getChildren().add(a);
_c