How To set cut/copy/paste for JtextArea
Hai
i could not able to set cut copy paste in JTextArea
pls help me in this filed..
thanx.
This will do...... :)
private Hashtable actionHash = new Hashtable();
Action ac[]=new Action[3];
JButton butt[]=new JButton[3];
int count=0;
String ac_names[]={DefaultEditorKit.cutAction,DefaultEditorKit.copyAction,DefaultEditorKit.pasteAction};
Action[] actions = YourTextPane.getActions();
for (int i=0; i<actions.length; i++)
String name = (String)actions.getValue (Action.NAME);
actionHash.put(name, actions[i]);
for (int i=0; i<actions.length; i++)
ac[i] = getHashedAction(ac_names[i]);
butt[i]=new JButton(ac[i]);
protected Action getHashedAction(String name) {
return (Action)actionHash.get(name);
Similar Messages
-
How to hide cut/copy/paste/Replace… menu on the UIWebView when it is being displayed over the keyboard.
Detail: I am having a HTML from, having text box, displayed using UIWebView. If user types in text box it shows the keyboard. Now If user tap and hold on text box it shows a popup menu. Now while keyboard and pop up are being displayed user scrolls the view. At this time it shows pop up over the keyboard which I need to hide.
I tried setMenuVisible of UIMenuController when popup rect and keyboard rect intersects each other on viewDidScroll but it didn't help me.
Any clues will help a lot.
Thanks.You are more likely to get an answer if you post programming problems to the Developer forum. This forum is intended for normal user level problems.
-
How do I disable copy/paste for most (but not all) of a .pdf?
Hello, I'm trying to create a .pdf document that is a "how-to" guide. I'd like to disable copy/pasting from 95% of this document, with the exception of a few sections that i'd like my users to be able to copy and paste and use as email templates. I've gone ahead and set pasword security settings and un-checked the box for "enable copying of text, images, and other content". Is there any way that I can enable copy/paste for just a few small sections of my document? or is it an "all or none" function?
Thanks in advance for your help. -GeoffGraffiti, Can you please expand on that? I'm using Microsoft Word as my original document. I'll have mostly paragraphs of non-copyable text, with a few sections that contain sample email templates that will be copyable. Example below. Thanks, Geoff
Here is my description of an amazing new process written in Word. To use this process, copy the email template below and customize with your own name.
Email Template
Dear John,
Copy this email and send it with your own name.
Thanks,
Geoff
More non-copyable text. -
How to add cut,copy,paste functionality ?
Hello everybody,
I have to add cut,copy,paste functionality to my RichTextEditor for which I have already added
buttons to editors toolbar,Now I want to add these three functionalities to my editor.
Can anyone tell me or provide me some code sample for it ?
ThanksWell Thank you for your response,What I am looking for is ,the user should be able to copy,cut and paste the selected text anywhere,
(e.g.If user selects the text and clicks the COPY button on the RichTextEditor , he can copy that selected text into notepad or any other editor or any other place in the system)
I have written the code for copy and its working properly
System.setClipboard(richTextEditor.selection.text);
I was wondering how to write the code for cut and paste.
many thanks again -
how do I set default
copy func. to ctrl+insert
paste function shift+insert
to a textfield in java 1.5Quit multi-posting the same question:
http://forum.java.sun.com/thread.jspa?threadID=5183891&tstart=0 -
How do you cut, copy & paste on an iTouch?
I can't figure this out. Please help!
Hello there,
I would check out pages 27 & 28 of the manual. They provides instructions for copy, pasting, and cutting.
http://manuals.info.apple.com/enUS/iPod_touch_3.0_UserGuide.pdf
B-rock -
Need Cut/Copy/Paste Actions when Right click on JTextArea,JTextField
How to Implement Cut/Copy/Paste from Contextmenu in JTextFeilds and JTextAreas.
Thanks and Regards,
PavanKrsUntested code, may take some massaging to work, but this is the gist of it:
JPopupMenu popup = new JPopupMenu();
JMenuItem item = new JMenuItem(new DefaultEditorKit.CutAction());
item.setText("Cut");
popup.add(item);
item = new JMenuItem(new DefaultEditorKit.CopyAction());
item.setText("Copy");
popup.add(item);
item = new JMenuItem(new DefaultEditorKit.PasteAction());
item.setText("Paste");
popup.add(item);
textField.setComponentPopupMenu(popup); -
JTextPane- cut,copy,paste
hello,
In a JTextPane how to do cut,copy & paste. The selected text will have different attributes(bold,color etc)
-anuIt doesn't work.
they r just calling JTextComponent's cut ,copy & paste mds. It is working without styles(bold, italic etc..).
anyway thank u
-anu -
How do I cut and paste sets of lines for use in various Math questions?
How do I cut and paste sets of lines for use in various Math questions?
Thank you for your reply. My problem is much simpler than you are thinking. As a teacher I prepare sheets with random number generators.
EG. 256 + 389= ______ or 467
- 384
469 + 753= ______
or 5)750
On a PC I was able to start a page of A4 with one set and then drag and drop down and across the page.
On my Macbook I can get the numbers in but the lines do not copy. I asked at one of my One to One sessions and it had my 'trainer' stumped. He said he would make enquiries but so far no news. I am using Numbers.
I hope I have explained my 'problem' satisfactorily. -
I recently have been having problems with my Firefox 4 tool bars. Right now, the Edit icons are no longer on the tool bar, specifically Cut, Copy, Paste, and Print. If there were other Edit icons, they too are gone. All the other icons have remained.
I would appreciate it if you could advise me how to reinstall those specific icons.
Also recently, ALL my tool bars, and task and status bar disappeared. This was only in Firefox 4.0; IE 8 was not affected. Clicking F11 did not work. I could not function without them. Then, a short time later, they "automatically" reappeared. I have not idea of why the disappeared or reappeared.
Thank you for any help you can provide.
Sanford A. BermanYou can find the Copy, Paste, and Cut buttons next to Firefox > Edit (and in its sub menu) and in the regular Edit menu on the menu bar (press F10 if the menu bar is hidden).
The buttons next to Firefox > Edit are enabled if there is something to do with them, just like with the toolbar buttons.
You can find the Copy, Paste, and Cut toolbar buttons in the toolbar palette in the Customize window and drag them on a toolbar.
Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"
*http://kb.mozillazine.org/Toolbar_customization
*https://support.mozilla.com/kb/Back+and+forward+or+other+toolbar+items+are+missing -
Undo/Redo for Cut, Copy, Paste
I am trying to implement Undo/Redo for Cut,Copy,Paste in a Treetable.
I have to support undo/redo for multiple nodes being cut/copied. I am not sure how I should be going about implementing this. Any help will be greatly appreciated.
ThanksIf the class you are using doesn't support cut, copy, and paste already, usually what you do is store a list of actions in two lists. One for actions done, the other for redos (when there is an undo). Capture the data before and after each operation (you can create a KeyListener to listen for the events) and store that in a list. When undo is called, the last element on the list should be undone, either by taking it out of the list and reiterating through the elements still there, or implementing an undo method in the object you are trying to change. Then put that element on the redo list in case that is called. This works well with graphics and stuff, but I never tried to implement it in a tree with nodes and stuff, so that's about the most I can help with right now. I hope it helps some!
-JBoeing -
[CS3] How to cut/copy/paste text frame without link
Hi All,
Please tell me how I will cut/copy and paste text frame with ignoring or removing links of text frame.
After copying, the original text frame must contain its link but the newly create text frame should contain any link.
Thanks,
Aman Alamhey thanks for responding. pasting through text edit works, but if i just copy from the quote block and paste in the top of the message body, it keeps the quote formatting. if i Paste as Quotation, then it double-quotes it--two side bars...
i guess part of the problem that i just realized, too, is that Mail must convert a message to rich text if you choose to quote text in a reply. because otherwise it could not possibly color the text, right? when i paste out of Mail and into Text Edit, the text color i saw in mail is preserved, meaning the text itself must contain formatting data (rich text).
is there no way to reply to a mail and include the previous message as a quote without switching to rich text? -
How do i cut and paste in thunderbird for windows 8?
i don't know how to do it.
How do you cut and paste in other programs?
* Select: use cursor keys and shift, or drag over with the mouse
* Copy: ctrl+c, or right-click|Copy
* Paste: ctrl+v, or right-click|Paste
It doesn't make sense to cut; you wouldn't want to damage email messages, surely? -
With PS 7
create new
Place two objects on the new file
then you may cut copy and paste
Cs2
create new
place two object on the new file
Cut is not available how does one cut and paste in new fileIf your using File>Place then photoshop cs2 creates what's known as Smart Objects, which photoshop 7 didn't have.
In photoshop cs2 you can rasterize the smart objects and that should make the Cut function available.
Select both placed layers, right click on the area to the right of the tumbnail and select Rasterize Layers.
If in photoshop cs2 you to Help>Photoshop Help and look under Layers>Smart Objects, that should give you a good overview of what smart objects are. -
How to add Cut,Copy and Paste
May not seem as easy as we'd all like to believe in an iPhone.
It needs to be somewhat intuitive and can not break the existing tap/slide/2-finger-stuff mold.
So, here's a proposal:
Tap-and-hold then a second-finger tap could launch a pop-up area which could contain the obvious editing commands (cut, copy, paste) This popup could also contain a round-robin area containing the last 'N' OBJECTs that have been 'copied.'
I say objects because it would be great if it could hold TEXT, IMAGES, SOUNDS, EMAILs, etc.
And now we need a nice way to easily "select" such 'objects' ... perhaps that same menu could contain "Begin Select" and "End Select." (Yeah, I know that's really archaic... and only works sorta for TEXT, and makes the popup thing so modal as to be very troublesome.)
I'd like to hear other's thoughts on this... mabe you guys experimenting with the new SDK can offer up something for CutCopy&Paste ??
thanks,
tobHere is an easy way (in theory, anyway) to implement text selection:
Replace volume control button functionality by 'freeze' functionality.
At least for me volume control buttons are useless, but I would LOVE to have copy-paste. It could be let for user to decide (settings), if he/she wants to use volume button either for volume control or freezing the screen, or this functionality could be made context sensitive: when you are in 'text-mode' (Safari, eMail, etc.) volume control button will work as freeze, when you are in 'phone mode' or 'iPod mode', it acts as volume control. This modification could be made by adjusting OS, no need to add new buttons or other HW changes.
Using this feature would be simple: if you want to select text, you push 'freeze' button, and then moving your finger in the screen won't scroll it down or sideways but lets you select the text. Selecting text downwards below bottom screen limit could scroll and select text further. When text is selected, clicking the text should pop-up contextual menu with copy-paste, and other relevant commands.
I have emailed this suggestion to Apple.
Maybe you are looking for
-
LR 2.5 slows down after upgrading to Snow Leopard
This is my first post, so first of all I'd like to say hello to everybody here and apologize for my poor english My computer is an iMAC with an Intel Core 2 Duo, 4GB RAM, 500GB HD and a graphic card NVIDIA GeForce 8800 GS with 512 MB VRAM. The LR dat
-
Using MySQL data source in OWB
Hi All, I need to use a MySQL data source in OWB. Could you please tell me the steps needed to define and configure the MySQL module in OWB? Thanks and Regards, Amit
-
Loading, playing in "sync" multiple videos with OSMF
Hi All, I've just started to use OSMF in a Flex project. I was wondering if it was possible to manage loading 2 videos with OSMF, start playing both videos when they're both downloaded (or when there's enough data downloaded to play them both) Both v
-
Problem in calling rsh command Please help......
hi, I want to execute some commands on unix through java, for this i want to run my program simulataneously on differnt machines so that i get data to compare. I think i have to invoke the rsh command with the machine name for it but it is giving err
-
Using iWeb HTML code with email autoresponder software
Hi, I'd like to be able to use iWeb html code with an email autoresponder package, however, the text in the resulting emails is unformatted and has no images. My chosen company,AWeber, haven't been able to solve this yet for me (I've tried all the ma