File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes how to highlight entire row ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to highlight entire row ?" Watch "how to highlight entire row ?" New topic

how to highlight entire row ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

i m using this logic to highlight a entire row on which caret is positioned , but this is not working what happened here is i m taking out the start and end of a line
this logic only highlights the text part but not the empty blank part (i m not talking about white spaces) just a blank part
where i m getting wrong ?

The Only way to learn is!
Visit my blog
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2416
See Line Painter for one solution.
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

Rob Camick wrote:See Line Painter for one solution.

i have used this , but i guess that algorithm is not that much good because when you write or copy past a large document in your editor the editor freeze and later a stack overflow exception is thrown
,do you know any other way , however to be more precise i have implemented my solution and it is working well i have done that by overriding the default highlighter class with my custom implementation
now at this point my only problem is to code a custom method because i have changed the default beheviour of highlighter by overriding paint , so that now it paints the entire width of a line, including the empty portion (remember default highlight only paint the text portion and not the empty portion) but now when i do remove all highlight the default implementation only remove highlights from the text and not from the blank areas , so for that i need to write a custom method,
will any one help me to right one ?
thanks in advance....
I agree. Here's the link:
subject: how to highlight entire row ?
It's not a secret anymore!