JTextPane Paste

I am just wondering...

Why is that for security reasons, one cannot do Ctrl+V to paste into
JTextPane?

People argue that you cannot read user's cb. But i don't need to read
user's clip board. the user will initiate the action.

I can paste into a textarea form control, and most of those forms i
paste into are not signed code???

so, why does JTextPage require signing before someone would just do
Ctrl+V?

I really think this is not a security issue, it's just unintended bug!.
because, if you can paste into a textarea on a webpage, using CTRL + V,
then you should be able to paste into the same JTextPane on the same
webpage.

Any ideas?

0
tascienu (12)
4/28/2005 7:20:34 AM
comp.lang.java.gui 8307 articles. 0 followers. Post Follow

1 Replies
353 Views

Similar Articles

[PageSpeed] 7
tascienu@ecoaches.com wrote:
> People argue that you cannot read user's cb. But i don't need to read
> user's clip board. the user will initiate the action.

That's wrong. It can, but it must not be user-initiated. An applet can 
contain malicious code which just tries to read the clipboard:

	Toolkit.getSystemClipboard().getContents();

This has to be prevented, so access to the system clipboard is 
controlled by a security manager.

/Thomas
-- 
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
0
Thomas
4/28/2005 9:46:36 AM
Reply:
Similar Artilces:

Re: Past Veto
------=_NextPart_000_0078_01C8181B.AEE78050 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I solved the problem catching both ctrl+v char and paste command EVT_MENU( wxID_PASTE, myclass::OnPasteMenu ) EVT_CHAR( myclass::OnChar ) ----- Original Message -----=20 From: Efra=EDn L=F3pez=20 To: wx-users@lists.wxwidgets.org=20 Sent: Friday, October 26, 2007 6:28 PM Subject: Past Veto Hi, using 2.8.6 and wxWIN I have a class derived from wxTextCtrl I need to veto the past event I can catch th...

[tao-users] The past, present, and future of MOOCs
Hi Folks, We recently wrote a paper summarizing our perspectives on the past, present, and future of MOOCs. A draft is available at http://www.dre.vanderbilt.edu/~schmidt/ICSE-2014-MOOCS-v26.pdf Any/all comments are welcome! Thanks, Doug ...

JTextPanes
Hi everyone, Let's say that i have some embedded JComponents in a JTextPane, ho do i find out the starting caret position of where the JComponents are currently embedded at? Any help is greatly appreciated Yours Sincerely Richard West ...

Re: SAS/AF: Copy and Paste into Table Viewer from Excel #30
Dave, I considered a PMENU, but failed to see how it could help here. I've learned something new (and very useful) today. Thanks, Randy -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Dave Scocca Sent: Tuesday, December 09, 2008 10:42 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: SAS/AF: Copy and Paste into Table Viewer from Excel --On 12/9/2008 10:20 AM -0500 Randy Herbison wrote: > If the SAS/AF application could detect the Windows paste operation, it > might be able to intercept it and run custom code to paste into > multiple...

Re: copy/paste of exponents
Turn off the formatting option which displays emoticons as graphics (what emoticons have to do with superscripts, I've got no idea). I believe this is where you'll find the option setting... Tools -> Options -> Display -> Formatting -> Plain Text Messages ....although I'm not a Thunderbird user, so that might be a bit off. This is a very aggravating problem, and if there were anything we could do from the Mathematica end to work around this, we would. Unfortunately, I think the only way to resolve the problem is to become a Thunderbird developer. Heck...

KEGS32 Copy-Paste?
Not a direct programming question, but I am running Complete Pascal in an emulated IIGS using Kegs32. I would love to take text from Windows, copy it to that clipboard, and paste it into the IIGS text editor. Can anyone recommend a kegs configuration to do that, if it is possible? Currently my workaround is to save things to a text file in Windows, CiderPress the file to my HD image, and then load it on the GS. Not exactly optimal. All ideas appreciated. Thanks. One way to speed up your current process is to automate it. Use a program like apple commander and put it in...

select and paste issue
One of our people is getting corruption in Mathematica v5.2 while editing .nb files. Upon selecting multiple characters with the shift - right arrow or shift-left arrow, one of more numbers will suddenly replace the selected text. This happens without any number keys being pressed while adding to the hilighted or selected text. Has anyone seen this behavior? We are using debian sid and XFree86 v4.3. Please cc my address. Thanks very much. ...

Random Acts of Christmas Past
It comes to haunt us every year at this time... http://ronanddave.com/rat.htm Enjoy Ron Lacey Murillo Ontario ron@ronsfotos.com http://ronsfotos.com http://ronstoons.com http://ronanddave.com ...

Re: input statement reading past data #14 679366
On Wed, 6 Dec 2006, William W. Viergever wrote: > <vbseg> He's back! Kevin Viel PhD Candidate Department of Epidemiology Rollins School of Public Health Emory University Atlanta, GA 30322 ...

Printing HTML in JTextPane
Hi, I have a JTextPane using HTMLEditorKit to display HTML content. How do I provide a function/method to print the content of it? Many Thanks. In article <d2003dfe.0407041737.6ec5ff75@posting.google.com>, cybernerdsx2@yahoo.com (Michael) wrote: > Hi, > > I have a JTextPane using HTMLEditorKit to display HTML content. How do > I provide a function/method to print the content of it? > > Many Thanks. There's a pretty good introduction to printing in the tutorials on the Sun website. The only limitation with the standard technique is that it will basically re...

Problem with Paste Special
I am not getting the Microsoft Word Picture, while I select paste with the Paste Special duologue box. I am using CorelDraw 11. What should I do to get this option, so that the information copied from Word is editable, as-well-as correct (not getting corrupted as that happens to me) Thanks, Dr.Lince M Lawrence Dr. Lince M. Lawrence wrote: > I am not getting the Microsoft Word Picture, while I select paste with >...

copy and paste
This is a very simple question, but I'm finding it difficult to find the answer, can you please help? I want to copy the text output of some expressions all at once to notepad, but I get all this other stuff I don't want to get copied along such as invisible characters, and output #x, etc.. Can anyone tell me how I can just do a text copy and paste please? By the way I've tried all the copy As options, and paste as options, nothing works. symbio wrote: > This is a very simple question, but I'm finding it difficult to find the > answer, can you please h...

Why does AffineTransform not work on JTextPane?
I can rotate every other type of component I've tried, but when I rotate a JTextPane by 90 or 180 degrees (which I REALLY need for my customer's application) The clipping and bordering get all messed up and I'm at my wit's end trying to make it work. Am I doing something wrong, or is there a Java bug in applying a transform to a JTextPane? The same basic code works on a JLabel, why won't it work on a JTextPane? Any ideas or suggestions would be deeply appreciated. OR any ideas for a different way to display STYLED text (font, size, color, bold, italic on a character-by-c...

Pentium 4 computer won't boot past BIOS
This may be in the wrong group, but I can't figure out what would be better. I just got a used Pentium 4 PC for my father, which I was told worked (it was free). On getting it home, it would boot (quickly) to a weird screen with extended ASCII characters in who-knows-what codepage and various colors, and I was unable to get into the BIOS setup! It was supposed to have Windows XP on it. Slightly baffled at its inability to even bring up the BIOS setup screen, I removed the battery. Restoration of battery and power presented nearly the same problem, but the HP logo came up (expect...

WDSc Remote System LEPX Editor Copy & Paste
How do you copy some lines of code from one program to the next when editing with the WDSc Remote System LEPX Editor? I've tried cut and paste in as many ways as I can think of and all the paste function does is a new line insert. I've only tried this with RPG code, if that makes a difference. Thanks Much! -MBL- Ok... so now I'm using Remote Desktop to access my computer and it is working just fine. Must be some weird Microsoft bug or just a re-boot issue. Thanks anyway! ...

Putting a block of text as a group in JTextPane
Hi, I am a newbie to Swing. I need to implement a text editor using JTextPane. One of the feature is I can insert a text object in the editor. This text object is shown as normal text, but it will be treated as one group. In other words, I need the followings: 1) When I click on any position on this group, it should select the whole group of text. 2) When the caret is moved around it, it should bypass the whole block (from leftmost to rightmost or rightmost to leftmost). 3) When the text is dragged and dropped over it, it should not allow dropping in the middle of the group. 4) When the g...

"comma-izing" numbers
Today I had the need to display numbers "comma-ized" - which is a frequently requested feature in this newsgroup. This arose in the context of displaying Unix file sizes using the "ls" command (*). A bit of googling turned up the following (GAWK) function, written back in 2005 by frequent poster "Ed": # Cleaned up a bit by me. function comma(num) { if (num < 0) return "-" comma(-num) while (num != (num=gensub(/([0-9])([0-9][0-9][0-9])($|[,.])/,"\\1,\\2\\3","",num))); return num } # And the following program lin...

Just Insert key to paste
Any ideas on how to set up Xterm so that I can paste using just the Insert key rather than having to use the default Shift-Insert combination? I've tried the following in .Xresources to no avail: XTerm*VT100.Translations: #override\n\ <Btn1Up>: select-end(PRIMARY,CLIPBOARD,CUT_BUFFER0) <Key>Insert: insert-selection(PRIMARY,CLIPBOARD,CUTBUFFER0) as well as varying use of PRIMARY, CLIPBOARD, and CUTBUFFER0. Thanks, Bruce -- nagelbh@freeshell.org The black queen chants the funeral march, The cracked brass bells will ring; ...

JTextPane -> JTextPane
I have a window with 2 JTextPanes. I want the user to type into one in full styling (Done) I then want them to hit a send button, or the enter key (Done) And then I want the Styled text to appear in the other with the same styling The only way I can think to do anything close to this is to go through, split the text into each style, send each piece seperately, then redraw it all together.... Help? ...

function versus form: squarely rooted in the offline past and the wired present
I would be very displeased to see dvd drive gone on an mbp 17" refresher (if I ever see that one) The reason being: there is space in the box and I don't need a thinner lighter 17" brick. If I wanted lighter I'd get air. I do NOT want macbook air with a 17" display. Kapisch? I do WANT wired connectivity in the shape and form of RJ-45 port thank you very much. dedicated pgup/pgdn would be a welcome addition also along with the full size arrow keys while we are on the topic of full size arrow keys and non unified keyboard layout (it's idiotic to use o...

Use of JTextPane in Chatting Application
A JTextPane is a text component that can be marked up with attributes that are represented graphically. In the process of writing a chatting application, i am going to use JTextPane for accepting the text from user on a client (So that underline can also be displayed which can not be displayed using JTextField). Can i get different format for each character (This feature is not available in Yahoo Messenger) ? I want to send this information to another machine. How to pack all the formatting of the text with different attribute of each character in a single class so that i can send this objec...

Rendering HTML in a JTextPane
Hi, is it possible to render a String containing HTML (e.g. <h1>News</h1><p>News text</p>) in a JTextPane showing the String as rendered HTML? Thanks! Stefan Lintner schrieb: > Hi, > > is it possible to render a String containing HTML (e.g. > <h1>News</h1><p>News text</p>) in a JTextPane showing the String as > rendered HTML? > > Thanks! Sure, it is as simple as this: JTextPane textPane = new JTextPane(); textPane.setContentType("text/html"); textPane.setText("<h1>News</h1><p>News t...

Simulating a paste
Hi, I want to write a small utility that detects when I press a certain key combination and the pastes a given text into the active window handle. What's the best way to simulate this pasting? The ideal solution for me would be to send rtf and ascii text and let the window chose which one it supports. Thanks, Fernando On Tue, 8 May 2007 08:07:45 +0000 (UTC), Fernando Rodriguez <fernandoREMOVE_THIS@easyjob.net> wrote: > >Hi, > >I want to write a small utility that detects when I press a certain key combination >and the pastes a given text i...

Richtextbox copy-n-paste formatting problem
Hey, all, I have a problem I'm trying to solve that's causing me fits. I wrote a simple program in VB that allows a user to select a font and font color in a Richtextbox. The goal here is to enable the user to select a font and color easily and then copy and paste that formatted text into a new e-mail message in Outlook Express (OE). OE won't save custom colors and my program will, so that's why I need this functionality. If I put a word in the text box, say, "Hello", and format it with, for example, the Helvetica Font in some particular color, and then copy and pa...

JTextPane
Hi everyone, I am currently trying to serialize parts of a jtextpane using the java ObjectOutputStream to write it to disk and when i am reading the object back i am using the java ObjectInputStream. When i read the api about the streams here is what they say Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.bean...