Results 1 to 1 of 1
- 10-29-2011, 07:53 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 19
- Rep Power
- 0
JEditorPane Text selecting and cursor position problems after scaling
I have a JEditorPane that displays HTML files, with overriden paintComponent function as follows :
This allows me to change the EditorPane's content size, like zooming.Java Code:protected void paintComponent(Graphics g) { Graphics2D g2d= (Graphics2D)g; g2d.scale(zoom, zoom); super.paintComponent(g2d); }
My problem is that when i do that, with zoom diferent than 1, whenever I select text from the EditorPane with the mouse, it selects the text that would have been there before the zoom, thus returning wrong results.
To further explain the getSelectionStart() and getSelectionEnd() of the editor pane dont work correctly, any possible workaround ?Last edited by xlomo; 10-29-2011 at 08:10 PM.
Similar Threads
-
Invalid operation at current cursor position
By bcg9 in forum New To JavaReplies: 4Last Post: 02-26-2013, 09:38 AM -
Selecting a text
By mathnitin in forum Advanced JavaReplies: 12Last Post: 02-27-2011, 07:04 PM -
cursor position in text area
By Saran185 in forum AWT / SwingReplies: 1Last Post: 02-02-2011, 07:00 AM -
Printing, scaling, dpi problems...
By aragornx in forum AWT / SwingReplies: 0Last Post: 11-30-2010, 12:28 PM -
how to place cursor at end of each line in JEditorPane
By prasad.vara in forum AWT / SwingReplies: 2Last Post: 10-25-2010, 12:32 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks