How to Copy a value of a String to the RAM memory?
Hi there,
I was wondering how to copy a String into the ram memory (consider you're doing right click on THIS word and choose 'Copy'; the String's Value will be to the ram memory for a later Paste).
In my application, a user has a table and he right click on it and choose Copy. I get the value of the item (Obj) but face dificulties to add it to RAM.
my code looks like this:
if (obj!=null) //inside I have the value (say: 12345 --< Obj.toString)
Action copyAction = TransferHandler.getCopyAction();
int id = ActionEvent.ACTION_PERFORMED;
String name = (String) copyAction.getValue(Action.NAME);
long l = EventQueue.getMostRecentEventTime();
copyAction.actionPerformed(new ActionEvent(XXXXXXX, id, name, l ,0));
///what comes in the XXXXXXX
}I tried, instead of the XXXXXXX, to put Obj or Obj.toString but...nothing.
Anyone?
Thanks,
should implement ClipboardOwner
and do this:
StringSelection stringSelection = new StringSelection( obj.toString() );
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents( stringSelection, this );
@Override
public void lostOwnership(Clipboard clipboard, Transferable contents)
//do nothing!
}
Similar Messages
-
How to copy NCLOB value(Contains Word Document) into file system
How to copy NCLOB value(Contains Word Document) into file system or display in sqlplus
The UTL_FILE package will write it only to text file not(NCLOB Value[containts images as well as text])
-
Can u tell me how to convert int value in to string
hi to all, can u tell me how to convert int value in to string.
hi to all, can u tell me how to convert int value in
to string.Even this way:
int number = 155;
String mystring = ""+155;
[\code] -
How to copy videos from iPhone to iPhone? The videos are in QT format and were taken using the iPhone camera.Help me, anyone? Thanks in advance.
Just to add.....I created a folder on my PC to store all videos taken from my iPhone and my wife's iPhone.
I just cannot sync those videos taken using my wife's iPhone to my iPhone. -
How do you log values from RT target to the computer?
Hi,
I am using sbRIO 9633. How do you log values from RT target to the computer?
I created a shared variable on the RT target and used them on the log VI created under "My Computer", but I get error.
I get this error..
\\192.168.1.140\temp deployment failed (error: -1967357949, IAK_SHARED: (Hex 0x8ABC8003) Unable to query Measurement & Automation Explorer for the Shared Variable Engine. Make sure the Shared Variable Engine exists on the RT target and check that the network connection is valid.).
kdmWhat are your data rates? If you are producing data "continuously", you might find that Network Streams are easier and more reliable than Network Shared Variables. In any case, you need an "engine" on one side (Host or Target) or the other. I'm streaming 24 channels of 16-bit data from a PXI controller to a PC this way, with three other streams handling two-way messaging and transmission of "occasional" time-stamped data to the PC.
Bob Schor -
How I can cancel sms/emails that remain in the iPhone memory after being deleted?
How can I cancel sms/emails that remain in the iPhone memory even after being cancelled?
ThanksTo better explain...Randomically, sms and emails deleted remain on the iPhone/iPad memory and can be found throught the "Search" function....How to permanently delete such files from memory?
-
How can i store values from my String into Array
Hi guys
i wants to store all the values from my string into an array,,,, after converting them into intergers,,,, how i can do this becs i have a peice of code which just give me a value of a character at time,,,,charat(2)...BUT i want to the values from String to store in an Array
here is my peice of code which i m using for 1 char at time
int[] ExampleArray2 = new int[24];
String tempci = "Battle of Midway";
for(int i=0;i>=tempci.length();i++)
int ascii = tempci.charAt(i); //Get ascii value for the first character.public class d1
public static final void main( String args[] )
int[] ExampleArray2 = new int[24];
String tempci = "Battle of Midway";
for(int i=0;i<tempci.length();i++)
int ascii = tempci.charAt(i);
ExampleArray2=ascii;
for(int i=0;i<ExampleArray2.length;i++)
System.out.println(ExampleArray2[i]); -
How can i convert values in my string to ascii characters
Hi guy.
I am wrinting a code but i m stuck, I have a string with (Battle of Midway) in it, Now i want to convert each character in this string with the asci character,,,
String temp = {"Battle of Midway"};
so the ascii will be:
B=66 a=97 t=116 l=108 e=101 o=111 f=102 M=77 i=105 d=100 w=119 y=121
i found all these number for all the charachers, but i donno how to covert this string into ascii characerts... ofcurse i can do it one by one...but is there any class or method i can use for this,,,,, Once i convert all the character (from string) to ascii character THEN i have to convert it back from ascii to character,,
Is anybody has any idea
Thanks alot in AdvanceYou get get the ascii code for those characters by doing something like:
int ascii = str.charAt(0); //Get ascii value for the first character.
Kaj -
How to trim decimal values in a string?
Hi
How do i trim decimal value in a string..
suppose i have 1.00, i want it to be displayed as 1
Is there any Round off functionality in WD ABAP?
Regards,
Puneethi,
Try using the mathematical function abs().
ABS( VAR1 ). Which will return the numeric value only.
Thanks
Yogesh -
Hi Numbers users,
I am trying to get Numbers 2.3 on OS X (10.9.1) to convert cells containing variable length strings composed of 6 letters, A, B, C, a, b, c into a second string containing the same 6 lettersusing the rule A to c, B to b, and C to a and vice versa, so for example cell A1 might contain string "AcBbCaaB" and I want Numbers to convert this into "cAbBaCCb" in cell B1. I have tried to use the SUBSTITUTE function (nested) without success so far as I end up with the letters either all uppercase or all lowercase. I understand why this is happening and maybe it isn't possible using SUBSTITUTE. Does anyone know if there is another function I can use to do this?
Thanks, Hugh.you can use this method:
Add a new table, called "Translator", show as the bottom table:
Enter the data in columns B anc C as shown
cell A1 contains:
"=CODE(B1)"
select cell A1 and fill down
For the table on top enter your code in column A. The converted code will be in column B. Make sure there are enough columns (I went out to column AD):
B2=R2&S2&T2&U2&V2&W2&X2&Y2&Z2&AA2&AB2&AC2&AD2
C2=LEN(A2)
D2=MID($A2, COLUMN()−2, 1)
select D2, copy,
select cells D2 thru P2, paste
R2=IFERROR(VLOOKUP(CODE(D2), Translator::$A:$C, 3, 0), "")
select R2, copy,
select cells R2 thru AD2, paste
select B2 thru AD2 and fill down as needed
You can hide columns C thru AD -
02-03-2012
For last one week, I have been trying in vain to copy and paste a document typed in the Epic Write on a Word 2007 format, so that I can retrieve or modify it anytime without depending on the Internet connection. Whenever, I paste on a webpage, it cannot be edited and when I transfer that on a Word page, only words & figures in English appear and the rest of the text is displayed in blank square boxes.
How I can overcome this problem?Are that pages in Unicode?
*[http://kn.wikipedia.org/wiki/%E0%B2%95%E0%B2%A8%E0%B3%8D%E0%B2%A8%E0%B2%A1] -
How to pass a value from jspx page to the managed bean
hi,
i have created a jspx page and manages bean with page flow scope..
in my jspx page i am searching a employee record from the data base . and getting entire employee details including 'status' as a search result.
here i want to pass the value of 'status ' field to the managed bean variable called 'stval'.
can anybody suggest any solution?.......As per the details provided in the post above, when the user clicks on the search in the af:query, the results are populated in the table. And you are interested in getting the value of particular column. This could be done by having the custom row selection listener to get the value of the current row (selected row in the table).
1) Have a custom selection listener:
<af:table value="#{bindings.EmpDeptVO.collectionModel}" var="row"
rows="#{bindings.EmpDeptVO.rangeSize}"
emptyText="#{bindings.EmpDeptVO.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.EmpDeptVO.rangeSize}"
rowBandingInterval="0"
rowSelection="single" id="t1"
partialTriggers=":::qryId1 ::ctb1 ::commandToolbarButton1"
columnStretching="column:c1"
styleClass="AFStretchWidth" columnSelection="multiple"
first="0" contentDelivery="immediate" autoHeightRows="10"
binding="#{pageFlowScope.ExampleBean.searchResultsTable}"
*selectionListener="#{pageFlowScope.ExampleBean.rowSelected}">*
2) In the method, set the current row programmatically:
ADFUtil.invokeEL("#{bindings.EmpDeptVO.collectionModel.makeCurrent}",
new Class[] { SelectionEvent.class },
new Object[] { selectionEvent });
3) Get the current row and get the required attribute values and set it in any of the variables in the managed bean:
Row selectedRow =
(Row)ADFUtil.evaluateEL("#{bindings.EmpDeptVOIterator.currentRow}");
String status = selectedRow.getAttribute("Status");
Thanks,
Navaneeth -
How to compare, current value in :block.text_item with the database value
Hi
Could you please tell me
How to compare the current value in :block.text_item with the corresponding database column value.
I am using forms 10g
There is block and there is an text Item in that block.
When I run the form and query the block (tabular), the :block.text_item shows me, whatever value there in the database.
Now I add some value in the :block.text_item to the existing value.
now
the :block.text_item contains old+ new added value
whereas
the database table contains 'old' value
Now on a button click , I want to find out what is the value that I have added
Could you please tell me, is it possible without writing a select query?Hello,
Now on a button click , I want to find out what is the value that I have addedSo you mean always user will add value in the existing value. Because this way will fail in one case. Let say
Value in Database is = ABCD
User opened the form and he removed the D and write E and now value is ABCE and length is still same 4. So, there is no addition.
Anyway you can know the database value at runtime there is one property for item called DATABASE_VALUE. It gives the value which is in database while you are running the form before save. and you can use like this..
Trigger = WHEN-MOUSE-DOUBLE-CLICK on item level
DECLARE
vItemValue DATATYPE; -- Set the data type according to your desired field.
vValueAdded DATATYPE; -- Set the data type according to your desired field.
BEGIN
vItemValue:=GET_ITEM_PROPERTY('ITEM_NAME',DATABASE_VALUE); -- It will return you the database value in vItemValue variable.
IF LENGTH(vItemValue)>LENGTH(:FORM_ITEM_NAME) THEN -- It mean something change or added
vValueAdded:=SUBSTR(:FORM_ITEM_NAME,LENGTH(vItemValue)+1);
MESSAGE('Added value is : '||vValueAdded); -- It will show you the added value.
END IF;
-- now suppose you want to show the old and new value in message not the added one
-- Then no need of IF condition. You can just use message like this
-- And i would prefer to use like this way
MESSAGE('Old Value : '||vItemValue||' New Value - '||:FORM_ITEM_NAME);
MESSAGE('Old Value : '||vItemValue||' New Value - '||:FORM_ITEM_NAME);
END;Hope it is clear.
-Ammad -
How do you change values after logging data to the citadel database (DSC)?
How would one go about changing values that already exist in the citadel database. So say I were logging a numeric value with a timestamp for 1 year and then wanted to change a few values for the month of June because my sensor wasn't working at that time. How could I do this? Is it possible without re-creating the whole database over?
Thanks
Mattmattyk wrote:
Hey Ben,
Thanks for the quick response. I called NI and asked about this because this would be a big show stopper for me. Their applications engineer said that the best way to change previous data would be to read in the trace that you want to change, modify it and save it as a new trace. I am also looking into SQL querying. I was able to connect to the citadel database by setting up a ODBC data source and using the database connectivity toolkit to query the database. This worked. Now I am trying to come up with a statement in SQL to change previously saved data. I'll Keep you posted.
Thanks
Matt
That reinforces my suspicions.
I have an app running for about 8 years now that keeps a paper trail to enusr ethe cartdiges used in respirators (operated NIOSH National Institute of Occupational Safety and Health par teh CDC) that use DSC to enusre nobody can ever falsify those records. If they can be hacked I my customer and anyone using a respirator with a NIOSH sticker on the side of it, want to know.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
How to enter a value versus picking one from the pop-up menu?
I am new to numbers and am using version 3.5.2. I understand one can define a Pop-Up for cell value selection, but what if I want to also be able to specify a value that is not in the pull down? I thought "start with blank" would do the trick, but it won't let me enter any values. Thanks in advance for your suggestions!
Hi Sultry,
If your entry is a one time deal you could just delete the cells value and type in your choice. If you want to update your popup you need ot redefine its values. And then of course replace your old popups with your new one.
quinn
Maybe you are looking for
-
I purchased music from iTunes, but it does not show up in my "Purchased" file on my computer, but they show on my iPhone. Why can't I get them on my iPod?
-
I uploaded photos in .jpg format to my iPad, but now all of those photos appear as .ithmb files and cannot be opened, even on the thumbdrive they originated from. How do I get them back to .jpgs?
-
Date&Time takes a long time to load
Hi I'm getting really frustrated, becasue everytime I want to look at the calander in the date and time utility, I try and open it and it takes AGES to open. Please help, what can I do to fix this???
-
NFC after update to 10.2.1.537
I have done the update to 10.2.1.537 on the day it came out in Canada, and I noticed that if the phone is lock the NFC is not working even with the setting for the NFC is set to work "When locked or backlight is off" and "When device is turn off", an
-
About 6 months ago when it was time for me to renew my phone I was told that I would have to pay $29.99 for my data package for my Droid. That makes 4 out 5 phones on our family plan paying $29.99 each! When is Verizon going to get with the program a