Hello , everyone.
This is my first post,and I am new to Java-and programming in general-, so I am looking forward to learn, and give advice where I can.
I need to create a GUI components from scratch, like a button, Text area etc. Instead,I figured that if I understand the Java components' source(from OpenJDK) I can customize them to my needs, instead of creating new ones.
Here is my problem:
I read the source code of JTextArea (and it's parents), but I cannot figure out how it draws the text!(I expected something like graphics.drawString , or any other method that performs the drawing).All calling to
paint() in this class or parent classes, do not have anything that draws the text.
I ask this question because I don't want to develop a text component from scratch, because then I will have to deal with a lot of issues, and I can't find and source code for a simple Text Component.
Can anyone Help me plz?
Also,though outside the topic, Swing components do not have
peer components , but all of them inherits from AWT.Compnent, and AWT components have peers, how can that be?!!!