Dragging only a portion of data from a cell?

I'm working on a scheduling program (using Java/Swing) that simply has several tables that I drag and drop information pulled from a database. In one table I have it set up so that the user can drag multiple data (people�s names) into a single cell (just concatenate the new name with the existing names). However, I now need the ability to drag a specific name outside the table (to delete it). Since I treat the contents of the whole cell as one big string, I'm stumped as what to do next. I'm new to Java, but have been reading about custom renderers and was wondering if it would be possible to write one that would work in my situation. I'm also open to any other ways that would make specific selection possible. So far this is what has been suggested:
- find a method of detecting which name is underneath the mouse when a cell is clicked on. You'd need a custom table model such that every cell returns some collection of custom objects representing each name.
- write a cell renderer so that you can highlight specific names in a cell when the mouse is clicked on one
- add your drag and drop code using the above two features
Any help would be greatly appreciated.

I'm working on a scheduling program (using
Java/Swing) that simply has several tables that I
drag and drop information pulled from a database. In
one table I have it set up so that the user can drag
multiple data (people�s names) into a single cell
(just concatenate the new name with the existing
names). However, I now need the ability to drag a
specific name outside the table (to delete it). Since
I treat the contents of the whole cell as one big
string, I'm stumped as what to do next. I'm new to
Java, but have been reading about custom renderers
and was wondering if it would be possible to write
one that would work in my situation. I'm also open to
any other ways that would make specific selection
possible. So far this is what has been suggested:
- find a method of detecting which name is underneath
the mouse when a cell is clicked on. You'd need a
custom table model such that every cell returns some
collection of custom objects representing each name.
- write a cell renderer so that you can highlight
specific names in a cell when the mouse is clicked on
one
- add your drag and drop code using the above two
features
Any help would be greatly appreciated.I made a cell renderer that is a JPanel subclass that stores JLabels (each representing a name) and the labels will be laid out using a FlowLayout in the panel - that way the names "wrap" in the table cell. Now I need to create a method in my JPanel subclass to return which component is at (x,y), and highlight that component in my renderer getCellRenderComponent() method.
Any ideas how to implement this method?

Similar Messages

  • Verizon is using the Elipsis tablets to steal data from their customers.  The only way to stop data from registering as cellular data is to pull the SIM card.  This occurs with wifi enabled and cellular,dara disabled.  If,you take your tablet to a Verizon

    Verizon is using the Elipsis tablets to steal data from their customers.  The only way to stop data from registering as cellular data is to pull the SIM card.  This occurs with wifi enabled and cellular,dara disabled.  If,you take your tablet to a Verizonstore they will upgrade your data plan to cover the overage and credit the upgrade.  You will then have to remember to downgrade your plan or continue to pay for more data.  Verizon, how would you feel if I walked into one of your stores and started filling my pockets with merchandise?  If cought can I just give the product back and say "oops, sorry"

    Today, my FCC complaint hit the same person working on the BBB complaint.  Jimmie has been very nice and seems willing to work with this problem.  We have been able to come to an agreement.  I paid the purchase price for the phone and he returned my upgrade and unlimited data plan.  This is what would have occurred if Verizon had given me correct information to begin with.  I am happy with this result.  He also brought quite a few instances concerning the handling of my transfer and upgrade that did not follow proper procedure.  I am also confident that I would not have resolved this without complaining to BBB and or FCC.  Verizon had no interest in solving the problem nor did they show any propensity to keeping a 20 year client.  Even though this last CSR was very polite and helpful, his sole job is to respond to formal Federal and State complaints.  He is required by law to address every complaint and report the reporting agency the agreed upon results - good or bad.  Again, I suggest - If you are not getting the proper customer service, complain to someone outside of Verizon.  Jimmie had not received any complaints registered with Verizon directly and I still have not had any contact with any other management representative that I was told would call.

  • Deleting data from multiple cells

    I am new to Numbers. I have managed to complete our club accounts for 2009. Then I have saved them As and renamed the project for 2010.
    How do I delete all data from the cells, leaving all the formulas in place, so that I can enter new data for 2010.
    Mike

    Select the cells with data, press delete.
    Select a group of cells in a contiguous block by clicking in the top left cell of the block, then dragging down and right to select the rest of the cells in that block.
    Select non-contiguous cells by clicking in the first cell then holding the command key and clicking other cells to ad them to the selection.
    Take care that you do not add cells containing formulas to the selection as you cannot lock individual cells to prevent content deletion.
    Once you have stripped the old data from the document, I would suggest saving it as a Template. Then you will be able to simply open the template each year and start adding that year's data.
    Regards,
    Barry

  • How can I create a diagram where equal data from different cells will be added to one sector?

    Hi,
    I'm a new Mac user, so I have a lot of problems and questions every day. Moving to Mac from PC is not an easy thing)
    Here is my problem:
    I need to create a few diagrams for my science work, but can't correct one mistake. Every time one data from one cell from the table takes its own place in the diagram. But I need to ceparate equal data to show it is one section.
    An example:
    Sex
    Age
    Female
    18
    Female
    18
    Female
    18
    Female
    25
    Female
    30
    We need to create a diagram to show that we have
    60% - 18 years
    20% - 25 years
    20% - 30 years
    But Numbers doesn't show it that way. Here how it does:
    So please help me. How can I do that?

    Hi ProCauda,
    Some example data of people and their age:
    The COUNTIF function will give the number of people of each age.
    In another table, B2 contains this formula (and Fill Down to the bottom of B)
    =COUNTIF(Table 1::B,"="&A2)
    In this example, 3 people are 18 years old, 0 people are 19 years old, and so on. Use this table to calculate each age as the % of the total, then use that as the data for your diagram (graph, chart).
    Regards,
    Ian.

  • Non-.CSV format:  expand data from one cell to many

    I would like to expand this data from one cell to many where each space is the delineator as well as the /slash.
    Example data: 
    Mr. Bernardo Mestido/Portugal
    Ms. Renata Sateel/Germany
    -Thank you for any help!

    Here is a simple script which does the trick :
    --{code}
    --[SCRIPT exploder ]
    Yvan KOENIG (VALLAURIS, France)
    2011/09/19
    on run
    Here the clipboard contains the datas to 'explode' *)
              my remplace(the clipboard as text, space, tab)
      set the clipboard to my remplace(result, "/", tab)
    Now you may paste in a table *)
    end run
    --=====
    replaces every occurences of d1 by d2 in the text t
    on remplace(t, d1, d2)
              local oTIDs, l
              set oTIDs to AppleScript's text item delimiters
              set AppleScript's text item delimiters to d1
              set l to text items of t
              set AppleScript's text item delimiters to d2
              set t to l as text
              set AppleScript's text item delimiters to oTIDs
              return t
    end remplace
    --=====
    --[/SCRIPT]
    --{code}
    Yvan KOENIG (VALLAURIS, France) lundi 19 septembre 2011 23:06:15
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Selecting data from a cell in a table

    I want to be able select data from a cell in a table by looking up a specified header row and header column. For example, if my table has column headings of "Micro", "Emerging", and "Large" and my rows are labeled "Silver", "Gold", and "Platinum", how do I find the data in the table that is associated with column "emerging" and row "Platinum"?

    I thought that pointing to the User Guide was clear enough but it seems that it wasn't.
    Assuming that you have a spreadsheet with two sheets.
    The first one is named "jardin"
    it contains a table named "potager"
    a column header of this table is "carotte"
    a row header of this table is "longue"
    The cell of row "longue" of column "carotte" contains "cuite"
    The other sheet is named "garden"
    it contains a table named "potager"
    the column header of column 3 of this table is "carotte"
    the row header of row 5 of this table is "longue"
    In cell E10 of this table insert the formula :
    =INDIRECT("jardin"&" :: "&"potager"&" :: "&"carotte"&" "&"lapin")
    It will grab the value of row "lapin" of column "carotte" of table "potager" of sheet "jardin"
    This result is "cuite"
    I hope that now you are able to achieve your goal which we may write, in French :
    Les carottes sont cuites.
    Yvan KOENIG (VALLAURIS, France) lundi 7 juin 2010 16:59:52

  • I was given a 2010 17" MacBook Pro. I want to reset it to new and then migrate only SOME of my data from my older Mac Book Pro to the newer one. How?

    A friend gave me a 17" MacBook Pro used for only one project. (Lucky me) I want to reset/register the laptop as new and need to know how to do that.
    THEN...
    I need to migrate data from my older Macbook Pro to the newer one. I don't want to migrate all of the data. I have been moving data from one computer to another for 15 years and want to move only what is current and what I now need (Good-bye Quark files)--can I do that? How? Also, the older laptop is running Lion. The "new" one is running Leopard. Is that an issue? Do I need to upgrade the newer laptop to Lion first?
    Thanks.

    Install or Reinstall Lion from Scratch
    If possible backup your files to an external drive or second internal drive.
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Erase the hard drive:
    Select Disk Utility from the main menu and click on the Continue button.
    After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area.  If it does not say "Verified" then the drive is failing or has failed and will need replacing.  SMART info will not be reported  on external drives. Otherwise, click on the Erase tab in the DU main window.
    Set the format type to Mac OS Extended (Journaled.) Click on the Erase button and wait until the process has completed.
    Quit DU and return to the main menu.
    Reinstall Lion: Select Reinstall Lion and click on the Install button.
    Note: You can also re-download the Lion installer by opening the App Store application. Hold down the OPTION key and click on the Purchases icon in the toolbar. You should now see an active Install button to the right of your Lion purchase entry. There are situations in which this will not work. For example, if you are already booted into the Lion you originally purchased with your Apple ID or if an instance of the Lion installer is located anywhere on your computer.
    Unfortunately, Setup Assistant or Migration Assistant are set up to migrate your entire Home folder, third-party applcations and support files, and system preferences. If you use the Setup Assistant that opens the first time you boot Lion after installing, then you should migrate your Home folder, etc. This is the easiest way to do it.
    Once migration is finished you can delete what you don't want.

  • Run a formula if a cell contains particular data from various cells

    I have a formula which checks a list of domains to see what the TLD is and then returns a renewal price based on the TLD e.g. .co.uk may return with $5.99 and .com $10.00. The formula I am using is below:
    =VLOOKUP(RIGHT(A2,LEN(A2)−SEARCH(".",A2)+1),$A:$B,2,FALSE)
    I am now wanting to expand this formula to check additional criteria before running the above formula.
    I don't know what functions to use, but I know what I'm trying to achieve, so please, humour me when it comes to make believe syntax below:
    if a cell contains the data from a number of cells e.g. C$2:C$5 then run the above formula, if not return "N/A"

    Hi Ian,
    Thanks for your reply.
    I see exactly where you're going with this, but it's not exactly what I'm after.
    Perhaps I need to be a bit more clear in my explanation - my bad.
    Cell A2 has a domain name e.g. example.com, example.co.uk, example.org, example.net
    Cell B2 has a number of options to choose from e.g. Expire, Hosting, Backorder, Mapping
    Column D2:D5 have a number of TLDs e.g. co.uk, .com, .org, .net
    Column E2:E5 have the corresponding annual renewal prices for the TLDs listed in cells F2:F5
    Column F2:F5 have the options than can be chosen in column B2
    I only want to get the renewal price for the TLD where the option in Cell B2 is one of the options listed in cells F2:F5 and if it's not, I want it to return "N/A"

  • Formula to trim off data from another cell after

    Wonder if anyone can help.  Ive got some address columns im editing in Numbers. Unfortunately,( common problem I know!), not all the date in the cells are uniform.  For example: E2 may have  '123 Alphabet Street', whereas E3 might have '123 Alphabet Street, London'.  Im trying to write a quick formula where I can trim off any data after the ',' into another column called Town.
    Im going to continue to scroll through this forum to see if this has been dealt with before, and look on Iwork Help. But in the meantime.. if anyone could give me a pointer that would be ace.
    Thanks

    You'll need two columns, one for each part of the split.
    Original data in column B, Street address in column C, City in column D
    C:   =IFERROR(LEFT(B,FIND(", ",B)-1),B)
    D:   =IFERROR(RIGHT(B,LEN(B)-FIND(", ",B)-1),"")
    Regards,
    Barry

  • Drag and drop to view data from database

    hi,
    totally new to dreamweaver cs4, had some real helpful pointers already on there forums so thanks.
    i was wondering, how can you drag and drop in dreamweaver cs4 to display contents of a mysql database? i have worked a bit with .net vwd in past and you dragged over say a list view to display data and really just want to be able to do the same in dreamweaver cs4 but not sure what it would come under in the php menu bar or data option in menu bar?
    can anyone point me in right direction?
    many thanks
    andy

    deansy55 wrote:
    i was wondering, how can you drag and drop in dreamweaver cs4 to display contents of a mysql database?
    Read the Help pages starting here: http://help.adobe.com/en_US/Dreamweaver/10.0_Using/WScbb6b82af5544594822510a94ae8d65-78d3a .html.
    There's also a tutorial here: http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html.
    Basically, you create a recordset, and then drag the results from the Bindings panel.

  • Show only logged in User Data from the cube

    Hi,
    Suppose I have couple of customers' data in the cube. And these customers are some BW users. Now, i wish my query should display data only for the customer/user who has logged in. The query could be created by any user.
    Is this possible in a web report?
    regards,
    Sam

    Hi
    Refer this thread
    Re: query execution statistics
    The query execution statistics can be fetched from the relevant table that acts as source for your query
    Regards
    N Ganesh

  • Stripping a series of data from a cell in Numbers

    I get a report from a vendor with this data
    #378 - GALLERY: Mikell Choate Wedding, IMAGE: 586_LMikell
    #379 - GALLERY: Mikell Choate Wedding, IMAGE: 590_LMikell
    #380 - GALLERY: Mikell Choate Wedding, IMAGE: 591_LMikell
    #381 - GALLERY: Mikell Choate Wedding, IMAGE: 437_LMikell
    I need to strip all the data out of the cell from the "#" to the ":"
    I can get everything out but the series of numbers#378...#381. (using find and replace)
    Is there any way to strip out the series of numbers?
    Or is there a way to paste this data into a numbers spreadsheet so that each word will go into a separate column?

    This is what happened....  It put in only the one number ?
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate
    0068_MikellChoate

  • Why can't I reference data from a cell in file "A" to a cell in File "B"

    I would like to have a master file, that contains multiple tabs and many data tables, look ups etc.
    From this file, I would like to create many "sub" files, that contain only the relevant information for the person receiving that specific file.
    I know this is possible in Windows (sorry for swearing) but I can't get it to work in Numbers.
    I do not want to send out copies of the Master File, as it contains sensitive information.
    Can anyone help please?

    Hi Simontown,
    While you can link docs in excel I believe that sending only a sub file would result in broken links. In Numbers you can skip that step because you can't link the docs to begin with.
    If you are only needed to share the info in a tab you can use the print dialogue to save a pdf of any sheet. If you try to export a pdf from the file menu you will be sending the entire document.
    Another approach would be to create your sub-files as separate sheets that each contain a table that imports all the data needed for that sub file. In order to send the file you would first need to copy the info in that data table and "paste formula results" back in place. You could then select all the tables, copy and paste into a new document. This could be automated with a script. Any changes made to it would not reflect back to your original.
    quinn

  • Numbers '09: How can I display selected data from one cell in another cell?

    Hello.
    I have a Numbers document that contains a table that looks a little like this:
    Amount;Code
    Amount
    Code
    10;12B
    12;8A
    14;16E
    16;3C
    18;5A
    I'd like to have Numbers 09 automatically separate the "Amount;Code" data in the coloumns to the right.
    Do you know the right function and/or equation to make this happen? Any help would be greatfully appreciated.
    Cameron168

    Formula for Amount:
    =LEFT(A2,FIND(";",A2,1)-1)
    Formula for Code
    =RIGHT(A2,LEN(A2)-FIND(";",A2,1))
    I just modified the equation for separting first and last names from:
    http://www.bluemoosetech.com/microsoft-excel-functions.php?jid=32
    You will have to put in your correct cell names
    Tested it and it works!
    Have fun!

  • Data from one cell to another

    Hi when I type in one cell can that data automatically appear in another?

    Hello Phij,
    Yours is a very basic spreadsheet question. It would be a good idea for you to download the Numbers User Guide PDF that's available from the Numbers Help Menu. There are sure to be many other similar questions that will also be answered by taking a look at the guide.
    You can cause the content of one cell to appear in another cell by entering a reference to the first cell in the second one. If the first cell is located at B2 (second column, second row), the equation to make the content of B2 appear in another cell is =B2, in the second cell.
    Regards,
    Jerry

Maybe you are looking for

  • SELECT query very slow, need suggestion.

    Dear all, Below stmt was coded in my report program. It was taking around 14 seconds in development system. The days in s_datum was just 1 or 2 days max. But when the same was transferred to test system, it is taking almost 10 minutes, though it we g

  • Acrobat Scanning Error

    Whenever I try to scan a document in Acrobat I get an error that Acrobat has stopped working.  I have an HP OfficeJet Pro 8610.  What do I do to fix the error?

  • Best way to encrypt all data in SP 2013

    Hello everyone, I have a SharePoint Lab Installation on which I would like to encrypt all data on it. Now there are several ways to do it: Bitlocker, TDE in SQL Server, EFS, others Now which is the best way for SharePoint? I just want to ensure that

  • Control Error

    Hi, Can any on help me to find out the reason for the enclosed Control Block , as per enclosed screenshot. Thanks in Advance

  • Saved Messages Folder

    Hello! I am running Nokia PC Suite version 6.80.21 with my Nokia 6111. The phone needs sending away to be mended. So I am trying to back up everything to the PC. Contacts etc will synch fine. The problem is my "saved message" folders, of which there