Help! coloring a bottom line for 3 seconds in JTable with SwingTimer

Hi, I'm fighting with this for the last three days, but can not find a solution.

I have a JTable and when I insert a new line, I want to give this line a backgroundcolor for 3 seconds / or let it Flash for 3 seconds and then let it return to its original background color. While the current line is yellow, I want to insert a new line which would also yellow for 3 seconds. The previous row would return white earlier that line, because this line is inserted earlier.

the problem is that when I add a new line, while the current line is yellow, the new line should the timer from the previous row, which means that the last inserted row will remain yellow for a time of shirter, which I don't want.
I want a bgcolor 3 second for everyrow inserted. How can I achieve this?

My code:

startBlinking() is called when a new row is added to the JTable

Public Sub startBlinking() throws InterruptedException {}

If (timer.isRunning ()) {}
}
timer.setInitialDelay (2);
Timer.Start ();
}

-in another class:

attributes
Action updateCursorAction = getAction().
Timer Timer = new Timer (3000, updateCursorAction);


public Action getAction() {}
updateCursorAction = new AbstractAction() {}
Boolean shouldDraw = false;

public void actionPerformed (ActionEvent e) {}
If (shouldDraw =! shouldDraw) {}
blinkingYellow();
} else {}
blinkingWhite();
Timer.Stop ();
}
}
};
Return updateCursorAction;
}


public void blinkingWhite() {}
receiverdata_Table.setRowSelectionInterval (0, 0);
receiverdata_Table.setSelectionBackground (Color.White);
}

public void blinkingYellow() {}

receiverdata_Table.setRowSelectionInterval (0, 0);
receiverdata_Table.setSelectionBackground (Color.Yellow);
}

RishiSU wrote:
Hello

Thanks for your reply.

I decided to go with for my Gui SwingX.

great :-)

Unfortunately the site is down,

sigh, what happens... not so occasionally, see

http://www.Java.NET/forum/topic/javadesktop/Java-Desktop-technologies/SwingLabs/FYI-swingxdemos-project-homes-are-Javan-0

contains all the info on How to get to the source, releases... the newest is 1.6.2

My question is, how can I use the code that you just pasted in my IDE?
I have already added the Jar files in my path. The only thing that keeps me from compliling and execution of the code is the:

Import org.jdesktop.swingx.InteractiveTestCase;

Yes, it is not part of the output of swingx, it's part of our test support (we are lazy :-). Your options are at the checkout the complete code (including support for test) of the House of project and compile it in your ide - or just give up and replace it with a configuration of the 'normal' UI as shown below, no rocket science :-)

HTH
Jeanette

public class DynamicHighlighterExperiments { //extends InteractiveTestCase {

    // public static void main(String[] args) {
    // DynamicHighlighterExperiments test = new DynamicHighlighterExperiments();
    // try {
    // test.runInteractiveTests();
    // } catch (Exception e) {
    // e.printStackTrace();
    // }
    // }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                JXFrame frame = new JXFrame("DynamicHighlighterExperiments");
                frame.add(new DynamicHighlighterExperiments().createContent());
                frame.pack();
                frame.setLocation(WindowUtils.getPointForCentering(frame));
                frame.setVisible(true);
            }
        });
    }

//    public void interactiveHighlightOnInsert() {
      protected JComponent createContent() {
        final JXTable table = new JXTable(10, 4);

        final ColorHighlighter hl = new ColorHighlighter(HighlightPredicate.NEVER,
                Color.YELLOW,  null);
        table.addHighlighter(hl);

        final List recentRows = new ArrayList();
        ActionListener l = new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                int insertedRow = table.getModel().getRowCount();
                recentRows.add(insertedRow);
                ((DefaultTableModel) table.getModel()).addRow(new Object[] {insertedRow});
                table.scrollRowToVisible(table.convertRowIndexToView(insertedRow));
                updateHighlighter(hl, recentRows, insertedRow);
            }
        };
        Timer insertTimer = new Timer(500, l);
        insertTimer.start();
//        showWithScrollingInFrame(table, "highlight inserted rows");
        return new JScrollPane(table);
    }

Tags: Java

Similar Questions

  • Firefox crashes constantly on my Macbook pro. It opens the page for 7 seconds, and then it crashes. Reinstall, del profile, clear the cache did not help

    I can't open more Firefox on my MacBook Pro. When I try to open Firefox, the start page appears for 7 seconds and then Firefox closes and opens a report. During these 7 seconds, I can't use any button in Firefox. I deleted all of firefox and Mozilla in my library and in my cache. After that I did a reinstall of Firefox. But the problem is existing.

    You can check policies corrupt and duplicate and other police issues:

  • Problem of color with pdf from Indesign. I have a special mix CMYK for a bcard in Indesign. When I export the pdf file that the CMYK mix has changed just started today 1.13.15 Running Yosemite 10.10.1 all help to what to look for would be greatly apprecia

    I have a special mix CMYK for a bcard in Indesign. When I export the pdf file that the CMYK mix has changed just started today 1.13.15 Running Yosemite 10.10.1 all help to what to look for would be greatly appreciated.

    You are mixing color profiles a-place, or document workspace does not match the destination to export space is incompatible.

  • Help! Object enter the scene, stop for a second, then go. How?

    Hello world

    I am a beginner in AE and I'm trying to animate a bus I made using illustrator. This bus is suppose to enter the scene, stop in the middle of it, than to start over and leave, simulating a bus stop.

    Now, I realized to get into the scene and get to the point where I want, but how can I do stay there for a second or two and then start again, because if I add a keyframe after a second it does not block and it continue. I'll add a screenshot of my calendar to show you!

    Schermata 2014-10-08 alle 12.31.05.png

    The first key frame is where the departure of the bus, and the second is where he suppose to stop and where my red line is I want to do it over again, so the time between the second keyframe and the red line is where I want the bus stop!

    Thank you

    Use a hold keyframe.

    Using After Effects | Interpolation keyframes

    Start here learn After Effects:

    http://Adobe.LY/AE_basics

  • different text color in the same line for staticText ScriptUI?

    is it possible to have different text color in the same line for staticText ScriptUI?

    for example, I don't want red color for the word 'RED' text below in the SAME line.

    var l is new window ('dialog', 'Sélection');.

    var s = w.add ('statictext', undefined, "It's a RED pen");
    w.Show ();

    Thank you!!

    Simple,

    var w = new Window ("dialog","Selection"),
         g = w.add('group'),
         s1 = g.add('statictext', undefined,"This is a"),
         s2 = g.add('statictext', undefined,"RED"),
         s3 = g.add('statictext', undefined,"pen");
    g.spacing = 4;
    s2.graphics.foregroundColor = w.graphics.newPen(w.graphics.PenType.SOLID_COLOR,[1,0,0],  1);
    w.show();
    

    I'm sure that's the answer makes sense "only".

    Trevor

  • Change the color of the bottom line on the selection box

    I use APEX 3.2 and have integrated the JSQuery library. I have a region of Type of SQL query report. The first column of a report is apex_item.checkbox. Based on the selection, I need to highlight the line that will be selected using the checkbox.

    I have following question in my header HTML page.

    < script language = "JavaScript" type = "text/javascript" >
    $(document) .ready (function() {}
    $('input[name=f01]').change (function() {}
    If {($(this).is(':checked'))))}
    $(this).parents('tr:first').css ('background-color', '#FFFFFF');
    Alert ('changed');
    }
    else {}
    $(this).parents('tr:first').css ('background-color', '#CCCCCC');
    Alert ("not changed");
    }
    });
    });
    < /script >

    It gives me the alert when the checbox is selected but that don't change the background color of the line.

    Any help?

    Syed

    Published by: rizvi on March 28, 2011 02:28

    Try

    $(this) .children ('td').parents('tr:first').css('background-color','#FF0000');

  • Coloring outside the lines

    Excuse my naiveity...  I'm a newbie to Illustrator (better in photoshop).

    I have vector art - art line - which was provided by a freelance artist, I work with that.  He made the drawing line and then I usually look in photoshop and good color seems to us.

    That has always worked perfectly (for printing), but now we use a manufacturing process which is digital and requires the vector art.  I'm trying to understand the best way to 'paint' the art in illustrator.

    I found the live paint and it's great, but I need the colour to be a bit more "sloppy" - as the art of the child.  It takes approximately fill the spaces rather than fill them perfectly.

    Is there a simple way to do this?  Is there a way to make their own layer of color areas and then manipulate them?   I have about 25 designs that I need turnover as soon as possible to the company that did the job for us.

    I searched on the web constantly and can't find anything that addresses this...

    Thank you very much in advance for your help.

    itsnotthatbad,

    The line drawing seems to be filled with white.  How can I erase the white in the lines (similar to a Magic Eraser in photoshop)?

    Select all the art of the line, click on the fill area at the bottom of the Toolbox and set it to None.

  • When computer boots up I get TWO lines for "Microsoft Windows XP Home Edition.

    I reinstalled Windows XP and somehow it reinstalled on my D: recovery partition! Craps! In any case, now, when I turn on the computer, it is written "Please select the operating system to start:" and then has two lines for Microsoft XP Home. The 1st line log on the D: partition. So I am forced to choose the 2nd line to work on my c: to ole. How can I remove the 1st line? 2nd, is my tour recovery partition? and what does one do?

    Please help!

    Thank you!

    How to change the boot.ini file: http://support.microsoft.com/kb/289022

    Currently, your .ini file may contain:

    [boot loader]
    timeout = 30
    default = multi (0) disk (0) rdisk (0) partition (2) \WINDOWS
    [operating systems]
    "multi (0) disk (0) rdisk (0) partition (2) \WINDOWS="Windows XP "/ fastdetect
    "multi (0) disk (0) rdisk (0) partition (1) \WINDOWS="Windows XP "/ fastdetect

    Your .ini file must contain the following:

    [boot loader]
    timeout = 30
    default = multi (0) disk (0) rdisk (0)partition (1)\WINDOWS
    [operating systems]
    "multi (0) disk (0) rdisk (0) partition (1) \WINDOWS="Windows XP "/ fastdetect

    Note: The value of 30 seconds timeout can be set to 0 and you will start automatically on windows (do this after checking the cahnges you make are what you want).

    J W Stuart: http://www.pagestart.com

  • srchdata in subforms does not not for the second occurrence

    Hi all

    Probably a very simple answer, but hoping someone can help us

    We have xml in the format below:

    < saList >

    <>adjustment

    < adjList >

    < totAmt > - 50.00 < / totAmt >

    < / adjList >

    < / setting >

    < / saList >

    < saList >

    <>adjustment

    < adjList >

    < totAmt > - 12.00 < / totAmt >

    < / adjList >

    < / setting >

    < / saList >

    I have a subform that is triggered on the adjustment of <>and in the sections which subform that trigger on < adjList >. So, we get two parts with the above XML code.

    In this section, I have a DAL which is changing the value of < totAmt > above, remove the '-' if exists and substituting a "CR" at the end (e.g. 50.00 CR / 12.00 CR).

    The SRCHDATA for this is in the format:

    TPAAMT = SrchData ("!") ("/ xxxxxxxx, saList, adjustment, adjList [* @GETIMAGE *] / totAmt", 1.19)

    The DAL works for the first triggered section, but returns EMPTY for the second triggered section. Any other information is removed from the second incident, but the DAL does not work. Can anyone help?

    Thank you

    Patrick

    As you currently described the data you get two data items by using the xpath expression that you mentioned earlier. However, you will not get a third.

    Assuming that the repetition of node at the top level is not relevant for your situation of subform, you dumb down to the xpath expression to be less precise.

    TPAAMT = SrchData ("!") ("adjList [* @GETIMAGE *] / totAmt", 1.19)

    By doing so, you say you want to find any occurrence descendant of adjList, regardless of his filiation. If you include the line above the relevant node, then it is considered important for research.

  • SQLLDR, two newspapers. lines for four phys.

    Hello world

    I have a text file which consists of two rows of logic that must be downloaded like four rows into the table with fields F1, F2, and F3.

    Numbers in the file are separated by a different amount of space. Each line begins with a space, but also ends.

    F1     F2           F3             F1          F2              F3

    0 0 0.168 50 2.417 7122

    1 2 0,566 51 2,488 6995


    I use the control such as this file

    ...

    INTO TABLE TBL_NAME

    TRUNCATE

    (

    F1, COMPLETED BY A WHITE SPACE,

    F2, COMPLETED BY A WHITE SPACE,

    F3 FINISHED WITH A WHITE SPACE

    )

    INTO TABLE TBL_NAME

    TRUNCATE

    TRAILING NULLCOLS

    (

    F1 POSITION (*), FINISHED WITH A WHITE SPACE,

    F2 POSITION (*) COMPLETED BY A WHITE SPACE,

    F3 POSITION (*) COMPLETED BY A WHITE SPACE

    )

    The result is that for lines 3 and 4 F1 field contains values for F2.

    Red color values are completely stopped.

    11

    Any ideas?

    I suggest you to declare the first three columns as charges for the second table, by specifying position (1) for the first fill, as shown below.  This seems to be a more reliable method.

    Scott@orcl12c > host type test.dat

    0 0 50 0.168 2.417 7122

    2 1 51 0,566 2,488 6995

    Scott@orcl12c > type host test.ctl

    DOWNLOAD THE DATA

    IN THE STORAGE_LEVEL TABLE

    TRUNCATE

    (

    F1, COMPLETED BY A WHITE SPACE,

    F2, COMPLETED BY A WHITE SPACE,

    F3 FINISHED WITH A WHITE SPACE,

    F4 "22222.

    F5 "fnc_id.nextval."

    )

    IN THE STORAGE_LEVEL TABLE

    TRUNCATE

    TRAILING NULLCOLS

    (fill1 FILLER POSITION (1) COMPLETED BY a WHITE space,

    fill2 FILLING DONE BY a WHITE space.

    fill3 FILLING DONE BY a WHITE space.

    F1, COMPLETED BY A WHITE SPACE,

    F2, COMPLETED BY A WHITE SPACE,

    F3 FINISHED WITH A WHITE SPACE,

    F4 "22222.

    F5 "fnc_id.nextval."

    )

    Scott@orcl12c > create table storage_level

    2 (number of f1,

    number of 3 f2,

    Number 4 f3,

    Number 5 f4,

    Number 6 f5)

    7.

    Table created.

    Scott@orcl12c > create sequence fnc_id

    2.

    Order of creation.

    Scott@orcl12c > host sqlldr scott/tiger control = test.ctl data = test.dat log = test.log

    SQL * Loader: release 12.1.0.1.0 - Production Fri Apr 24 17:32:13 2014

    Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

    Path used: classics

    Commit the point reached - the number of logical records 2

    Table STORAGE_LEVEL:

    2 rows loaded successfully.

    Table STORAGE_LEVEL:

    2 rows loaded successfully.

    Check the log file:

    test.log

    For more information on the charge.

    Scott@orcl12c > select * from storage_level

    2.

    F1 F2 F3 F4 F5

    ---------- ---------- ---------- ---------- ----------

    0 0.168 22222 1

    1 2.566 22222 2

    50 2,417 7122 22222 3

    51 2,488 6995 22222 4

    4 selected lines.

  • Help!  I'm stuck.  No, not the child into the well.  I took a picture and put a second layer top with a rounded rectangle to make a frame.  My problem is that I need to find a way to hide the small box outside the box on the second layer.  Thanks to

    Help!  I'm stuck.  No, not the child into the well.  I took a picture and put a second layer top with a rounded rectangle to make a frame.  My problem is that I need to find a way to hide the small box outside the box on the second layer.  Thanks to all those who can help you.

    Another option is to put the Options bar of the Rectangle rounded to the path tool

    Trash bolt for the background layer, hold down the Cmd key and click on the symbol of the new layer to layer below the image to white. Then edit > fill with white.

    Return the image layer and draw the image as a path

    Click the load as a selection path in the Panel traced

    Edit > stroke and stroke with color

    Select > Inverse > delete

  • How can I fix iphone and ipad to recognize my printer air.  I t o disconnect the printer and wait for 30 seconds before reconnected and then they both recognize the printer

    How can I fix 6s iphone and ipad air when they do not recognize my printer air.  After unplugging the printer for 30 seconds, they can connect to the printer

    Hey robertafromnull,

    Thank you for using communities Support from Apple. We can see from your post that you are having problems with printing of your devices on a printer of Air and that it would be happy to provide advice to solve this problem.

    Let's start by going to the section called "If you can not print on your AirPrint printer" in this link here: Topic AirPrint. This should contribute to help you get started with you back to printing from your iPhone / iPad. Let us know if this can help, or if you encounter any problems.

    Kind regards.

  • When Firefox starts (24) he hangs for 10 seconds (not responding) before responding... just started to do this.

    When starting FF program (shows not responding is not in the title) stall for 10 seconds, then continues.

    Try Firefox Safe mode to see if the problem goes away. Safe mode is a troubleshooting mode, which disables most of the modules.

    (If you use it, switch to the default theme).

    • Under Windows, you can open Firefox 4.0 + in Safe Mode holding the key SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac, you can open Firefox 4.0 + in Safe Mode holding the key option key when starting Firefox.
    • Under Linux, you can open Firefox 4.0 + with leaving Firefox then go to your Terminal and running Safe Mode: firefox-safe-mode (you may need to specify the installation path of Firefox for example/usr/lib/firefox)
    • Or open the Help menu and click on the restart with the disabled... modules menu item while Firefox is running.

    Once you get the pop-up, simply select "" boot mode safe. "

    If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, and you need to understand that one. To do this, please follow article Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems .

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. It might help others who have the same problem.

    Thank you.

  • Satellite X 200-191-online laptop turns on the screen for 4 seconds, black, loud snoring

    * Satellite x 200-191 _ * _

    Intel Core 2 Duo T7700 processor
    * Origin: * 1024 MB + 1024 MB of memory 667 MHZ/512 MB of VRAM * replaced: * Kingston Kingston KVR667D2S5 / 2G (I have this x 2)
    * Origin: * 200 + 200 GB SATA hard disk drive (4200 RPM) * replaced: * only 1 HDD on the left, the other I'll be back in 2 days.
    17 WSXGA + TFT TRUBRITE screen
    HD DVD-ROM drive
    56K Modem / Lan
    W Lan (802.11 A/G/N)
    1/3MPixel camera Web
    Bluetooth
    Microsoft Vista Home Premium 32 Bit

    _ * My problem: * _

    I removed the battery, plug it into the power. Charging light lights up.
    I press the power button, power led turns of. Followed to the hdd led tower which flashes real quick, on, stays on for 1 second and then turns of. The power led stays on all the time.
    2 seconds after the power button, a fan starts to blow, while the hard drive the mention above led blinks for 1 second, 2 seconds after the fan starts blowing, it turns off.
    We are now 4 seconds later, roughly, all stopts, except a very small minor hum. (I just left on during a few minutes, his rest, nothing happens.) (Writing this all let him down for 10 minutes, the computer laptop op warms a bit, the card becomes warmer, but still only a tiny buzzing minor.)

    + My laptop works for 4 seconds, will not be any screen (black screen) does not load even BIOS. What could be the problem? +

    _ * Fixing? : * _

    OK so I let the laptop after a few months, said he was dead, just dusty. (Read the story to get it)
    But since last week, I thought that becomes dusty, I never opened a laptop before, why I try to make that custom.

    _ + * I replaced the modules of memory, Slot A and B, so many memories, same time, at a time, all means. * + _

    _ + * Since I have only 1 HDD, I used it in both slots. Looks like no difference. Using no. HDD, I don't have the zoom very tiny minor! *+_

    I followed a guide [http://www.irisvista.com/tech/] to open my laptop, to see what is inside.
    Find no loser caps, but found a see oil and a white paste.
    Closing the laptop to try, I've accidentally screwed some wrong in the laptop screws, drill the top cover of my laptop, but no fleas have been affected in this: P (Yes, Im a little towards the fort, I thought I'd use force for a couple of the screws was not the best thing I could do, but now I know) : p).

    ************************************************** ************************************************** ************************************************** ***
    * SOOO * my question, while I wait for the extra HDD (do in 2 days). (Probably not make any difference)
    What could be wrong, more precisely. I love should try to take the video card or something?
    Is there something I should do with some soldering?
    All tips/tricks that might work, weather to repair the laptop, or to refine the problem, a small part that I could replace it?

    Best regards
    Danny Visser
    The Netherlands
    ************************************************** ************************************************** ************************************************** ***

    _ * History: * _

    Don't know if it's not important, but just to let you know, so interested what happened at the laptop ;)
    I bought the laptop in the form of computers (in the Netherlands) asked that laptop mentioned above, with 2 things have changed. I wanted more memory, and I wanted windows XP. The shop told me it was possible. They bought me the laptop, they replaced with memories of kingston memory. They installed windows XP instead of Vista. They portable worked at that very moment. So, I bought the laptop to work with 1 year warranty.
    With the additional files given with the laptop, I could increase my warranty from 1 to 2 years free, so I did.

    After a few weeks that I noticed that the laptop became real probably hot after prolonged use. But according to the manual, it was normal.
    I used the laptop to the games, but also 2 months for a study of play. So I take several times at school in a backpack.
    After using only not for school, I reinstalled Windows Vista 32 BIT

    When a very uncertain when exactly, I noticed that it does (probably same problem as I have now) but I was really relaxed about, tried subsequently and in some way, it worked again. It happened maybe about 5 times in total.
    Knowing something was wrong, I brought computers to the form. They checked. (No not showing me what they did to her) But he told me that I had nothing to fear.

    After about 2 years, I actually sold this laptop to my mother. She used once or twice (she really looks like noob, just about computers in general, without even knowing if it should double click on the icons or not) she took him one or two times on TRIPS and they after about 2 years and 2 months... this problem happened.

    My mom knows a guy and a friend of this guy, work a lot with laptops broken, who told me that the problem was the motherboard _ + _.

    I decided to take it back to the shop. After a long class being there (about 6 to 8 weeks) (I go to the store like 15 times). The shop was able to tell me it was the motherboard. That the motherboard could not be fixed and a new way to expensive.
    + (I have known at this point, after the motherboard, what this laptop was not open yet. The screws were still new). +
    Funny information (not for me), this period of about 8 weeks, in fact we me lies like... I left a message on your voicemail, I do not HAVE a voicemail... Sorry for the caps, but im still xxxxxx on these lies.

    Therefore still believe in the shop... my laptop has gone... dead... but so since last week, I started looking into the laptop I... (Fixing)

    Hello

    To be honest that s a very long history and I think that we can t help you here and tell you what the problem is exactly because it s just a user to user forum. I think that you need professional help technicians of laptop, they can check what the problem is.

    According to your assignment I think that it s a hardware malfunction, perhaps the card mother, but this should be verified by professional technicians.

    You need to contact a service provider authorized in your country. You can find a list here:
    http://EU.computers.Toshiba-Europe.com > support & downloads > find an authorized service provider

    I m sure all you can specify with the ASP. The guys are really friendly and do a good job.

    Good luck! :)

  • REGZA 37A3030DB menus come for a few seconds & disappear; works with the DVD

    Saturday afternoon, TV channels stopped working. The TV works fine with DVD or laptop, but not with the channels (i.e. we cannot watch live TV) and the menu buttons appear on the screen for 2 seconds max before disappearing. It already happened but has himself set normally after 24 hours. It's almost 48 hours now, and I'm worried. If anyone can help or make suggestions, it would be great. My feeling is that this happens after an auto-update firmware, so once the TV is working again, I want to find a way to disable these automatic updates. Thank you. R

    Just for you, everyone knows that, after 48 hours, television seems to have reset itself and now works again. R

Maybe you are looking for