Ok, I am writing a text editor using a JTextPane. I am trying to figure out how to change the font size for specific text that the user types in. I have a JButton that the user can click to bring up a font-size and font-type selection menu. When the user selects the proper font size and type and presses ok, I then proceed to get the font size and type inside a Font
. All I need to do now is to set the Font
of the selected text in the JTextPane without overriding the current style(s) of the text. I haven't found anything that enables me to do this. Maybe I just missed something somewhere...
Thanks in advance.
Note: I am a newbie on StackOverFlow so please edit my question if I did something wrong.