本文整理匯總了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());
}