Colors in JTable - unexpected result when scrolling

Hi Guys,
Looks like I'm having a problem with a JTable.
I have a list of items and they are distinguished by 2 colors (so the end-user can differentiate between them). Anyway, the table colors work ok but when using a JScrollbar the table receives an unexpected result � few of the first items (which are not identical) share the same color.
anyone?
Example of an output (Gil will be colored Green, Dan Yellow, James Green�and so forth)
Gil
Gil
Gil
Dan
Dan
Dan
James
James
James
James
my code looks like this (I'll appritiate if someone can point out where I can have the html tags to display it correctly)
aTable = new JTable(dataModel)
public Component prepareRenderer(TableCellRenderer r, int row, int col)
Component c = super.prepareRenderer(r, row, col);
Color bg = Color.YELLOW;
String[] valuesRaw = (String[]) model.elementAt(row);
if (changeRround)
name1=valuesRaw[0];
changeRround=false;
name2=valuesRaw[0];
if (!name1.equals(name2))
this.switchColor(bg,c);
changeRround=true;
return c;
public void switchColor(Color bg, Component c)
if (colorSwitcher%2==0)
bg = new Color(221, 250, 207);
c.setBackground(bg);
c.setForeground(Color.BLACK);
else
bg = new Color(253, 252, 193);
c.setBackground(bg);
c.setForeground(Color.BLACK);
colorSwitcher++;
}

I'm getting there...
        aTable = new JTable(dataModel)
            public Component prepareRenderer(TableCellRenderer r, int row, int col)
                 Component c = super.prepareRenderer(r, row, col);
                 Color bg = Color.YELLOW;         
                 String[] valuesRaw = (String[]) model.elementAt(row);         
                 if (changeRround)
                     name1=valuesRaw[0];
                     changeRround=false;
                     name2=valuesRaw[0];
                 if (name1.equals(name2))
                 else
                     this.switchColor(bg,c);                    
                     changeRround=true;
                 return c;
             public void switchColor(Color bg, Component c)
                if (colorSwitcher%2==0)
                    bg = new Color(221, 250, 207);
                    c.setBackground(bg);
                    c.setForeground(Color.BLACK);
                else
                    bg = new Color(253, 252, 193);
                    c.setBackground(bg);
                    c.setForeground(Color.BLACK);
                colorSwitcher++;
            }

Similar Messages

  • Unexpected results, when creating a pdf from Illustrator (cs3)

    A customer has supplied a 'print ready' pdf, created in Illustrator [cs3]. The file contains grey text [20% black], but when they have printed to pdf [using acrobat 8], the breakdown of the 'grey' changes in colour to a cmyk value [45,36,35,1) instead of 0,0,0,20 as originally created in Illustrator.
    I've replicated the customers error from scratch, and have found that, when you save [save-as] the file as a pdf [using acrobat 8 settings] and resulting pdf is correct = 20% black.
    These errors where generated using a pc platform. We also tried to reproduce the error on our Mac's, but the Mac system didn't generate any issues.
    Does anyone know why illustrator would produce [using the same native file] two different results when producing pdf's? We've check all colour management, etc. and still can't figure out why this is happening.

    I have heard of this issue, but trying to remember is an issue by itself. lol. Seams to me there is an option for true blacks 0,0,0,? and cmy blacks ?,?,?,0. I am almost positive there are a few threads on this forum about this.

  • Unexpected result when using Ls -L

    I'm no code warrior, and I'm studying the ATS book Mac OSX Support Essentials.
    When I type Ls -L, I get a list of the folders/directories in the home folder but not the info that the CLI returns for the book.
    Typing Ls -Le returns the exact same result as typing Ls -L.
    I've tried both multiple times.
    This discrepancy is really not helping me understand, and I MUST pass this exam. If I can't even get past chap 3, I'm dead.
    Any help will be greatly appreciated.
    DLS

    I get a list of Folders in a table format:
    test-installs-macbook-pro:~ testinstall$ Ls -L
    Desktop Movies Send Registration
    Documents Music Sites
    Downloads Pictures
    Library Public
    In the Book it returns a list format with the item type and permissions followed by number of subitems, owner, assigned group, modification date and the item's name.
    The format in the book looks like this:
    drwx----------+ 5 owner staff 170 Aug 20 15:49 Desktop
    drwx----------+ 3 owner staff 102 Aug 20 01:08 Documents
    I don't get this so I hit a brick wall for the rest of the lesson which builds upon this.
    Thanks for your help
    DLS
    Message was edited by: MacDLS

  • Unexpected result when parsing a datetime using sap.ui.core.format.DateFormat

    I am parsing datetime values in order to use them in an makit Chart.
    My x axis is a time axis with values in the JavaScript datetime format like 1408177125000.
    I wondered about a time shift in my axis and see the following result:
    console.log(Date(fValue) ): Thu Aug 28 2014 18:01:44 GMT+0200 (Mitteleuropäische Sommerzeit)
    console.log(oDateFormat.format(new Date(fValue))): 16.08.2014 11:23:33
    The date in line 01 is correct, the second one (16.8.) is not correct.
    I tried to simulate this behaviour in jsbin but there line 02 only states an error!?
    http://jsbin.com/sodetoyoqaba/1/edit?html,js,console
    I have no clue what is going wrong here. Any ideas?
    P.S. My app is running in SAP HCP Trial with sap.ui.version 1.22.6 while on jsbin it is version 1.22.7
    P.P.S When hitting the code manually in the jsbin console then I also get the wrong date 16.08.2014 there. So you can see the behaviour also there.

    That pretty much makes sense (although ignoring things is not very kind) 
    Good thing: Question is answered.
    Bad thing: The converted date is not what I expected from my datasource :-( At least I know where to search further now .
    Thanks,
    Mark

  • Unexpected result when saving image of front panel in EXE

    Below code is used to save an image of the front panel of a VI. The front panel shows an XY graph with two plots.
    This works perfectly in the development environement. With the EXE, the plots of the graph (only the plots) are invisible.
    Have you already encountered this unexpected behaviour ? Many thanks for any advice.
    Solved!
    Go to Solution.

    JB,
    A few things may be messing you up. 
    When you build the EXE, the path that is created for the "Current Vi's Path" probably won't be where you want it.  I would use "Application Directory" or "Default Data Directory".  These path things have messed me up a few times when creating a EXE.
    Also is the data on your graph being generated before you are running the section of code in your picture?  I assume it is since you state that it is working in the development environment.
    What version of LV are you using?
    Joe

  • How can I change scrollbar colors? It's hard to see the menu selection/color when scrolling through bookmarks, for example.

    How can I make clearer the menu highlight selections, for example when scrolling through my bookmarks. The light blue color is hard to see in Windows 7. How do I change that color?? Running FF 3.6.6
    == This happened ==
    Every time Firefox opened

    " Is there anyway I can define individually as to what color should be related to each text in ring menu?"
    Well not with a ring and not programatically.
    The best I can suggest is a picture ring, see below.
    Ben
    Message Edited by Ben on 11-18-2005 02:16 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Picture Ring.JPG ‏5 KB

  • SSRS 2012 background color format by expression issue when exporting to Excel.

    We are using SSRS 2012. We have a report that conditionally formats a background color for some cells. The report renders properly in a browser and in Excel 2003 format. In Excel format all cells after the first one that meets the condition are highlighted,
    even if only one cell should.
    The sample expression that triggers this condition looks like this:
    =IIF(Fields!VIOL_NOTE.Value="Internal","Green","No Color")
    All cells after the first one that meets the condition Fields!VIOL_NOTE.Value="Internal" have a green background.
    Excel 2003 (proper) results:
    Excel (improper) results:
    Zenon

    Hi Zenon,
    Based on your description, I try to reproduce the issue in my test environment, however it is work well. After export the report to Excel and Excel 2003, I can get exact same result when open the Excel file in Excel 2010.
    Did you open the repot in Excel 2003 or Excel 2007-2010? Please post more deatils, so we can help to work out this issue.
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click
    here.
    Fanny Liu
    TechNet Community Support

  • "Milky" or faint results when exporting from AE to FCP

    (Accidently posted to FCP Express forum-- whoops!)
    I've been using After Effects for years now to create graphics for our Avid projects, and the QT results have always been great. Clean, sharp moving graphics. But now that I've been using FCP, I'm not exactly happy when I export my Quicktime graphics from After Effects to FCP: they're extremely "milky" and faint/fuzzy when viewed from FCP over an NTSC monitor. I have tried various codecs when exporting: DV/NTSC, Animation, Component-- all with the same results.
    I have read other threads with similar comments (even the thread that mentioned "milky" results when exporting from FCP to AE and back) but none of the suggestions/remarks helped in my situation.
    I'm sure others have experienced this. Any suggestions?
    Settings:
    After Effects comp: NTSC/DV Preset (720 x 480, lower field, etc.)
    Export Codecs: DV/DVCPro-NTSC, Animation, Component (all with the same milky results)
    Final Cut: Sequence Preset "DV/NTSC 48 Khz"
    Also tried using, as one thread suggested, the "Uncompressed 8 bit NTSC 48 Khz" preset and no difference
    Side note: I'm using Final Cut in this system outputting to both DV video and Betacam video, using an Aja card for the Beta. Both DV and Beta results look the same (going straight thru the decks-to-NTSC monitor) and they both use the same "DV/NTSC 48 Khz" sequence preset-- except where I changed it to "Uncompressed 8 bit". If I use Animation or Component as my export codec from AE, naturally, I have to render to play the clip back in the timeline. It even looks milky or faint on the FCP source/viewer screens!
    And yes, I've checked the NTSC monitor-- a Sony Trinitron PVM-20 monitor. And I've looked at the results on other monitors and even regular TVs. Milky/faint video all around.
    Any suggestions would be appreciated!!

    Is this on files with alpha channels? Have you tried
    changing the Alpha type? Are you having
    pre-multiplication problems?
    No, they don't have alpha channels. But I did try, when rendering with Animation, changing the colors to "Millions +" which was something I read on another thread. Same results.
    Basically, these are After Effects projects with simple backgrounds and moving text. I'm not doing any layering with alpha channels-- like lower third supers.
    However, whenever I use Apple programs like LiveType or Motion, the NTSC results look like they did while I was creating the projects with these programs before I rendered them.

  • Adobe Reader 9 highlights text when scrolling in terminal server

    Running a terminal server with WIndow 2003.  Have Adobe 9 Reader installed.  When a pdf is opened, it will look correct.  However, when one uses the scroll bar on the right to see more of the document, text can be highlighted and change colors constantly when scrolling.
    Test it outside of terminal server and it works fine.  This issue did not happen with other versions of Reader.  I have attached two samples one clean and one highlighted. 
    Any help is appreciated

    Very cool. Thanks for the info!
    Date: Fri, 16 Oct 2009 10:42:24 -0600
    From: [email protected]
    To: [email protected]
    Subject: Adobe Reader 9 highlights text when scrolling in terminal server
    Okay. Here is what I found. These settings are changed\saved under the User settings in the registry. Here is the key the changes are made to:
    HKCU\Software\Adobe\Adobe Reader\9.0\Originals
    When "NONE" is selected from Adobe Reader - Edit - Preferences - Page Display - Rendering, three DWORD values are added to the above mentioned registry key. These are:
    Value Name - Value Data
    *bAntialiasText - 0
    benableDDR - 0
    iAntialiasThreshold - 12*
    I have added these lines to a login script that adds the necessary DWORD values to default the "Rendering" to NONE.
    *reg add "HKCU\Software\Adobe\Acrobat Reader\9.0\Originals" /V bAntialiasText /T REG_DWORD /F /D 0
    reg add "HKCU\Software\Adobe\Acrobat Reader\9.0\Originals" /V benableDDR /T REG_DWORD /F /D 0
    reg add "HKCU\Software\Adobe\Acrobat Reader\9.0\Originals" /V iAntialiasThreshold /T REG_DWORD /F /D 12*
    Cheers!
    >

  • Brief blurriness when scrolling in scanned PDF

    Hello all. I frequently find that when scrolling through pages in a scanned PDF, it takes a second or two for the page images to resolve; that is, they appear blurry at first and only a second or two later do they resolve into clear page images. The PDFs are about 50 pages long, in color, and were scanned at 300 dpi with moderate compression (they are about 75mb each). Is there any way to fix this? Thanks.

    Could you please share the document with us?

  • Color Correction Auto Levels results uneven

    Good Mornig,
    My Color Correction Auto Levels results are uneven. I applied them to a short clip to Test, and they look fine when they apply...but every now and then there is a flicker for a few frames/seconds and it reverts to original colors. I have a 6month old computer 64bit, 12gigs ram....and it is only a 5 minute clip.
    Any suggestions??
    Thanks in advance

    did somemore testing and i think you will be correct.
    Why is this?...is it because Auto is "too broad a brush" or my computer doesn't have enough power (12 gigs ram??)
    or is it a software weakness.  is this usually the same for other, similar, effects??

  • My iMac (Maverick) freezes up when scrolling

    When scrolling my computer freezes up.  The arrow works but I cannot scroll using the track pad.  Batteries are fresh.

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Click the Clear Display icon in the toolbar. Then try the action that you're having trouble with again. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message (command-V).
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.

  • JTable Blank Rows When INSERT/DELETE in other panel with same ViewObject

    Hi,
    Jdev 10.1.2
    JClient
    2 panels based on same ViewObject in same AM
    One panel with Grid UI => JTable
    Other panel with Form UI
    When I insert or delete a record in the panel with Form UI and return to the panel with JTable blank rows are displayed.
    The problem remains even after commiting before returning to JTable panel.
    When I activate the execute button in the JTable panel, the display is OK but the currency is lost.
    I suppose calling the refresh method when returning to the JTable panel should solve the problem.
    Can you please suggest me a server-side/model workaround:
    refresh (which option to use ??)
    Thanks
    Frederic
    PS I tried the workaround of thread 10.1.2 JClient binding Error. but that doesn't help.

    Same problem with default wizard generated Master-Detail Form.
    When in the detail more then 10 rows exist, the scrollbar shows that not all rows are displayed.
    If I use the scrollbar to view the last rows they are blank, in order to display them I must activate the next button one time for each additional row.
    The workaround is to enter -1 in the range size of the iterator.
    But what if the range size is 10.
    Is the blank rows display a bug?
    OR
    Must the scrolling area (size of JScrollPane) be defined according to the range size of the iterator?
    If the latter is true:
    Can somebody give me some clues on which attributes of the JScrollPane must be set (PreferredSize, MinimumSize ??) and on how to calculate this area: total width & total height if the row height for the table is set to 20?
    Your help will be appreciated
    Frederic

  • Adobe Reader 10/10.1 document error when scrolling in IE

    I have Adobe Reader 10 installed on Windows XP SP3 and Windows 7, both with Internet Explorer 8.  On XP, no problems.  However, on Windows 7, some documents (those with multiple pages and multiple fields) get " Document error 118"  when scrolling past one or two pages.  I have tried  this with Reader 10 and 10.1, same results on both platforms.  All documents are on our intranet.  Unfortunately due to some important external sites I cannot set "View PDF in Browser" to off, which solves this problem.
    One additional note, the website we use (again, it's internal/local domain) shows as a trusted site in the IE notification bar at the bottom, however when a PDF is open from that web site the URL shown is part of our domain but the IE windows shows it as an unknown zone....

    I am having exactly the same problem. I am using Windows 7. I have uninstalled and reinstalled several times and it is getting very frustrating.

  • Best results when changing RGB to CMYK

    Hi There,
    How can I get the best results when converting a RGB to CMYK? For example, a tif visual when offset printing... Is there any programme, plug in, machine for this?
    Many thanks

    I agree with Marco U.
    I might have said: only use Perceptual if an extremely important color in a photo changes terribly using Relative Colorimetric -- otherwise use that. The reason: The former method can make the whole picture shift (usually yellower and weaker) but the latter can make several distinctly different colors (like 3-5 different reds for example) and make them the same. Usually, one or two really strong colors can get shifted somewhat, but won't be noticeable in an otherwise great looking image.
    The secret to converting for good print color is to choose the source and target correctly.
    If you are serious about color, buy the book "Real World Color Management" by Bruce Fraser, Chris Murphy and Fred Bunting.
    http://www.amazon.com/Real-World-Color-Management-2nd/dp/0321267222/ref=pd_bbs_sr_1?ie=UTF 8&s=books&qid=1198178251&sr=1-1
    Sadly, Bruce Fraser passed away, so the book may not go to a third edition.But you can still get the second edition and the first 5 or 6 chapters are an education in themselves.

Maybe you are looking for

  • How to wiggle a layer on odd frame numbers.

    Hello. I am using AE CS6. Now I am trying to make an cartoon animation, and now I am trying to wiggle some layers' position. But I don't want to wiggle the layers on every frame. I want to wiggle them only on odd frame numbers. I mean, I want to wigg

  • Samba - removing printer support [SOLVED]

    Why am I getting entries in my /var/log/samba/smdb.log like this when I have (I thought) disabled printing in my /etc/samba/smb.conf? $ tail /var/log/samba/smbd.log [2011/11/18 09:34:38.293887, 0] printing/print_cups.c:110(cups_connect) Unable to con

  • PE9 project keeps crashing

    I have a project that is continually crashing - it runs out of memory soon after starting it and has frequent runtime errors. I have addressed what I understand is a major consideration - reducing  the size of the still images I am using to 1000X750

  • After Effects error: RAM Preview needs 2 or more frames to playback (It's Back)

    Just upgeaded to 12.1 and this error is back. I have tried purging memory, restarting and closing all apps with no luck. System specs as follows... Mac Pro 2 x 2.4 Ghz Quad Core 40 GB of Ram ATI Radeon HD 5870 1GB of VRAM Any ideas? Mike

  • HT2999 why my ipod will not read a charger?

    why my ipod will not read a charger?