I want to create a JTextArea that looks like JTextArea, acts like JTextArea, answers like JTextArea, says like JTextArea, moves like JTextArea, etc., but is not JTextArea.
To do this briefly, I would like to create a custom swing component based on 100% on JTextArea. As soon as I do this, I can change the different, otherwise hard-set properties of JTextArea, and create my own JTextArea. There are no predefined rotation components that are designed the way I need them, but JTextArea is the closest, so I choose it.
I would like to change the line spacing of JTextArea. And no, I donβt want to use JtextPane, I tried it, it doesnβt work with my program, it calculates its position differently, it looks differently, and applying the JtextArea border is just useless.
I am not trying to extend JTextArea, I am trying to create a custom JTextArea, as in a custom swing component , with modified hard-coded properties that are not configurable when using JTextAreas methods.
However, I do not know how to do this. I searched it online, but there is only an extensive guide on how to create your own component from a package ...
Believing it will take a long time and not solve my problem.
The only thing I need to do is create a class (or several classes) that will contain everything that JTextArea creates. Start at the JTextComponent level and copy all the lower level classes that are used to create the JTextArea. I would also like to note that I am using the Nibus look, I think there may be some classes that must be included for a custom JTextArea to work correctly in this LAF.
I looked at the swing source code and it is full of everyone. Finding out which classes or parts of them are used when creating JTextArea will be a time-consuming nightmare, given that I do not know about the structure and mechanics of the kernel.
That's why I ask someone who has the knowledge to at least list the classes that I need to replicate JTextArea, and then I will figure out how to compose them.
Because if I start to study now the mechanics of swinging the kernel, it will take several days and weeks before I find out, but for those who know, it only takes a few minutes to list all the classes that I need to focus my attention.
I am trying to use a shortcut here. I donβt want to fully understand the swing, I just want this work to work. The default spacing is one pixel too low, and all I want to do is just make the pixel higher. I donβt want to know how the artist paints a component on the screen, I just want to know where he is called from and what he calls himself ...
Thanks to everyone who takes the time.