T
theCassman
Hi,
I am wanting to have an area of text which will take in sets of
coordinates and display them straight away. Initially, i used a
JTextArea and simply used the .append() method to add the newest
coordinates to the end of the current text. This worked perfectly fine.
However, my problem now is that i want, at some points, one set of
coordinates to display in a different colour to the rest. I.e. The
selected object would have its coordinates highlighted in the text
area. Due to the fact that .setForeground() changes the colour of the
entire contents of the JTextArea; i need to use something else. I have
tried using a JTextPane but cannot work out how to make it append extra
information like the JTextArea does.
Does anybody have any suggestions on what i could use to 1) display
text as i add new objects and 2) have the ability to have different
coloured text. Cheers.
Regards,
Cassman
I am wanting to have an area of text which will take in sets of
coordinates and display them straight away. Initially, i used a
JTextArea and simply used the .append() method to add the newest
coordinates to the end of the current text. This worked perfectly fine.
However, my problem now is that i want, at some points, one set of
coordinates to display in a different colour to the rest. I.e. The
selected object would have its coordinates highlighted in the text
area. Due to the fact that .setForeground() changes the colour of the
entire contents of the JTextArea; i need to use something else. I have
tried using a JTextPane but cannot work out how to make it append extra
information like the JTextArea does.
Does anybody have any suggestions on what i could use to 1) display
text as i add new objects and 2) have the ability to have different
coloured text. Cheers.
Regards,
Cassman