Table Background color

I am building a scroll pane and adding the table to the same. I am setting the table background color to blue. But only the rows which have data come in as with the background color blue, rest all the space with in the scroll pane comes in as grey.. can someone help?

import java.awt.*;
import javax.swing.*;
public class TableExample {
    public static void main(String[] args) {
        JScrollPane sp = new JScrollPane(new JTable(4, 2));
        sp.getViewport().setBackground(Color.GREEN);
        JFrame frame = new JFrame("TableExample");
        frame.getContentPane().add(sp);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
}

Similar Messages

  • CS3 Table Background Color Won't Change

    I have been inserting tables and doing the CSS for them fine
    until after I inserted a Flash object. All tables inserted after
    the Flash object have a medium blue background??? I can't even
    intiate a new CSS rule to change the table background color... it
    just stays this way!?!? Very strange. Anybody else experience this?
    BTW: I've restarted my machine, worked on tables on other
    pages and haven't experienced this issue... it is only after the
    insertion of the flash object. Is there something I'm missing??
    Thanks,
    Chris
    Here is the code inserted by the Flash object placement just
    in case this helps any:

    Let's see the page, please.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "escargo" <[email protected]> wrote in
    message
    news:[email protected]...
    >I have been inserting tables and doing the CSS for them
    fine until after I
    > inserted a Flash object. All tables inserted after the
    Flash object have a
    > medium blue background??? I can't even intiate a new CSS
    rule to change
    > the
    > table background color... it just stays this way!?!?
    Very strange.
    > Anybody
    > else experience this?
    >
    > BTW: I've restarted my machine, worked on tables on
    other pages and
    > haven't
    > experienced this issue... it is only after the insertion
    of the flash
    > object.
    > Is there something I'm missing??
    >
    > Thanks,
    > Chris
    >
    > Here is the code inserted by the Flash object placement
    just in case this
    > helps any:
    >
    >
    >
    > <script type="text/javascript">
    > AC_FL_RunContent(
    > 'codebase','
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#
    >
    version=9,0,28,0','width','758','height','508','title','Contractor
    > Performing
    > Pool Contruction, Remodels, Service & Maintenance in
    > Sarasota','src','index','quality','high','pluginspage','
    http://www.adobe.com/sho
    >
    ckwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','index'
    > );
    > //end AC code
    > </script>
    > <noscript>
    > <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    > codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
    > rsion=9,0,28,0" width="758" height="508" title="New
    Construction,
    > Remodels,
    > Service &amp; Maintenance">
    > <param name="movie" value="index.swf" />
    > <param name="quality" value="high" />
    > <embed src="index.swf" quality="high"
    > pluginspage="
    http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Versio
    > n=ShockwaveFlash" type="application/x-shockwave-flash"
    width="758"
    > height="508"></embed>
    > </object>
    > </noscript>
    >

  • Table background colors and images

    This should be easy, but I am not seeing it. I have a few pages with existing tables, probably created in DW CS3. In DW CS4, I need to select a table inside a cell of another table and assign a solid color for the background. Currently, the larger table has a textured background image and it is also filling the background of the table inside it.
    I can easily select the smaller table, but I don't see the old familiar information bar where I'd assign a color to the entire table.
    Any help would be appreciated.
    M. Jackson

    Hi Nancy O,
    I started a long time ago with Adobe Page Mill, then had to move to GoLive, and later into DW.
    The appeal of Page Mill was the GUI, letting a non-programmer make web pages visually, and letting the program write the code for me. Each upgrade have moved farther from that concept in my opinion.
    I just want to add tables and if DW wants to apply CSS to them, then fine. Maybe I will have to learn to do it in CSS, but it is not high on my current list of priorities. I'd prefer to spend most of my learning time in Photoshop. For now, I have quite a few pages that just need some tweaking and I don't have the extra time to dig into this venture.
    Thanks for taking the time to try to counsel me.  A couple of my photographer friends have suggested looking into Site Grinder as a plug-in to Photoshop. As I read the reviews, the artist group think it is the greatest and the code writers say it is not great at writing code.
    For now, I installed DW CS3 and made a few changes I can live with. CSS some other day or some other way.
    Best regards,
    M. Jackson

  • Background Colors??

    Is it possible to customize cell and table background colors?
    I've got the eyedropper thing down - but is there a way to enter
    the desired color, such as #CCFFCC? I've been wrestling with this
    for awhile... a work around would be a way to translate #CCFFCC
    into Hue, Sat, Lum, or Red, Green, Blue values and then I'll use
    the system color picker. Any advice would be appreciated.

    Hi, I need someone to tell me how to create colored
    messages or even how to put images as background of
    my messages. I receive many of them but I'm unable to
    create one. I'm already not using only text option
    but the other one available.
    You find an answer to background color for Email using OS 10.3.9?
    Irwin Meyers

  • Editable Table Background

    Hi,
    I'm new to dreamweaver-so hopefully this is an easy
    question. I'm trying to create a template for our website, but I
    want one of the tables to have a different background on every
    page. I can edit the text, but haven't been able to set the
    background to editable. Any thoughts?
    Thanks
    Matt

    On Fri, 26 Oct 2007 15:09:19 +0000 (UTC), "kairosmatt"
    <[email protected]> wrote:
    >Hi,
    > I'm new to dreamweaver-so hopefully this is an easy
    question. I'm trying to
    >create a template for our website, but I want one of the
    tables to have a
    >different background on every page. I can edit the text,
    but haven't been able
    >to set the background to editable. Any thoughts?
    > Thanks
    > Matt
    >
    Give each page a unique title in the body tag:
    <body id="pageTitle">
    and in your css file have a different css code for each
    #pageTitle table {background-color:gray;}
    #pageTitle2 table {background-color:silver;}
    etc etc
    ~Malcolm N....
    ~

  • Problem with cfdocument and background colors with table borders

    i am having a great deal of difficulty with cfdocument
    rendering my tables with cells that have background colors. the
    background colors seem to bleed through the table border. a picture
    at 100% magnification can be seen at
    http://www.vitad.com/cfdoc.jpg
    and at 1600% magnification at:
    http://www.vitad.com/cfdoc2.jpg.
    i am attaching sample code of the what generated the pdf in the
    pictures. btw, i am running cfmx 7 with hot fix 2.

    Hi fresher4flex,
    Since you are using the item Renderer for the DataGrid Column try to apply the styles dynamically to the background of your itemRenderer by making using of the rollOver and rollOut events.
    Thanks,
    Bhasker

  • Custom Action to change selected column's Background color for a table in CEWP

    I have a OOTB CEWP. When I insert a table to this, I would like to see a context menu that would give me an option to change the selected cell's/row's/table's properties like cell padding/cell spacing/background color etc.
    How can this be achieved using SP2013 ribbon's custom actions. It would be great if we could add all these properties on a separate contextual tab when row/cell/table is selected.
    Rajasekar A.C

    Hi,
    If the table in Content Editor Web Part, we don’t need to use SharePoint Ribbon to achieve it.
    We can insert some input button and use jQuery to change the table tr/td background color.
    The code like this:
    <style type="text/css">
    .highlight {
    background-color: red;
    </style>
    <script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {
    $("#TableID tr").click(function () {
    $(this).toggleClass("highlight");
    </script>
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Change the background color of a table created by ADDT (Login)

    I am trying to change the background color of a table in the login form created by the developer's toolbox. I then go and select the table and change the background color. But it has no effect. The only insight I have is when I delete this "" from the Action in the form, then the table's background color changes. As far as I can tell this line of code is only return the url of the page.
    I am not understanding something.
    Does anyone have any insight?
    Thanks!

    the table is linked using a CSS rule..
    the CSS rules comes from something called Skins..
    see mxkollection2.css.
    KT_XXX are the class ID's for table names.
    if u change this rule it will effect all the tables which use that rule in ur whole website.
    u can try switching skins from ADDT control panel.
    KT_tngtable is the tables css rule name defined in skins /Skinname/tng.css
    hope this helps u ..
    mohnkhan
    http://www.mohitech.com

  • How do I change the background color of a row in a table indicator?

    Hello,
      How do I change the background color of a row in a table indicator? I know how to change the background color in a active cell, but that is not what I want. My first intent is to make the background color of the first row a unique color, such as green, just to highlight the top row of the table.
    Regards,
    Kaspar
    Regards,
    Kaspar

    I have done this before by using a for loop to change the active cell of a row in order to give the appearance that the whole row is turning the color at once.
    CLA, CLED, CTD,CPI, LabVIEW Champion
    Platinum Alliance Partner
    Senior Engineer
    Using LV 2013, 2012
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.

  • How to set background color in af:inputText in an af:table

    Hi,
    how to set background color in af:inputText in an af:table depending on the value of af:inputText.
    For example, how to set background red if the af:inpuText is empty
    Thanks

    Hello Pavo,
    it's also possible to take the code from ebitar and use the expression within styleClass instead of inlineStyle.
    E.g. you can define a custom style "StyleClassEmptyText" in your skin and set this styleclass if af:inputtext is empty.
    By using style classes you can have the same style in the whole application and you are able to change this style on a single point(in the styleclass) for the whole application.
    br
    Peter

  • How to change background color of row of a table in a panel table

    hi! im trouble right now, somebody help me. i have a matrix of row and column, panel row and panel table in jsp. my problem is how can i change the background color of a row once it clicked. i have row in table which have panel table with panel column and panel row.
    i have already work for it but i only change the background color once i clicked is the first row and first column then the rest row and column is not working..pls.. give me sample code for it..thnx a lot!!!
    Thnank's,
    froilet

    Ok! I have 2 jsp, the input jsp and display.jsp! Once i input value on input.jsp, it will display on display.jsp. I have also my javascript named updateBin.js. Now, how can i update each row once i clicked it... the succeeding rows and columns..hope u help me with this..here is my code:
    Display.jsp
    <html:html locale="true">
    <head>
         <html:base/><meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Strip Map Loader</title><script type="text/javascript" src="js/updateBin.js"></script>
    </head>
         <%      
              int intRow = Integer.parseInt(request.getParameter("intRows"));
              int intColumn = Integer.parseInt(request.getParameter("intColumns"));
              int intPanelRow = Integer.parseInt(request.getParameter("intPanelRows"));
              int intPanelColumn = Integer.parseInt(request.getParameter("intPanelColumns"));
         %>
    <BODY bgcolor="#33b9ec" leftmargin="50%">
         <b>Strip ID:  </b><font color="red" face="arial"><b><bean:write name="strStripID" scope="request" /></b></font>
         <br><br>
         <font size="3" face="tahoma"><b>Bins Updater Tool:</b></font>
         <table border="1" width="365px" bgcolor="#1ea6f7" height="15">
              <tr>
                   <td valign="top" align="center">
                        <table><tr><td><font size="2">Select Bin Type:</font></td>
                        <td><select id="binType" onchange="updateBin()" size="1">
                             <OPTION></OPTION>
                             <OPTION value="green">Good Bin</OPTION>
                             <OPTION value="red">Reject Bin</OPTION>
                        </select></td></tr></table>
                   </td>
    </tr>
    </table>
    <table id="tbl" align="center" border="1" cellspacing="3" cellpadding="5" bgcolor="#CC9900">
    <tr>
    <td>                                                  
         <%for (int pnlrows=1; pnlrows<=intPanelRow; pnlrows++){%>     
              <table id="table" width="100%" border="1" bgcolor="#CC9900" cellspacing="7" cellpadding="0" align="center">
              <tr>
              <%for(int pnlcols=0; pnlcols<intPanelColumn;pnlcols++){%>               
              <td>
                        <%for (int rows=1;rows<=intRow; rows++){%>                    
                        <table cellspacing="5" width="100px" align="center" bgcolor="#CC9900">
                        <tr>
                             <td>                    
                             <%for(int cols=1; cols<intColumn; cols++){%>
                             </td>     
                             <td id="col" bgcolor="#008000" align="center" ondblclick="changeCol()"> X </td>          
                             <%}%>
                             <td id="row" bgcolor="#008000" align="center" ondblclick="changeRow()"> X </td>
                             <td></td>     
                             <%}%>                                                  
                        </tr>
                        </table>
              <%}%>
              </td>
              </tr>
              </table>     
         <%}%>
    </td>
    </tr>
    </table>
    and this is my javascript code:
         function updateBin()
              var binType=document.getElementById("binType")
              if(binType.value == "green")
              [binType.selectedIndex].value
              //binType = changeR();
              //alert('Good Bin Selected');
              if(binType.value == "red")
              [binType.selectedIndex].value
              //binType = changeC();
              //alert('Reject Bin Selected');
              if(binType.value == "")
                   alert('Please select only on the category!')
         function changeRow()
              if(binType.value=="green")
              x=document.getElementById('row').style.background="green";     
              alert('Updated!')     
              if(binType.value=="red")
              x=document.getElementById('row').style.background="red";
              //alert('Reject Bin Updated!')
         function changeCol()
              if(binType.value=="green")
                   x=document.getElementById('col').style.background="green";     
                   alert('Updated!')     
              if(binType.value=="red")
              x=document.getElementById('col').style.background="red";
              //alert('Reject Bin Updated!')
    this code only updates the first row and column..but the succeeding panel row and panel column can't update...what will i do? theres something wrong in my javascript or in my jsp...pls help me......thanx.....in advance!!

  • Change the background color of selected row in adf table

    Hi,
    Can somebody guide me in changing the background color of a row when its being selected. In my ADF table, one of the column is of type Command Link. So whenever i click this command link on any particular row that complete row color should change as an indication of that row being selected.
    Please guide me to do this. I referred to other forum posts, but they couldnt meet my need.
    Thanks
    ri

    Hi Frank,
    you're right. This should work. But the result is not perfect from my point of view.
    I use
    <af:table ...>
      <af:column ...>
        <af:outputText value="#{row.col1}" inlineStyle="#{row.mystyle}"/>
      </af:column>
    </af:table>and I get e.g. this in HTML:
    <table ...>
      <tr>
        <td class="af_column_cell-text OraTableBorder1111"><span style="font-weight:bold;">qqq</span></td>
      </tr>
    </table>while I would prefer to get somethig like this:
    <table ...>
      <tr>
        <td style="font-weight:bold;"><span>qqq</span></td>
      </tr>
    </table>, which looks much smarter. Is it possible?
    Thanks,
    Alexandre.

  • How to control background color of table cell in an html report?

    I am using Labview 6.1 to generate a report.  In that report there is a table created using the Append Numeric Table to Report VI.  I want to be able to programmatically control the background color of each cell in the table.  Also, how can I programmatically control the background color of the row and header cells of the same table.  I am also generating a second table in the same report using the Append Text Table to Report VI and I would like to programmatically control the background colors of the cells in that table as well.  Thanks.

    Hi epsilon-d...,
    i´m not sure if there is an ready to use function to do what you want, but you can enlarge the available function. Open the "Append Numeric Table to Report.vi" and go to the HTML Case. There you can see another vi which creates the html table. In the VI "HTML Report Table Row" you can add the option: bgcolor="your color" inside of the "TR" tag.
    Hope it helps.
    Mike

  • Background color change of a column in Advance table

    Hi,
    We have requirement to change the background color of column in advance table based on some condition. We tried putting code to change background color in Custom.xss using background-color property and setting newly created css dynamically based on condition but it seems it only changes the background color of text not the complete cell. We want to change the color of complete cell in an advance table.
    Please let me know if there is any other way I can achieve this requirement. Any help would be highly appreciated.
    Thanks

    <FONT FACE="Arial" size=2 color="2D0000">
    Pls look into "Alter Table"section.
    LOB_storage_clause
    This might help
    -SK
    </FONT>

  • ADF Table row background color change ???

    Hi All
    i got below sql view object
    SELECT DEPARTMENT_ID,JOB_ID,COUNT(*) FROM EMPLOYEES GROUP BY DEPARTMENT_ID,ROLLUP(JOB_ID)
    By using this i will get each department_id, jobid's and total employes count in each department
    and i will get rollup for each departments ie i will get total employees.
    So i want to change the back ground of the total row.
    DepartmentId     JobId     Count1
    SA_REP 1
    1
    10     AD_ASST     1
    10     1 < this row in RED back ground in JSF page
    20     MK_MAN     1
    20     MK_REP     1
    20     2 < this row in RED back ground in JSF page
    30     PU_MAN     1
    30     PU_CLERK     5
    30     6< this row in RED back ground in JSF page
    40     HR_REP     1
    40     1< this row in RED back ground in JSF page
    50     ST_MAN     5
    50     SH_CLERK     20
    50     ST_CLERK     20
    50     45< this row in RED back ground in JSF page
    any kind of help is welcome...
    thanks
    Ravi

    Hi,
    you can do this by setting the background color of the outputText component that is the cell component e.g. in a read only table. Use the inlineStyle property to set the background-color but get the string from a managed bean. For each row you get a call to the managed bean and you can use JSF value binding
    FacesContext.getCurrentInstance().getApplication().createValueBinding()
    to access #{row} so that you can determine the value of a row column. Based on this you return a color
    Frank

Maybe you are looking for

  • Cannot open pdf files in Firefox.

    I cannot open pdf files in Firefox. (I can in Chrome). I tried Menu - Preferences - PDF - Use Adobe Acrobat Professional. Also tried the same with PDF Browser Plugin 2.4.4 Clicking on a PDF link just opens a blank page.

  • Mac freeze

    When my mac mac goes to sleep for several minutes minutes I 'awake it' only to find I get a message telling me to restart the computer. Is this just a simple ammendment I have overlooked. Nicho1.

  • My Flash CS3 document got corrupted and its not showing timeline frames & drawings on stage. How to retrieve it?

    My Flash CS3 document got corrupted when I clicked on the option "Save & Compact".Now its not showing timeline frames & drawings on stage. Can someone please help me by telling how can I retrieve my work..???

  • E72 - The driver \Driver\WUDFRd failed to load for the device ROOT\SYSTEM\0001

    I have a problem with my ThinkCentre E72 (Windows 8). Suddenly, it shuts down with "shut-down" screen. Later, in my Event Viewer, I found the following System Warning: "The driver \Driver\WUDFRd failed to load for the device ROOT\SYSTEM\0001" where t

  • MSI 845g MaxL 6580 Video Problem

    I resently put together a computer w/MSI 845g max L motherboard,P4 2.26,Leadtech geforce 4 4600,corsair xms 2700 256 meg,western 80 gig 8 meg buffer hd,enermax 350m watt power supply,toshiba 16x dvd windows xp home. It ran perfectly over 12000 3d mar