File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT / JFace and the fly likes how to highlight entire row ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "how to highlight entire row ?" Watch "how to highlight entire row ?" New topic
Author

how to highlight entire row ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 543

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 ...........do!
Rob Camick
Ranch Hand

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

Joined: Jul 03, 2011
Posts: 543

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....
 
 
subject: how to highlight entire row ?
 
Threads others viewed
get fifth element from last for a Singly linked list
setSelectionStart
converting int to String using toString() ?? possible??
Displaying line # with JTextArea
Project: Swing or SWT
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture