I can’t open the RTF document with JAVA. I reread some literature and found a JTextPane , JEditorPane , JFormatedTextField . The text only needs to be shown, so I selected JEditorPane .
File InstructionFile = new File("Instruction.rtf"); tfInstruction = new JEditorPane("InstructionFile"); I tried to set the text using the file when initializing the JEditorPane , but for some reason this option does not work.
For JEditorPane in the environment, I found the property setDocument - and it seems that this is the method that I need, but I have no idea how to use it?