Results 1 to 2 of 2
Thread: Adding text to Jtexpane
- 05-14-2012, 09:30 AM #1Member
- Join Date
- Apr 2012
- Rep Power
Adding text to Jtexpane
Ok, I got a code that adds a line to a jtextpane, but the problem is that a huge space appears...
I got user string, and message string
The line that should show on the jtextpane is 10:30:10 | daniel > hello everybody
The line tha appears on the jtextpane is 10:30:10 | daniel > SPACEEEEEEEEEEEEEEEE hello everybody
Spaceeee= a huge white space, but the forum doesn't show it :P
None of the strings has that huge space... (tested using System.out.println), so basically it has to be a problem with this code I am using:
tiempo=current time, got with util.calendar...
I want the user and the mssage with two diff colors so I add two different lines with their respective color configuration:
caja.insertString(caja.getLength(),tiempo+" | "+obtenerusuario(linea)+" > ", colorespecial );
caja.insertString(caja.getLength(), arreglarformatonormal(linea)+"\n", colorprivados);
What do you think it might be occuring...?
- 05-14-2012, 10:48 AM #2
Re: Adding text to Jtexpane
Difficult if not impossible to say without a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
- By Andie in forum New To JavaReplies: 0Last Post: 04-21-2012, 08:14 PM
- By tom2zip in forum AWT / SwingReplies: 3Last Post: 01-17-2012, 05:58 AM
- By Musaddict in forum New To JavaReplies: 2Last Post: 08-18-2011, 09:36 PM
- By JordashTalon in forum New To JavaReplies: 0Last Post: 03-04-2009, 11:08 PM
- By phani532 in forum New To JavaReplies: 5Last Post: 08-27-2008, 03:12 PM