James Boswell wrote:What you are trying to achieve is not currently possible i.e. trying to run a class within a jar which requires jar files also contained with the same jar - see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4648386.
In fact that's exactly where I got the idea to extend the TextPane.
Does that mean I cannot disable the selection functionality if using textpane? I would imagine that it is possible.
Darryl Burke wrote:The Caret belongs to the UI delegate, not the component.
Could have fooled me :-)
Darryl Burke wrote:Not really. I'm not a programmer and have absolutely no education, formal or otherwise, in programming.
Hopefully, somebody will give their input.
Darryl Burke wrote:However, there are many skilled and experienced professionals here who would be in a position to advise you on design.
Darryl Burke wrote:Sounds a lot like syntax highlighting <- Google
Thanks for the tip. I'll look into both.
Darryl Burke wrote:Have you considered using a DocumentListener? or maybe a DocumentFilter?
Darryl Burke wrote:A more correct but possibly L&F dependent approach would be to create a custom UI extending BasicTextPaneUI and override createCaret to return a custom subclass of BasicCaret that overrides mouseClicked(...) / mousePressed(...) to return without action when getButton() == BUTTON1 && getClickCount() > 1, otherwise invoke the super implementation.
edit: What about selection by dragging? or via the keyboard?
Rob Camick wrote:Don't use a null layout for you main components.
Use a Glass Pane with a null layout to hold the slider so it paints on top of other components. For example: