Like many people asking questions, I am just starting to get acquainted with java, so I ask you to stick your nose at a specific example.
The task is as follows: this is a simple java application. There is a .htm document (with text, pictures, tables, and the like). It is necessary to display only those paragraphs of the .htm document that contain a previously known word on the JEditorPane.
The question of JEditorPane, because it easily and correctly turns out to display a motley document, but it turns out only entirely. If there is a simpler approach, I will be happy with the recommendations.
<br>, right? I think it can be solved like this: load the doc into the object into a string, (String variable), (for experienced users: I don’t useStringBuilderand their ilk for reasons of ease of explanation) to split the array of paragraphs into paragraphs -split("<br>"), and sort the array in the foreach-cycle, analyzing each paragraph for the presence of the desired word through thecontains("выражение"), and when getting a match, add to the final result variable. And fortextEditor.(setText(rezult));-textEditor.(setText(rezult));) - OldTeaOwl