jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes Swing JTextPane on Solaris/Linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Swing JTextPane on Solaris/Linux " Watch "Swing JTextPane on Solaris/Linux " New topic

Swing JTextPane on Solaris/Linux

Rayudu addagarla
Ranch Hand

Joined: Aug 17, 2000
Posts: 39
Working for a long time in windows platform.I am new in working in Java in Unix world.
Problem: JTextPane [javax.swing.text.JTextPane]
Even when the JTextPane is set to Editable false the paste operation is working. I worked the same example in windows,it does not allow to type or paste anything.
But in unix,solaris/Linux redhat: it does not allow me to type ,but when i use the middle button in solaris content in clipboard is getting paste inthe JTextPane.
i tried to override the paste method [in JTextcomponent class] to do nothing. even then its pastes.
What is the method that invokes when middle button is clicked in solaris or two buttons clicked at same time in linux.?
I am thinking Ctrl+V in windows is equavalent to middle button click in solaris.
bottom line.I don't want the JTextPane to take any paste operations.
here is what i did:
class JtPane extends JTextPane
public JtPane()
/*overide paste method of JTextComponent*/
public void paste()
{System.out.println("Paste Disabled");}
/*works in windows but not in solaris??*/

Good luck for Certfication.
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
this should work (for JTextPane, as well):

Rayudu addagarla
Ranch Hand

Joined: Aug 17, 2000
Posts: 39
Hi Chantal ,
Great!! It Worked
I did not know about the consume method.
I agree. Here's the link: http://aspose.com/file-tools
subject: Swing JTextPane on Solaris/Linux
It's not a secret anymore!