本文整理汇总了Java中goryachev.fx.FX.later方法的典型用法代码示例。如果您正苦于以下问题:Java FX.later方法的具体用法?Java FX.later怎么用?Java FX.later使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类goryachev.fx.FX
的用法示例。
在下文中一共展示了FX.later方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restoreSplitPane
import goryachev.fx.FX; //导入方法依赖的package包/类
private static void restoreSplitPane(String prefix, SplitPane sp)
{
String k = prefix + SFX_DIVIDERS;
SStream s = GlobalSettings.getStream(k);
// must run later because of FX split pane inability to set divider positions exactly
FX.later(() ->
{
int ct = s.nextInt();
if(sp.getDividers().size() == ct)
{
for(int i=0; i<ct; i++)
{
double div = s.nextDouble();
sp.setDividerPosition(i, div);
}
}
});
}
示例2: edit
import goryachev.fx.FX; //导入方法依赖的package包/类
public void edit(TreeItem<Page> p)
{
tree.getSelectionModel().select(p);
int ix = tree.getSelectionModel().getSelectedIndex();
tree.getSelectionModel().clearAndSelect(ix);
if(ix < 0)
{
return;
}
FX.later(() ->
{
tree.edit(ix, tree.getColumns().get(0));
Node n = tree.lookup(".text-input");
// FIX focus the editor
FX.later(() ->
{
// it looks like the editor is losing focus
n.requestFocus();
});
});
}
示例3: showFindPane
import goryachev.fx.FX; //导入方法依赖的package包/类
public void showFindPane()
{
FindPane p = new FindPane();
setBottom(p);
FX.later(() -> p.focusSearch());
}
示例4: DemoBrowser
import goryachev.fx.FX; //导入方法依赖的package包/类
public DemoBrowser()
{
super(DemoGenerator.BROWSER);
setTitle("Browser");
addressField = new TextField();
addressField.addEventHandler(KeyEvent.KEY_PRESSED, (ev) -> handleKeyTyped(ev));
bind("URL", addressField.textProperty());
view = new WebView();
view.getEngine().setOnError((ev) -> handleError(ev));
view.getEngine().setOnStatusChanged((ev) -> handleStatusChange(ev));
Worker<Void> w = view.getEngine().getLoadWorker();
w.stateProperty().addListener(new ChangeListener<Worker.State>()
{
public void changed(ObservableValue v, Worker.State old, Worker.State cur)
{
D.print(cur);
if(w.getException() != null && cur == State.FAILED)
{
D.print(w.getException());
}
}
});
statusField = new Label();
CPane p = new CPane();
p.setGaps(10, 5);
p.setCenter(view);
p.setBottom(statusField);
setContent(p);
FX.later(() -> reload());
}