本文整理汇总了Java中javafx.scene.web.WebHistory.getCurrentIndex方法的典型用法代码示例。如果您正苦于以下问题:Java WebHistory.getCurrentIndex方法的具体用法?Java WebHistory.getCurrentIndex怎么用?Java WebHistory.getCurrentIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.web.WebHistory
的用法示例。
在下文中一共展示了WebHistory.getCurrentIndex方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: goBack
import javafx.scene.web.WebHistory; //导入方法依赖的package包/类
public void goBack(){
final WebHistory history = webEngine.getHistory();
ObservableList<WebHistory.Entry> entryList = history.getEntries();
int currentIndex = history.getCurrentIndex();
Platform.runLater(new Runnable() {
@Override
public void run() {
try {
history.go(-1);
}catch(Exception e){
webEngine.loadContent(body);
}
}
});
}
示例2: goBack
import javafx.scene.web.WebHistory; //导入方法依赖的package包/类
public String goBack() {
final WebHistory history = webEngine.getHistory();
ObservableList<WebHistory.Entry> entryList = history.getEntries();
int currentIndex = history.getCurrentIndex();
// Out("currentIndex = "+currentIndex);
// Out(entryList.toString().replace("],","]\n"));
if (currentIndex > 0) {
Platform.runLater(() -> {
history.go(-1);
});
}
return entryList.get(currentIndex > 0 ? currentIndex - 1 : currentIndex).getUrl();
}
示例3: goForward
import javafx.scene.web.WebHistory; //导入方法依赖的package包/类
public String goForward() {
final WebHistory history = webEngine.getHistory();
ObservableList<WebHistory.Entry> entryList = history.getEntries();
int currentIndex = history.getCurrentIndex();
// Out("currentIndex = "+currentIndex);
// Out(entryList.toString().replace("],","]\n"));
if (currentIndex < entryList.size() - 1) {
Platform.runLater(() -> {
history.go(1);
});
}
return entryList
.get(currentIndex < entryList.size() - 1 ? currentIndex + 1 : currentIndex)
.getUrl();
}
示例4: goBack
import javafx.scene.web.WebHistory; //导入方法依赖的package包/类
public String goBack() {
final WebHistory history = webEngine.getHistory();
ObservableList<WebHistory.Entry> entryList = history.getEntries();
int currentIndex = history.getCurrentIndex();
// Out("currentIndex = "+currentIndex);
// Out(entryList.toString().replace("],","]\n"));
Platform.runLater(() -> {
history.go(-1);
});
return entryList.get(currentIndex > 0 ? currentIndex - 1 : currentIndex).getUrl();
}
示例5: goForward
import javafx.scene.web.WebHistory; //导入方法依赖的package包/类
public String goForward() {
final WebHistory history = webEngine.getHistory();
ObservableList<WebHistory.Entry> entryList = history.getEntries();
int currentIndex = history.getCurrentIndex();
// Out("currentIndex = "+currentIndex);
// Out(entryList.toString().replace("],","]\n"));
Platform.runLater(() -> {
history.go(1);
});
return entryList
.get(currentIndex < entryList.size() - 1 ? currentIndex + 1 : currentIndex)
.getUrl();
}
示例6: goBack
import javafx.scene.web.WebHistory; //导入方法依赖的package包/类
public String goBack()
{
final WebHistory history = engine.getHistory();
ObservableList<WebHistory.Entry> entryList=history.getEntries();
int currentIndex=history.getCurrentIndex();
// Out("currentIndex = "+currentIndex);
// Out(entryList.toString().replace("],","]\n"));
Platform.runLater(new Runnable() { public void run() { history.go(-1); } });
return entryList.get(currentIndex>0?currentIndex-1:currentIndex).getUrl();
}
示例7: goForward
import javafx.scene.web.WebHistory; //导入方法依赖的package包/类
public String goForward()
{
final WebHistory history=engine.getHistory();
ObservableList<WebHistory.Entry> entryList=history.getEntries();
int currentIndex=history.getCurrentIndex();
// Out("currentIndex = "+currentIndex);
// Out(entryList.toString().replace("],","]\n"));
Platform.runLater(new Runnable() { public void run() { history.go(1); } });
return entryList.get(currentIndex<entryList.size()-1?currentIndex+1:currentIndex).getUrl();
}