Removing specific cells from different columns.

Hi friends,
My requirement is somewhat peculiar. I dont know anyone have already implemented that.
I have 4 columns, 11 rows in my JTable.
Now i want to display all the 11 rows (i.e to be specific cells ) for first two columns, and just 8 for the next two columns..
Kind of incomplete table. Does anyone have any idea? please help me... This may be weird , but i need it.
Sankar.

try this with some change to suit you
written a renderer to remove a cell, hope this is what you need.
public class CellRemoveRenderer implements TableCellRenderer {
     private JLabel label;
     DefaultTableCellRenderer defaultRenderer = new DefaultTableCellRenderer();
     public Component getTableCellRendererComponent(JTable table, Object value,
               boolean isSelected, boolean hasFocus, int row, int column) {
          if (row == table.getRowCount() - 1) {
               return label;
          } else {
               return defaultRenderer.getTableCellRendererComponent(table, value,
                         isSelected, hasFocus, row, column);
}apply this to table
table.getColumnModel().getColumn(table.getColumnCount() - 1)
                    .setCellRenderer(new CellRemoveRenderer());i hope this ends your problem.

Similar Messages

  • How to remove html tags from a column

    Hi
    Problem is this: I get a column with a comma separated list of id's and I can successfully parse these id's and use them elsewhere. BUT, occasionally there are html tags within that id list like this:
    1082471,1237423<br xmlns="http://www.w3.org/1999/xhtml" />
    Is there a way to just automatically remove all tags from a column? Could do this with regex, but since there is no support, I don't know what to do.

    Hi,
    If the HTML can be detected by a starting symbol like „<“, then you could use the following:
    Unfortuntely the operation “ReplaceRange” is only available on a Text-level, so you have to invoke a function (at least to my knowledge). You also need an Index-column in your table, so if you don’t have it, you need to create one as well.
    This is your function:
    let
       fnRemoveHTML = (Value, Index) =>
    let
       Source = Excel.CurrentWorkbook(){[Name="Tabelle1"]}[Content],
       IndeNo = Index,
       Value_ = Source{IndeNo-1}[Value],
       length = Text.Length(Text.From(Value_)),
       position = Text.PositionOf(Text.From(Value_), "<"),
       range = length-position,
       new= if Value_ is number then Value_ else Text.ReplaceRange(Value_, position, range, "")
    in
        new
    in
      fnRemoveHTML
    And this is how you invoke it:
    let
        Quelle = Excel.CurrentWorkbook(){[Name="Tabelle1"]}[Content],
        Last = Table.AddColumn(Quelle, "Custom", each fn_RemoveHTML([Value], [Index])),
        ChangedType = Table.TransformColumnTypes(Last,{{"Custom", type number}})
    in
        ChangedType
    Provided your table is called “Tabelle1” & the column with your values to be replaced “Value” & your index-col “Index”
    Imke

  • How do I remove the cells from footer in Pages 5.5.2?

    In the new Pages, version 5.5.2, my footers have cells. I want to have only one cell but can't find a way to remove the cell barriers.

    In your Toolbar, select Document, and then turn off the footer only. Then, set View ▸ Show Layout. You will want to also Hide Word Count to get it out of your way.
    Now, you can put something creative there that contains your text, or image content. For instance a Text box that is the same size as a footer, properly aligned using the yellow guidelines. Insert a right-justified Page number. Select the Text box, and then choose Arrange ▸ Section Masters ▸ Move Objects to Section Master. If from the Toolbar Documents Section tab, you choose to add another section after the current one, that Page number will auto-increment in the next section.

  • Distinct data from different columns of a table-Single query

    I have a table with different columns. Each of these columns have entries. A particular column, say, a column called name can have same entries more than one time. Likewise other columns can also have same entries more than once. My requirement is to have distinct entries from each of these columns using a single query, such that , for eg; the name column will contain the name George only once on retrieval. Place column will have the place Newyork only once...like that...but Newyork and newyork should be treated different(likewise in other columns also ie; case sensitive). I want to retrieve the above said using a single query from a table. Kindly help.
    Regards,
    Anees

    You're asking a SQL question in a JDBC forum. Look for a SQL forum. The website of the database manfactuer may have a SQL forum/mailinglist.

  • How to dynamically copy cells from different tables?

    Hi,
    I've created an invoice and have 2 different tables. First is at top with Recipient information, the invoice number, their address, etc. Below that, I have a 2nd table laying out the items they are being charged for.
    I would like to copy the invoice number from the 1st table, to a cell in the 2nd table or a 3rd table I will create later on. I know how to copy cells in 1 table, ie. =D4. But not sure how to target a different table altogether.
    Also, is it possible to copy a cell from 1 table to a text box field?
    Thanks!!

    Yvan's point is true.  Please use the User Guides first; they're actually pretty readable.
    However, there's a very quick & easy way to try it out as well.  Go to the cell where you want your data to end up.  Type "=" (without quotes) to indicate you're going to input a formula of some kind.  Then without clicking inside any tables, use the list of sheets and tables to the left to get to your source table and click on the cell that contains the data you want to copy.  Presto!  Go back to your destination cell, and the formula is now filled in, following the scheme Yvan provided.
    Vince

  • [solved] How to remove specific pages from PDF file?

    I'm looking for a way to remove few pages from PDF file.
    Last edited by delor (2008-07-04 10:28:22)

    To remove first page I did this:
    pdftk original.pdf cat 2-end output result.pdf
    Any other propositions ?

  • Linking a cell from different files

    Does anyone know how to link a cell of file to another cell of a file on Numbers on icloud? I am not tallking about linking a cell from one sheet to another sheet of the same file. I know how to do that. I am trying to create a summary file for grades from data of multiple files. Thank you for you're feedback.

    link a cell of file to another cell of a file on Numbers on icloud?
    AppleScript can do this in Numbers on the Mac. But I don't think it is possible in Numbers for iCloud.
    SG

  • Excel - Remove specific characters from entire worksheet if they are the first 2 in the cell

    Hello,
    I have a very large worksheet that is used to populate a SQL database.
    I need to have the data clean before I pass it on to the owner of that database.
    The data is riddled with "na" where the supplier of the data sometimes leaves it blank, like they should, but instead sometimes puts in "na" as either "not applicable" or "information not available". 
    I just need the all "na" removed.  If I highlight the entire sheet and replace "na" with nothing then where it says "international" it will say "inertional" and I can't have that.
    I need a routine, with an on-click for a button, probably, that removes all of the "na" that comes first in the cell.
    I've seen where you can do it with individual cells, but not looping through the whole spreadsheet.
    Thank you in advance for any help I can get! 
    Gee

    >>then where it says "international" it will say "inertional"
    Selecting the "match entire cell contents" option may give you what you want.

  • Remove specific digit from number

    I need to change a 13-digit number to a 12-digit number by removing a specific digit. For example:
    1012200912003
    I need to remove the 3rd digit from the right, so that the number would be:
    101220091203
    How can I do that in SQL?
    Thanks in advance!
    John

    To do that you need to convert the number into string first.
    with t
    as
    select to_char(1012200912003) x from dual
    select to_number(substr(x,1,length(x)-3)||substr(x,-3+1) ) num
      from tHere you can change the value 3 to mach any position in the number
    Edited by: Karthick_Arp on Aug 27, 2009 12:11 AM

  • Removing specific folder from time machine help!

    I had a drive die that had only specific folders backed up. Large files sizes. How do I remove them from time machine now that the drive is gone. I read that you can use the gear menu to remove the back up but it does not seem to work. and since it's not the drive being backed up but only a portion of it, I see no way to remove this data. Any help would be appreciated

    You do mean you want to delete all the backups of those folders, right?
    If so, use the procedure in #E3 of Time Machine - Troubleshooting to see the backups, then select them and use the "gear" menu or right-clicking, to get the menu where you can delete them.  See #12 in Time Machine - Frequently Asked Questions for details on that.

  • Removing specific pops from phone recordings

    I'm running Audition 3.0 on an XP machine. My SoundBlaster card (X-Fi Xtreme Audio) has an audio input (DynaMetric) coming from the Aux plug on the business phone (older Avaya Partner).
    It records really well, all things considered, with one exception: the phone system for some reason produces very loud "pops" periodically. I have no idea where they come from and have made a cursory effort to prevent it, but was told this isn't the best phone system in the world.
    I'm a novice user, using Audition for promotional and fund-raising purposes in our small business. I'm barely able to navigate the tools. I did try a few of the built-in pop removers, but this particular type of pop doesn't seem to lend itself to that approach, at least not within the limits of anything I'm capable of figuring out.
    I'm hoping an expert can provide me with a plug-in or sound sample to use with one of those tools, and instructions on how to apply it.
    The good part is that these pops are quite consistent. Expect for one or two exceptions in the sample I'm providing here, they all seem to be very near to being identical to one another.
    They all seem to be of the same length and, apparently, pretty much of the same volume. I'm wondering if those parameters alone might help isolate them with a routine I can run on the recording file.
    (You'll notice that even though the volume of the person on the other end is considerable lower than mine, the volume of the pops seem to be consistent.)
    The sample I'm providing doesn't make sense if you listen to the words because I selected a series of places where the pops exist.
    I would estimate that in an hour-long recording there are at least a few hundred of them. They're very simple to manually delete by expanding the wave, but there are just too many for that to be practical.
    Here's the sample you can work from. (I can provide a different set of selections if you prefer. I assume this will be fine.)
    http://www.silver100.com/x/phonepops.wav
    Thanks very much!

    Oh, okay. I got it now. Thanks!
    (Note that in Audition 3.0 I don't see anything called "Repair Transient". Maybe you have a different version of Audition. The general Help description under Click/Pop Eliminator just says it removes various transients.)
    I've created the shortcut key to run your script. I see what it does, now -- as you said, it selects a short span of time following the cursor position and applies whatever it is that it does. I presume it's calling the Click/Pop Eliminator tool and applying the parameters in the script.
    It seems to do a pretty good job. Once I manually position the cursor before a pop, I can hit the shortcut key and it will eliminate it while only partly reducing the sound that I do want to keep. Not bad at all. Probably not as perfect of a result as manually slicing out the pop surgically, but I doubt it will be noticeable at all in most if not all cases since this is just speech recorded over the phone anyway.
    Man, I sure do wish there was a way to fully automate this. It's still going to require my manually selecting and removing hundreds of pops in longer recordings. That's an enormous cost in time spent!
    Are we really, really sure there's no way to manually define a profile or sample that matches the characteristics of these pops and let it run automated? The Noise Reduction feature can capture a sample from a selection and run with that, but my pops are not long enough in duration for it to capture. I would like to think there's some way to approach this that will let it run nice and cleanly and fully automated by defining the pop characteristics in one of the tools. The reason I'm suspicious there may be a way is the totally consistent characteristics of these pops (not that I know much at all about what would be involved or how realistic is really is or is not).
    Any other ideas?
    Anyone else have any other ideas?
    Thanks again!

  • I am having problems using Numbers package, unable to add specific cells in a column, when I tap "sum" it totals the whole column, rather than the specific cells I want. Would appreciate any help. Thank You Francis

    I am having a problem with adding selected numbers in a column. When I select "sum" the whole column is added, not just the selected cells. I would appreciate any help how to rectify? Many thanks. Francis Anthony

    I don't know if this is the best way but it's pretty easy.
    1.) Select the cell you want the sum in.
    2.) Select the sum function
    3.) In the line where you see =sum(B2:B8) using your finger tap the B2:B8
    4.) Use the backspace key to delete the B2:B8 and it will then show "value"
    5.) You can now tap any cell you want in the sum
    6.) When finished tap the green check mark button at the end of the sum line.
    That pretty much sums it up.
    Good luck.
    Steve

  • Removing specific podcasts from iPod

    Hello,
    I apologize if this is a simple question, but I'm not sure the best way to handle. I subscribe to many podcasts. I have it setup so that ALL podcasts are synced with my iPod. Once I have listened to a specific podcast, I will usually go into my Podcasts in iTunes and delete the ones that I no longer want. Then, when I sync, the podcasts are deleted off the iPod. However, sometimes I do not want the podcasts to be deleted from iTunes. Just the iPod. That way, I have the podcast incase I ever want to go back to it and listen to it again. It also doesn't clutter up my iPod.
    Question: What's the best way to do this? I tried to un-check the checkbox on the episode I didn't want sync'ed, but it still showed up on my iPod. Do I need to go into the iPod as well and delete the episode?
    Hopefully I'm making sense. Thanks for the help!

    To do this, I think you would need to go to edit, and then preferences at the bottom while your iPod is connected. Then, under the ipod tab, click podcasts. The selected button should be "Automatically update all Podacasts".
    Then, at the bottom there is a dropdown box, which is probably selected at "Update: All episodes". You ca change this box to one of 4 options: "Update: All episodes; Only checked episodes, only most recent episodes, or Only unplayed episodes"
    If you set it to update only checked episodes, then your problem should be solved.
    Another solution could be to manage the podcasts manually, which is the most organized route I personally think.
    Hope this solves your problem, And congrats on your first post.(lol I only started yesterday)
    (soon to be) Imac 20 inch core duo, 2 GB of RAM, 500 GB hd (but for now) old hp laptop   Windows XP  

  • Removing specific element from a list

    Hello, I'm very new to java, and to programming in general.
    I'm trying to write a secret santa app for my family for christmas. Essentially the idea is that 7 names are put into a list, and each time a name is "pulled" (i.e. randomly assigned to a name /= itself) it will be removed from the list of available names to assign.
    String[] nList = { name2, name3, name4, name5, name6, name7 }; // store names for random use
    Random r = new Random();
    name1assign = nList[r.nextInt(nList.length)];
    String[] nList2 = { name1, name3, name4, name5, name6, name7 };
    name2assign = nList2[r.nextInt(nList2.length)];
    My goal for this is to take the string that is equal to name1assign, and remove an element with that string from nList2.
    Can anyone give me some advice in this matter?
    Thanks.

    Sometimes a null value is used to indicate an 'empty' array element, but it would be better to try collections instead.
    You could use an ArrayList instead of an array. This has methods to remove items by index or value.
    An ArrayList also works with Collections.shuffle, which allows you to simply iterate over the list and not deal with random or removing elements at all.

  • Getting 2nd Least Value from Different Column

    Hi there All,
    I have one odd requirement.
    I hava table which has diffrent columns of numeric Datatype.
    The task is to get the least values from the table.
    I can take the least value by least(col1,col2,col3 ...) function.Until this stage it is fine.
    But also I have take 2nd least value and 3rd least value, which I am quite unsure how to get it.
    Looking forward for suggestions.
    Thanks in Advance.
    Regards,
    Ajeet

    The following is a generic solution that will allow you to select the nth least and allow you to pass as many column names as you like and will return null if the nth least requested exceeds the number of distinct values. The nleast function that I wrote uses the str2tbl function by Tom Kyte. I have included a demonstration of its usage below. The value returned for the 1st least is the same as that returned by the least function.
    This should have been posted on the SQL and PL/SQL discussion group of these forums, rather than the general database. I also posted the same response in the SQL discussion group of the Orafaq forums.
    scott@ORA92> -- test data:
    scott@ORA92> SELECT * FROM your_table
      2  /
          COL1       COL2       COL3
             1          2          3
             4          6          5
             8          7          9
            11         12         10
            15         13         14
            18         17         16
    6 rows selected.
    scott@ORA92> -- type and functions:
    scott@ORA92> create or replace type myTableType as table of number;
      2  /
    Type created.
    scott@ORA92> create or replace function str2tbl( p_str in varchar2 )
      2  return myTableType
      3  as
      4        l_str      long default p_str || ',';
      5        l_n         number;
      6        l_data    myTableType := myTabletype();
      7  begin
      8        loop
      9            l_n := instr( l_str, ',' );
    10            exit when (nvl(l_n,0) = 0);
    11            l_data.extend;
    12            l_data( l_data.count ) := ltrim(rtrim(substr(l_str,1,l_n-1)));
    13            l_str := substr( l_str, l_n+1 );
    14        end loop;
    15        return l_data;
    16  end;
    17  /
    Function created.
    scott@ORA92> CREATE OR REPLACE FUNCTION nleast
      2    (p_n        IN NUMBER,
      3       p_nums        IN VARCHAR2)
      4    RETURN           NUMBER
      5  AS
      6    v_nleast      NUMBER;
      7  BEGIN
      8    SELECT DISTINCT column_value
      9    INTO   v_nleast
    10    FROM   (SELECT column_value,
    11                  DENSE_RANK () OVER (ORDER BY column_value) AS num_rk
    12              FROM   (select *
    13                   from   table (CAST (str2tbl (p_nums) AS mytabletype)))
    14             WHERE   column_value IS NOT NULL)
    15    WHERE  num_rk = p_n;
    16    RETURN v_nleast;
    17  EXCEPTION
    18    WHEN OTHERS THEN RETURN NULL;
    19  END nleast;
    20  /
    Function created.
    scott@ORA92> SHOW ERRORS
    No errors.
    scott@ORA92> -- query:
    scott@ORA92> SELECT col1, col2, col3,
      2           LEAST (col1, col2, col3) AS the_least,
      3           nleast (1, col1 || ',' || col2 || ',' || col3) AS first_least,
      4           nleast (2, col1 || ',' || col2 || ',' || col3) AS second_least,
      5           nleast (3, col1 || ',' || col2 || ',' || col3) AS third_least,
      6           nleast (4, col1 || ',' || col2 || ',' || col3) AS fourth_least
      7  FROM   your_table
      8  /
          COL1       COL2       COL3  THE_LEAST FIRST_LEAST SECOND_LEAST THIRD_LEAST FOURTH_LEAST
             1          2          3          1           1            2           3
             4          6          5          4           4            5           6
             8          7          9          7           7            8           9
            11         12         10         10          10           11          12
            15         13         14         13          13           14          15
            18         17         16         16          16           17          18
    6 rows selected.

Maybe you are looking for