This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes Solaris/Linux - Swing JTextPane Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Solaris/Linux - Swing JTextPane Problem" Watch "Solaris/Linux - Swing JTextPane Problem" New topic

Solaris/Linux - Swing JTextPane Problem

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.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950

That function is being done automatically by your window manager without consulting the application.
It's simulating someone typing, not a true "paste". The only way I know to turn it off is to actually meddle with each user's desktop global parameters, and I doubt they'd like that.
I know I wouldn't. I use the middle button a LOT.

Customer surveys are for companies who didn't pay proper attention to begin with.
subject: Solaris/Linux - Swing JTextPane Problem
Similar Threads
If we pass null in Jdialog title in linux it is showing garbage value in title bar
jdialog is not behaving properly in linux??
Able to Copy Text from Text Boxes(JTextfields) in Linux/Solaris
in jdialog when we pass null it is showing some garbage in titlebar in linux??
Swing JTextPane on Solaris/Linux