• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Solaris/Linux - Swing JTextPane Problem

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
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.
-Rayudu
here is what i did:
class JtPane extends JTextPane
{
public JtPane()
{super();}
/*overide paste method of JTextComponent*/
public void paste()
{System.out.println("Paste Disabled");}
}
/*works in windows but not in solaris??*/
 
Saloon Keeper
Posts: 28100
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic