Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative to setText() method within RichTextFX #444

Closed
charandeep18 opened this issue Feb 24, 2017 · 2 comments
Closed

Alternative to setText() method within RichTextFX #444

charandeep18 opened this issue Feb 24, 2017 · 2 comments

Comments

@charandeep18
Copy link

Hi All,

I'm just changing an existing GUI that I have with some of the components available within RichTextFX and have run into a small problem.

Currently, I have a load function that loads text from a text file into an existing text area. I was wondering if there is an alternative to the setText() method available for RichTextFX?

` public void OpenFile(ActionEvent event) {
// Setting the filter to show only text files
FileChooser.ExtensionFilter filter = new FileChooser.ExtensionFilter("TXT Files (.txt)",".txt");

    	FileChooser filechooser = new FileChooser();
    	filechooser.getExtensionFilters().add(filter);
    	filechooser.setTitle("Open File");
   	
    	File file = filechooser.showOpenDialog(MainStage.getScene().getWindow());
    	if(file != null){
    	_readTextArea.SetText(openFile.readFile(file));_ - Causes an undefined error
    	}
    }`
@JordanMartinez
Copy link
Contributor

JordanMartinez commented Feb 24, 2017

Were you looking for replaceText(String text)? Or one of the other replace-methods?

@charandeep18
Copy link
Author

Thanks Jordan, that's done the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants