javafx.beans.property.ReadOnlyIntegerWrapper Java Examples

The following examples show how to use javafx.beans.property.ReadOnlyIntegerWrapper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TerminalView.java    From TerminalFX with MIT License 5 votes vote down vote up
public TerminalView() {
	webView = new WebView();
	columnsProperty = new ReadOnlyIntegerWrapper(150);
	rowsProperty = new ReadOnlyIntegerWrapper(10);
	inputReaderProperty = new SimpleObjectProperty<>();
	errorReaderProperty = new SimpleObjectProperty<>();

	inputReaderProperty.addListener((observable, oldValue, newValue) -> {
		ThreadHelper.start(() -> {
			printReader(newValue);
		});
	});

	errorReaderProperty.addListener((observable, oldValue, newValue) -> {
		ThreadHelper.start(() -> {
			printReader(newValue);
		});
	});

	webView.getEngine().getLoadWorker().stateProperty().addListener((observable, oldValue, newValue) -> {
		getWindow().setMember("app", this);
	});
	webView.prefHeightProperty().bind(heightProperty());
	webView.prefWidthProperty().bind(widthProperty());

	webEngine().load(TerminalView.class.getResource("/hterm.html").toExternalForm());
}