TextField won't change color

I tried to change the color of a JTextField I am subclassing. But the color does not change until the method I'm calling setBackground() from ends. I did this:
setBackground(new Color(255,0,0) );
updateUI();
Thread.sleep(1000);
But the color does not change before the sleep. How can I force the component to update?
Thanks for any help

Thanks, that probably would do the trick, but I found this article, which I should've searched for first. It solves my problem. I can run the flash the background color using a thread.
http://forum.java.sun.com/thread.jsp?forum=31&thread=211176&start=0&range=30#733504
I don't fully understand why call to repaint() didn't work. It's obvious that it has something to do with my sleep affecting the TextField component itself, as if it sleeps the entire component, and prevents the GUI from being updated. I guess it isn't updated while the component is currently executing a method?

Similar Messages

  • Followed hyperlinks in PowerPoint 07 WON'T change color

    I have created a jeopardy-style game in PPT and the hyperlinks aren't cooperating.  When I click on one of the options, it takes me to the appropriate slide, but when I return to the main slide the link I previously clicked did NOT change color. 
    This makes it difficult for users to remember which options have already been used.  I have tried creating custom colors via Themes but that didn't work.  Help!

    I found a work-around for this using custom animation.  First, I setup boxes (for game squares)  in my Jeopardy game as hyperlinks (i.e., entire box/square is a hyperlink).  However, I did not enter any text in the "hyperlink" boxes. 
    Instead, I placed a regular textbox in the middle of the hyperlink box.  In the textbox, I typed in my dollar amounts (in white font).  I then setup a custom animation to turn the text in the textbox to blue (the background color of the game board). 
    In the "Timing" option for the animation, I setup the Trigger as "On click of" and then selected the "hyperlink" box. 
    Now, when any area inside the "hyperlink" box is clicked, it triggers the color change animation.  This gets around the bug that doesn't change visited hyperlinks in PowerPoint.  Hope this helps!

  • Visited Links won't change color

    When I click on a page link or spry menu link, the link
    colors work for hover and active, but not for visited.
    Here's my site:
    http://www.viva-city.info
    Thank you!

    > a {color: green}
    > .Accordian, a {color:blue}
    >
    > That would mean "a" links inside a class="Accordian" box
    would have the
    > color
    > blue.
    No it wouldn't. It would mean any text inside a
    class='Accordian' would be
    blue, as would all links on the page. Surely you meant -
    .Accordian a { color:blue; }
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "meshgraphics" <[email protected]> wrote in
    message
    news:fljbbu$sqv$[email protected]..
    > You need a style rule that looks like
    >
    > a:visited {color:grey}
    >
    > It appears that you have added some rules to the
    > /SpryAssets/SpryAccordion.css
    >
    >
    > Generally speaking, you want to do something like this:
    >
    > a {color: green}
    > .Accordian, a {color:blue}
    >
    > That would mean "a" links inside a class="Accordian" box
    would have the
    > color
    > blue.
    >
    > Rules for the same tag in different files will conflict.
    >
    >
    > Peace,
    > J
    >
    >
    >

  • How to change color of canvas?

    I made sure the background color swatch in the lower left of the tool box was set to blue.  Then I went to Image>Resize>Canvas Size> and changed the sizes.  Then I set the Color Extension to the background color blue, and the little box to the right of this showed the blue I wanted.
    Then I clicked OK.
    The sizes changed properly, but the color won't change colors at all.  It stays an ugly putty brown, no matter that I have tried every single way in that color extension box pull-down menu.
    Any help will be much appreciated.

    Try this:
    Set the background color (lower left) to blue
    Go to File>new>blank file. Enter width & height in inches for the desired document, resolution 240-300px/in for printing, background contents: background color.
    OK

  • Photoshop CS 6 - image -canvas - make double matt - select color - if I select wrong color, how do I change to a new color, right now it won't change to the new color I select, WHY?????

    Photoshop CS 6 - image -canvas - make double matte - select color - if I select wrong color, how do I change to a new color, right now it won't change to the new color I select, WHY?????

    Hi, The options bar shows sample size 101 by 101 Average. That was my problem. When I was troubleshooting in order to try to explain to you what was happening, I noticed that when I sampled my models teeth, it gave me a color a bit lighter than her lipstick as my foreground color in my tool box. That started me thinking in the correct way. I didn't realize that my sample size had somehow gotten switched from point sample to 101 by 101 average. I appreciate the help. Thank you.

  • Mic Mute Hotkey doesn't work, Sound Mute Button won't change its color [Windows 10]

    Hello everyone,
    I recently did a clean install of Windows 10 x64 on my HP Probook 450 G1 (E9Y30EA), and after installing drivers I noticed when I turn off the sound, my Mute Button won't change its color to amber (or orange, yellow, whatever), as it did in Windows 8.1 and 7.Also, another thing that's not working at all is Microphone Mute Hotkey (fn + F8). It neither turns off the microphone, nor lights up its LED. I have the latest version of HP Hotkey Support driver installed (7.0.13.1), HP Quick Launch Buttons, HP Wireless Button, installed, .NET Frameworks 2.0 and 3.0 etc.. everything is up-to-date, but it's still not working as it should. Microphone muting just doesn't work at all, and pressing (sound) Mute Button does mute sound, but its light stays white, so I often don't know whether I had the sound on or off with the glance of an eye as I used to. On the other hand, HP Wireless Button works normally, and it changes its color to amber when I press it to turn on Airplane Mode. TL;DR: Microphone Mute Hotkey doesn't work; Sound Mute Button does work, but its LED doesn't work. Is there anything I can do to fix that, or is it just a problem with driver incompatibility that would be fixed in some of the next updates? Or is it something else, like Windows 10 issue or audio driver maybe?
    Thanks in advance, pajser92

    Hi,
    First download the sound driver using the links below and save the installer to your Desktop.
    Audio Driver - Windows 7
    Audio Driver - Windows Vista
    When the download has completed, right click the installer and select 'Run as Administrator' to start the installation - ignore any warnings you may see about this being an earlier version.  When the installation has completed, restart the notebook.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Change color to won't work

    So I rendered a c4d scene, and in it was a tilted plane with the default material on it if you say "create new material". I noticed that the more tilted it was flat, the more gray it appeared, and the more it showed to the camera, the more white it was, so I figured i'd try to fix it with change color to in after effects, however it will not work and nothing happens. if I change the change hue to change hue and lightness, I see the desired color I want in the background, but it completely messes everything up. I need an answer ASAP so any reply on how to fix the gray plane thing in cinema4d or my change color to would be appreciated.
    Thanks
    Edit: Extra info
    I have cinema 4d studio r14
    Up to date After Effects CC
    Quicktime is installed
    Im on Windows 7

    Well, no offense, but you seriously should read the C4D help. That's normal specular shading behavior and it is uniform acroos the plane because you obviously haven't defined any scene lights and use the default viewport light. Read up on how to create materials and adjust there properties and then learn the fine art of scene lighting as well as how to use object buffers to isolate objects with multipass renders.
    Mylenium

  • Images Change Colors between monitors while the UI stays the same

    Hey! Im having an issue where photoshop changes the colors when I move the window between my monitors, seen here: http://sta.sh/04y5s60vf3j This isnt due to the monitors themselves being different, it actually changes after a few seconds of moving it inbetween the monitors. The left one has been callibrated with a spyder 3 elite which I no longer have access to. I applied the file with windows color management instead of the spyder utility. The second one is new, and it is not callibrated by anything, but instead was done by hand with the built in brightness/contrast/custom RGB settings. Both of them are very close to eachother, enough so for my tastes. but when photoshop changes what the image looks like, it's causing problems. Interestingly enough, when I disable callibration for the monitor on the left, the image does not change colors between monitors, but instead always appears as it does on the right. but then they don't match up and the whole screen looked washed out because it's uncallibrated, so that doesnt do me any good. Another interesting thing to point out, is when this image is saved as a .JPG, and viewed with firefox the image appears exactly like the monitor on the LEFT (which is my main monitor) despite the left monitor being the one that is force changed. does anyone have any suggestions? It also appears that windows photoviewer is behaving the same way, though firefox does not. Meaning when I open an image in all 3 on the left monitor, they look the same, but when opened on the right monitor, windows photo viewer and photoshop both display the image as brighter and redder than firefox does. This is frustrating, because it seems photoshop is changing the image with my callibration on my left monitor to match what it looks like on the web, which it does. but it doesn't do this for the right monitor, or when the left is uncallibrated. Another issue I can see with this is even if the UI is the same shade of gray, the images are different between the monitors because of this change. Does anyone have any suggestions?
    - BD

    Alright! So I reread through all this, poked at some things on the internet, and I'm going to attempt to summarize what would be a good solution for all this (And it seems, it still won't be perfect, but to get myself into the best environment I can for not messing with images for an hour trying to make them look nice before I post them to the web. I painted something yesterday on the cintiq, popped it over to my laptop screen and it just looked washed out and terrible.)
    1. Get a X-rite EODIS3 i1 Display Pro, Callibrate laptop and cintiq. I do have the money to drop on something like this, especially if it's a time saver.
         Things I'm not sure about:
              a. There was a ton of complaints about the software not working when I checked reviews, but also a ton that said everything was great. most of them were mac users though.
              b. I'm not sure if problems would still be posed, even while calibrated, by me having a wide gamut monitor.
              c. I'm a terrible excuse for a human being and I think the colors showing up brighter on the wide gamut screen is pretty (I should just make my images this bright on a normal screen and there won't be any issues. >.>)
    2. Set Firefox to color manage (easy enough)
    3. Change my photoshop working space to sRGB (since they'll have been calibrated at this point)
    3. Accept the fact that most of the people who look at my work will be doing so on a monitor that is almost certainly uncalibrated, and I can't control what they will see on my screen, but I CAN control if the colors are -actually- what I want them to be on any properly calibrated device. which is probably the best way to go anyways.
    4. Make paintings, have fun.
    Now, you two have been going on about all sorts of interesting things in here, and it seems that calibration issue run much much deeper than I ever thought. Do either of you have recommendations for how I should tweak this list of things to do or other things I can/ should do? I'm not currently a working professional, but if I have anything to say about it, I will be within a few years (I'm going to school for illustration and studying concept design on my own time) so it'd be useful for me to get into good habits now.
    - Brendavid

  • When using quicktime screen recorder, the recording changes colors

    Please help me out!! So I've had my macbook air for a while now and I've used the quicktime screen recorder multipul times, but latley something changed. When I go to record my screen everything works fine, and once its finished and I've saved it it's still normal. But once I go to import it into imovie the entire recording turns red, I can still see the recording but everything is just red! Everywhere else the recording looks fine, but its only when I try to put it into imovie that it changes colors. Its never done this before and all of my past screen recordings work fine.
    Does anyone know what I can do to fix it?
    Any advice would be greatly appreciated!
    Thank you

    Hello meaganmarie,
    I am assuming you have quicktime up to date (10.3)
    When recording a game window,
    - select quicktime
    - go to file > New Movie Recording
    - select your game window like a rectangular marquee selection (drag and make a rectangle filling only your game window
    - stop when done and save
    This way the endtire screen (including youe desktop) won't be seen, just your selected game window.
    Regards,
    Asevenc

  • Change colors to all components in a consistent way

    Is there a way to change color to all components of an application (or of a JFrame), such as all JButtons backgrounds, JFrame backgrounds etc.?
    I suppose i've to deal with UIManager defaults, but is there some facility, or some check-list to help achieve this task?.
    Thanks in advance
    Agostino

    Check out my ComponentMapper class. You could do it with this by running the mapper on the contentpane (and potentially the JMenuBar too if you like)
    You are welcome to use and modify this code but please don't change the package or take credit for it as your own work
    tjacobs.util.ComponentMapper
    ======================
    package tjacobs.util;
    import java.awt.Component;
    import java.awt.Container;
    import java.awt.TextComponent;
    import javax.swing.JFileChooser;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    import javax.swing.event.DocumentEvent;
    import javax.swing.event.DocumentListener;
    import javax.swing.text.JTextComponent;
    public class ComponentMapper {
         public static interface MappedFunc {
              public void func(Component c);
         public static void map(Component c, MappedFunc func) {
              func.func(c);
              if (c instanceof Container) {
                   Container con = (Container)c;
                   int count = con.getComponentCount();
                   for (int i = 0; i < count; i++) {
                        map(con.getComponent(i), func);
         public static void main(String[] args) {
              JFileChooser fc = new JFileChooser();
              MappedFunc mf = new MappedFunc() {
                   public void func(Component c) {
                        if (c instanceof JTextComponent) {
                             System.out.println("found");
                             final JTextField tf = ((JTextField)c);
                             tf.setEditable(false);
                             tf.getDocument().addDocumentListener(new DocumentListener() {
                                  public void insertUpdate(DocumentEvent de) {
                                       Runnable r = new Runnable() {
                                            public void run() {
                                                 tf.setText("");
                                       SwingUtilities.invokeLater(r);
                                  public void removeUpdate(DocumentEvent de) {
                                  public void changedUpdate(DocumentEvent de) {
                             while (c != null) {
                                  System.out.println(c.getClass());
                                  c = c.getParent();
                             //disable the textfield
              map(fc, mf);
              fc.showSaveDialog(null);
    }

  • Some visited links don't change color

    on some of my hyperlinks (that go to other pages in the same
    file) don't change color after they've been visited... example:
    they start out regular "hyperlink" blue... then after visiting they
    should change (e.g., to purple) but they don't.
    I read in the knowledge base that for popups, the color WON'T
    change because of a javascript issue... however, the "non changing"
    links are not always for pop ups... as stated above.
    Any ideas?
    Thanks...
    kb

    Thanks, Dimaxum...I've already read this thread, and every other thread about the subject on the internet. I am totally convinced this is a Safari issue because the links have always changed color for me using FireFox...always.
    I'm sure there could be other situations where something else caused this problem and it was apparent on both browsers, but not in my case.
    On my wife's Mac this is not a problem on Safari...it's something in my User folder causing it. For now I've just made FireFox the default browser and I'll keep searching. Or the next time I wipe my hard drive and rebuild everything (I do this every six months or so...old Windows habit that isn't necessary) I'm sure it will work fine then.
    I was at the Apple store yesterday and tried several Macs there...they all worked fine. This is just somethiing on my machine.
    Thanks for your help.
    Larry

  • Change color of Comments in Pages

    I want to change the color/shading of each comment in a pages document. I would like changing the color of the comment to change the shading of the comment's anchor, its bubble and the line between the two.
    Is this possible today? If not, how about an enhancement!
    Thanks!
    Rodger

    Rodger,
    You can change the color of the text you type into the comment bubble and you can even add a paragraph fill color to the background, but it won't change the yellow outlining in the comment bubble or the anchor.
    While I appreciate you investing me with the power to enhance Pages, you'll have to leave feedback for the Pages development team if you want to make them aware of your feature requests.
    -Dennis

  • Changing colors brings up a new dialog I've never seen before...

    Hi,
    I think I broke my Photoshop CS4.
    For some reason, when I try to change colors anywhere (it could be the color of text, or the main foreground color) a dialog with swatches appears instead of the eyedropper tool I'm used to using in this scenario. I can't click on anything else in the screen except the options in this annoying swatches dialog.
    It looks like this :
    This is extremely annoying and frustrating, as this dialog won't tell me what the hexadecimal color values are (even when I click "Define Custom Colors").
    As of right now, the project I was working on is stalled until I figure out how to make this thing go away and let me use the eyedropper tool to change the color of something.
    This problem is new. I had my CS4 running since it came out and it never did this before.
    Thanks for any help you can provide!

    Edit>Preferences>General Change the color picker from Windows to Adobe.

  • Change colors, in detail

    I found that selecting a high contrast Theme is the only way to change some details of each of the different colors (Hyperlinks, Disabled text, Selected text, etc.) of a window.  When a high contrast screen is selected, I can search for "change
    color" and select "change the color of your taskbar and window borders" and I'll get to a "Color and Appearance" screen that is not available for any non-high contrast theme.  However, even this added ability to customize the
    screen colors falls far short of complete control.
    My custom Yahoo! page looses the text coloration differences to show stocks that are going up (green) vs. going down (red).  I also seem to have very little control of Outlook coloration.  As I am on my PC for most of every working day, I need
    the ability to provide good contrasting colors on all my window screens.  I am disappointed that Microsoft has not fine tuned this feature by now.  Most everything else about 8.1 I like quite a bit.
    William Fearn

    You're no longer allowed to customize the colors to the extent you used to be able to do so.  Microsoft has reduced our ability to make the desktop easier to use by configuring or "theming" it with something more pleasing than the (IMO)
    fairly broken theme they provide.  I personally find the loss of drop shadows tremendously reduces utility.
    I believe it's a plot by Microsoft Marketing to try to get people to dislike using the desktop so that they can get more support for Metro/Modern. 
    It ain't working!
    There are folks who have figured out how to "hack" the OS to enable better theme support, and one who's even re-implemented the Aero Glass effects.  Some of them hang out at
    msfn.org.  These things can be employed to make it easier on the eyes (I've managed some improvement).
    As far as Outlook 2013 / 365 goes...  There's little hope, since even a theme replacement doesn't affect it.  The Office team rolled their own UI, probably to help their Marketing department out.  On the Microsoft forum elsewhere
    is
    a thread with something like 700 responses from people who claim their eyes are bleeding from trying to use the latest version of Office.  Most claim Office 2010 was far better.
    Here's the really disturbing part:  Microsoft isn't releasing stuff by accident.  They're actively making the desktop harder to use - on purpose.  And their marketing is trying to turn it into an "Emperor's New Clothes"
    situation with concepts/terms like "digitally authentic" and "skeuomorphism is bad".
    Yes, it stinks for those of us who work with the desktop day in and day out.  You're not alone.  But you won't find many folks who'll stand up and agree with you, because pragmatism is not
    fashionable.
    -Noel
    Detailed how-to in my eBooks:  
    Configure The Windows 7 "To Work" Options
    Configure The Windows 8 "To Work" Options

  • Moving a rectangle or change color in "Run-Time "?

    First step, the objects of decoration you can modify its properties in "Run-Time "?
    Moving a rectangle or change color in "Run-Time "?
    I want to develop a mini SCADA application, where I have to do some animations usingsimple objects like Shapes.

    Yes, it is possible to modify decorations in runtime. An example is below.
    As you can see, you just need to get a reference to the front panel containing the decoraitions, and then use the Decos[] property to get an array of references to the decorations. These can be passed to a property node.
    Unfortunately, the decorations cannot be given a unique identifier, such as a label. So if you have multiple decorations, it can be tricky to modify the properties of a specific one. If you are only dealing with one shape, this won't be an issue. One roundabout way to pick out a particular decoration would be to search through the array references until you find the one with matching size and location on the front panel. Alternatively, you could use a disabled control, such as a boolean push button with no caption, and refer to that directly.
    Hope this helps.
    -Garrett

Maybe you are looking for

  • Default Mail attachments to "View As Icon"

    Is there a way to default attachments to "View As Icon" instead of previewing them in Mail? Specifically MP3s, since there's no way to drag the preview player directly into iTunes. I know I can just right click to change, but I get a lot of emails wi

  • Add Wireless N Router To Network With An Actiontec Router

    Hi everyone, I know this wireless N thing is being beaten to death but I just really need to be pointed in the right direction.  I recently built a HTPC setup with a SiliconDust HD Homerun network tuner so I could share three tuners with computers on

  • Net Price does not reflect on Consignment PO even after maintaining info re

    Dear Experts, I have created consignment PO but the net price does not reflect on it. I have already maintained valid consignment info record for this material with reference to standard purchasing organization in ME11. Would appreciate your views ..

  • How to create Alphanumeric Number Range

    Hello Experts , I want to create a alphanumeric number range for vendor . Could you please give some information on the the format to specify in Number range transaction ? For Example : How do I create  CDPDM01DKK   vendor Regards Shashank

  • Problem with triggers

    An Oracle 8 application isn't working apparently because the triggers are messed up. How can I fix this?