我需要组件来编辑大型文本和摇摆JEditorPane工作很棒.如何在JavaFX 8中实现类似于JEditorPane的功能?我读过几个机会:
但我对这两种方法都没有太大的热情.还有其他方法吗?
假设我有一些流,想收集到这样的地图
stream.collect(Collectors.toMap(this::func1, this::func2));
Run Code Online (Sandbox Code Playgroud)
但我想跳过空键/值.当然,我可以这样做
stream.filter(t -> func1(t) != null)
.filter(t -> func2(t) != null)
.collect(Collectors.toMap(this::func1, this::func2));
Run Code Online (Sandbox Code Playgroud)
但是有更美观/有效的解决方案吗?
我对JavaFX中的绑定有疑问。假设我有映射1:“ Aaa”,2:“ Bbb”,3:“ Ccc”,依此类推。我想要的是根据此映射绑定(双向)2个属性IntegerProperty和StringProperty。如何做到这一点?
UPD:我将尝试描述我的用例。我有一堂课
class A {
IntegerProperty num;
...
}
Run Code Online (Sandbox Code Playgroud)
但是在用户界面中,我不想显示此数值,而是显示一些有意义的字符串。所以我想添加StringProperty numValue和绑定num和numValue。在表中,我将numValue用作TableColumn的属性。当用户更改值numValue(例如通过组合框)时,我想num自动更新。