Change background color  for JFrame

hi,
i want to change background color of JFrame. In my application i didn't create any panels.
my code like this,
Frame myFrame = new JFrame ( " Grid Layout Frame ");     
myFrame.setSize(500,500);     
myFrame.getContentPane().setBackground(Color.white);
myFrame.setVisible(true);thanks,
Balaji

You don't get a white frame when you run this program?import java.awt.*;
import javax.swing.*;
public class junk
     public static void main(String[] args) throws Exception
          JFrame f = new JFrame("Hello");
          f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          f.setSize(500,500);
          f.getContentPane().setBackground(Color.white);
          f.setVisible(true);
}

Similar Messages

  • How can I change background color for a text field

    Hi I tried this
    style="BACKGROUND-COLOR:#00FFFF"
    working fine in IE
    but not working in Netscape.. any other way to set the background color?

    Netscape 4.x does not support this feature. Only Netscape 6.x does.

  • Change the background color for HToggleButton as State changed

    Hi , I want to change the background color of HToggleButton or HGraphicButton as its state changed as normal to focus and then focus to normal and same with actioned state .It is possible to change the image with different states but how can I do the same thing to change background color .I'll appreciate any help regarding this with thanks in adv.

    Satya,
    i_x denotes first column and not characctersitic 1.
    Also I am not sure if the check is to be for IS_SUM.
    Use Get_Cell_info class instance and then use the data returned by the same for checking IS_SUM and then change the cellstyle.
    Another thing to look out for is , the required change might be needed on DATA_CELL and notcharacteristic_cell.
    Arun
    Assigning points is a way of saying thank you on SDN

  • How to give Common Background color for all JPanels in My Swing application

    Hi All,
    I am developing a swing application using The Swing Application Framework(SAF)(JSR 296). I this application i have multiple JPanel's embedded in a JTabbedPane. In this way i have three JTabbedPane embedded in a JFrame.
    Now is there any way to set a common background color for the all the JPanel's available in the application??
    I have tried using UIManager.put("Panel.background",new Color.PINK);. But it did not work.
    Also let me know if SAF has some inbuilt method or way to do this.
    Your inputs are valuable.
    Thanks in Advance,
    Nishanth.C

    It is not the fault of NetBeans' GUI builder, JPanels are opaque by default, I mean whether you use Netbeans or not.Thank you!
    I stand corrected (which is short for +"I jumped red-eyed on my feet and rushed to create an SSCCE to demonstrate that JPanels are... mmm... oh well, they are opaque by default... ;-[]"+)
    NetBeans's definitely innocent then, and indeed using it would be an advantage (ctrl-click all JPanels in a form and edit the common opaque property to false) over manually coding
    To handle this it would be better idea to make a subclass of JPanel and override isOpaque() to return false. Then use this 'Trasparent Panel' for all the panels where ever transparency is required.I beg to differ. From a design standpoint, I'd find it terrible (in the pejorative sense of the word) to design a subclass to inconsistently override a getter whereas the standard API already exposes the property (both get and set) for what it's meant: specify whether the panel is opaque.
    Leveraging this subclass would mean changing all lines where a would-be-transparent JPanel is currently instantiated, and instantiate the subclass instead.
    If you're editing all such lines anyway, you might as well change the explicit new JPanel() for a call to a factory method createTransparentJPanel(); this latter could, at the programmer's discretion, implement transparency whichever way makes the programmer's life easier (subclass if he pleases, although that makes me shudder, or simply call thePanel.setOpaque(false) before returning the panel). That way the "transparency" code is centralized in a single easy to maintain location.
    I had to read the code for that latter's UI classes to find out the keys to use (+Panel.background+, Label.foreground, etc.), as I happened to not find this info in an authoritative document - I see that you seem to know thoses keys, may I ask you where you got them from?
    One of best utilities I got from this forum, written by camickr makes getting these keys and their values very easy. You can get it from his blog [(->link)|http://tips4java.wordpress.com/2008/10/09/uimanager-defaults/]
    Definitely. I bit a pair of knucles off when discovered it monthes after cumbersomely traversing the BasicL&F code...
    Still, it is a matter-of-fact approach (and this time I don't mean that to sound pejorative), that works if you can test the result for a given JDK version and L&F, but doesn't guarantee that these keys are there to stand - an observation, but not a specification.
    Thanks TBM for highlighting this blog entry, that's the best keys list device I have found so far, but the questions still holds as to what specifies the keys.
    Edited by: jduprez on Feb 15, 2010 10:07 AM

  • Background color for column heading

    Hi,
    I have 5 columns in my report and I would like to have different background color for column headings. How can I do this in report templates?
    I was looking at Column heading section-
    <th class="t10ReportHeader"#ALIGNMENT# id="#COLUMN_HEADER_NAME#">#COLUMN_HEADER#</th>
    How can I specify backgrund colors for all columns here?
    Thanks in advance

    G'day Karen,
    Thanks for ur reply.
    I have seen this note before, its not that the header colors have changed after latest SP was applied in our systems. Also the ABAP and JAVA stacks are in sync.
    Scenario is that we are trying to set up a new Portal theme for Enterprise Reporting with some specific color codes (hex codes).
    What i have observed is Characterstics Header background color is set up using the element "Background Color of Level 1 Column Heading ".
    While the Background color for Key Figures header is using element "Background Color of Level 2 Column Heading ".
    But the problem is element "Background Color of Level 2 Column Heading " is also used as the Background color for Standard Characterstics cell, so if we make it same the whole report of the same color, which we dont want.
    Requirement is to get the same Background color for Header cells (both Char. and Key Figure headers).
    Any further suggestions will be appreciated.
    Thanks
    CK

  • Changing background color in JTable, only changes one row at a time...

    I'm trying to change the color of rows when the 5th column meets certain criteria. I think I'm very close, but I've hit a wall.
    What's happening is the row will change color as intended when the text in the 5th column is "KEY WORD", but when I type "KEY WORD" in a different column it will set the first row back to the regular colors. I can easily see why it's doing this, everytime something is changed it rerenders every cell, and the listener only checks the cell that was just changed if it met the "KEY WORD" condition, so it sets every cell (including the previous row that still meets the condition) to the normal colors. I can't come up with a good approach to changing the color for ALL rows that meet the condition. Any help would be appreciated.
    In this part of the CellRenderer:
            if (isSelected)
                color = Color.red;
            else
                color = Color.blue;
            if (hasFocus)
                color = Color.yellow;
            //row that meets special conditions
            if(row == specRow && col == specCol)
                color = color.white; I was thinking an approach would be to set them to their current color except for the one that meets special conditions, but the two problems with that are I can't figure out how to getColor() from the table, and I'm not sure how I would initially set the colors.
    Here's the rest of the relevant code:
        public void tableChanged(TableModelEvent e)
            int firstRow = e.getFirstRow();
            int lastRow  = e.getLastRow();
            int colIndex = e.getColumn();
            if(colIndex == 4)
                String value = (String)centerTable.getValueAt(firstRow, colIndex);
                // check for our special selection criteria
                if(value.equals("KEY WORD"))
                    for(int j = 0; j < centerTable.getColumnCount(); j++)
                        CellRenderer renderer =
                            (CellRenderer)centerTable.getCellRenderer(firstRow, j);
                        renderer.setSpecialSelection(firstRow, j);
    import javax.swing.table.*;
    import javax.swing.*;
    import java.awt.Component;
    import java.awt.Color;
    public class CellRenderer extends DefaultTableCellRenderer
        int specRow, specCol;
        public CellRenderer()
            specRow = -1;
            specCol = -1;
        public Component getTableCellRendererComponent(JTable table,
                                                       Object value,
                                                       boolean isSelected,
                                                       boolean hasFocus,
                                                       int row, int col)
            setHorizontalAlignment(JLabel.CENTER);
            Color color = Color.green;
            if (isSelected)
                color = Color.red;
            else
                color = Color.blue;
            if (hasFocus)
                color = Color.yellow;
            if(row == specRow && col == specCol)
                color = color.white;
            //setForeground(color);
            setBackground(color);
            setText((String)value);
            return this;
        public void setSpecialSelection(int row, int col)
            specRow = row;
            specCol = col;
    }If I'm still stuck and more of my code is needed, I'll put together a smaller program that will isolate the problem tomorrow.

    That worked perfectly for what I was trying to do, but I've run into another problem. I'd like to change the row height when the conditions are met. What I discovered is that this creates an infinite loop since the resizing triggers the renderer, which resizes the row again, etc,. What would be the proper way to do this?
    Here's the modified code from the program given in the link. All I did was declare the table for the class, and modify the if so I could add the "table.setRowHeight(row, 30);" line.
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.border.*;
    public class TableRowRenderingTip extends JPanel
        JTable table;
        public TableRowRenderingTip()
            Object[] columnNames = {"Type", "Company", "Shares", "Price", "Boolean"};
            Object[][] data =
                {"Buy", "IBM", new Integer(1000), new Double(80.5), Boolean.TRUE},
                {"Sell", "Dell", new Integer(2000), new Double(6.25), Boolean.FALSE},
                {"Short Sell", "Apple", new Integer(3000), new Double(7.35), Boolean.TRUE},
                {"Buy", "MicroSoft", new Integer(4000), new Double(27.50), Boolean.FALSE},
                {"Short Sell", "Cisco", new Integer(5000), new Double(20), Boolean.TRUE}
            DefaultTableModel model = new DefaultTableModel(data, columnNames)
                public Class getColumnClass(int column)
                    return getValueAt(0, column).getClass();
            JTabbedPane tabbedPane = new JTabbedPane();
            tabbedPane.addTab("Alternating", createAlternating(model));
            tabbedPane.addTab("Border", createBorder(model));
            tabbedPane.addTab("Data", createData(model));
            add( tabbedPane );
        private JComponent createAlternating(DefaultTableModel model)
            JTable table = new JTable( model )
                public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
                    Component c = super.prepareRenderer(renderer, row, column);
                    //  Alternate row color
                    if (!isRowSelected(row))
                        c.setBackground(row % 2 == 0 ? getBackground() : Color.LIGHT_GRAY);
                    return c;
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            table.changeSelection(0, 0, false, false);
            return new JScrollPane( table );
        private JComponent createBorder(DefaultTableModel model)
            JTable table = new JTable( model )
                private Border outside = new MatteBorder(1, 0, 1, 0, Color.RED);
                private Border inside = new EmptyBorder(0, 1, 0, 1);
                private Border highlight = new CompoundBorder(outside, inside);
                public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
                    Component c = super.prepareRenderer(renderer, row, column);
                    JComponent jc = (JComponent)c;
                    // Add a border to the selected row
                    if (isRowSelected(row))
                        jc.setBorder( highlight );
                    return c;
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            table.changeSelection(0, 0, false, false);
            return new JScrollPane( table );
        public JComponent createData(DefaultTableModel model)
            table = new JTable( model )
                public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
                    Component c = super.prepareRenderer(renderer, row, column);
                    //  Color row based on a cell value
                    if (!isRowSelected(row))
                        c.setBackground(getBackground());
                        String type = (String)getModel().getValueAt(row, 0);
                        if ("Buy".equals(type)) {
                            table.setRowHeight(row, 30);
                            c.setBackground(Color.GREEN);
                        if ("Sell".equals(type)) c.setBackground(Color.YELLOW);
                    return c;
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            table.changeSelection(0, 0, false, false);
            return new JScrollPane( table );
        public static void main(String[] args)
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
        public static void createAndShowGUI()
            JFrame.setDefaultLookAndFeelDecorated(true);
            JFrame frame = new JFrame("Table Row Rendering");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.add( new TableRowRenderingTip() );
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
    }Edited by: scavok on Apr 26, 2010 6:43 PM

  • How to change background color in online editor

    How to change background color in online editor

    Jeff,
    if you try to change all the plsql keywords to the same background color (that is not either white or black or blue) via the options panel in SQL Developer (Code Editor > PLSQL syntax colors), you will get the new background color in the worksheet only for the areas with plsql text, while the areas without any text will have the same background color as the base color scheme you started with. This means that there is no way to change the "general background" color via the options panel, but you have to use the same background color of one of the predefined color schemes.
    This seems to me a bug, but probably it's not considered high priority, so it will not be fixed for the time being.
    I would like to stress the fact that being able to change the color scheme of the development environment that you use every day about 8 hours a day can make quite a difference on your eyes at the end of the day.
    Thanks,
    Paolo

  • How to change background color in photoshop cs3

    how to change background color in photoshop cs3
    Please help me...

    Background for what? You need to explain better and be more specific.
    Mylenium

  • How to set background color for selected days in DateChooser

    How to set background color for selected days. I created
    checkbox for each day [Son,Mon,Tue,Wed,Thu,Fri,Sat] and a
    DateChooser, I want to change the background color for the selected
    day when i click on a button after selecting the desired checkboxs
    [ monthly wise/yearly wise]
    Thanks in advance

    There is no button involved in the following code, but it may
    be of use to you:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    private var origColor:uint;
    private function init():void {
    origColor = dc.getStyle("selectionColor");
    public function setBackGrdColors(newColor:uint):void {
    dc.setStyle("selectionColor", origColor);
    if(dc.selectedDate){
    var dayOfWeek:Number = dc.selectedDate.day;
    else{
    return;
    switch(dayOfWeek) {
    case 0:
    if(sun.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 1:
    if(mon.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 2:
    if(tue.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 3:
    if(wed.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 4:
    if(thu.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 5:
    if(fri.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 6:
    if(sat.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    default:
    break;
    ]]>
    </mx:Script>
    <mx:VBox horizontalAlign="center" verticalGap="20">
    <mx:DateChooser id="dc" textAlign="left"
    change="setBackGrdColors(cellColor.selectedColor)"/>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="sun" label="Sun"/>
    <mx:CheckBox id="mon" label="Mon"/>
    <mx:CheckBox id="tue" label="Tue"/>
    <mx:CheckBox id="wed" label="Wed"/>
    </mx:HBox>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="thu" label="Thu"/>
    <mx:CheckBox id="fri" label="Fri"/>
    <mx:CheckBox id="sat" label="Sat"/>
    </mx:HBox>
    <mx:HBox width="300" horizontalAlign="center">
    <mx:Label text="Background Color" />
    <mx:ColorPicker id="cellColor"
    selectedColor="#FF00FF"/>
    </mx:HBox>
    </mx:VBox>
    </mx:Application>

  • Change background color during text edit mode

    THis is a wacky problem...
    I have a presentation template. The slide master has white copy in the title and black copy in the body/bulleted list.
    When I try to use the template and edit the title copy, the background color for editing that line is white, just like the text, so I can't see what I'm typing. I can't figure out how to change the background color during text edit mode so that I can actually see what I'm typing. Is there a way to make this transparent?
    For some reason, the body copy edit works fine: black text edited in either a white or transparent background color.
    help!

    THis is a wacky problem...
    I have a presentation template. The slide master has white copy in the title and black copy in the body/bulleted list.
    When I try to use the template and edit the title copy, the background color for editing that line is white, just like the text, so I can't see what I'm typing. I can't figure out how to change the background color during text edit mode so that I can actually see what I'm typing. Is there a way to make this transparent?
    For some reason, the body copy edit works fine: black text edited in either a white or transparent background color.
    help!

  • Change background color

    HI guys,
    I have a question:
    In the Form 6I exists a Text Item with own scrollbar.
    Are there any options to change background color on scrollbar attached to that item?
    Thanks in advance,
    John.
    Message was edited by:
    IMJL

    In the Form 6I exists a Text Item with own scrollbar.If you rae talking about text item, you can set property word yes and vertical scroll = yes
    For second question ,as Francois said, the answer is No

  • Change background color of textbox based on non-visible value

    Hello,
    I have a 10g master - detail form. I was wondering how can I change background color of text box (NAME) based on non-visivle item (MODIFIED_BY) value.
    So far, I have created two visual attributes and have put following code on "WHEN_NEW_BLOCK_INSTANCE" trigger
    if( :main.MODIFIED_BY = 'COCO') then
         SET_ITEM_PROPERTY('main.NAME',VISUAL_ATTRIBUTE,'VA_BLUE');
    else
         SET_ITEM_PROPERTY('main.NAME',VISUAL_ATTRIBUTE,'VA_RED');
    end if;
         But, it always goes to "ELSE" part and make RED color for all records. Could you please help me with this?
    Thanks.

    Got it.
    Post Query trigger on block
         if (:main.MODIFIED_BY ='COCO') then
              set_item_instance_property('main.NAME',current_record,visual_attribute,'VA_BLUE');
         else
              set_item_instance_property('main.NAME',current_record,visual_attribute,'VA_RED');
         end if;Thanks

  • Set property for  background color for JButton

    I am attempting to change the colors of the UI for JButton. The change does not appear to be taking. The reason appears to be that JButton, and for that matter JLabel setOpaque(false); How can I globally change this to setOpaque(true);
    Second is there a way to save the default property hash table after the changes are made so that it will run the next time the program is executed.

    Thank you for responding. I don't feel that I have been clear in the statement of the problem. I have written a medium size desktop application(20,000 statements). I am trying to customize the color scheme by modifying the default laf properties color entries. I can modify JPanel through a put to the properties hash table. When I attempt to change the background color for JLabel and JButton it doesn't seem to take. I believe that the reason it doesn't take is because opaque(false). Is there a property that allows the overide of opaque to true or do I have to change all of the numerous JButtons in my program.
    I have decided to store all changes in a file and make the changes at the point that the program initializes each time its run.
    I am not looking for specific code but an approach.
    I would appreciate your advice.

  • Change background color of thumbnail

    How and where can I change the background color for the thumbnails listed in my pdf folder?  Currently they are sort of pink and I would like to change the color to white.

    Can you post this on the PVII support forums?
    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
    ==================
    "dflorentine" <[email protected]> wrote in
    message
    news:eeva67$jd8$[email protected]..
    > Hi,
    > Just purchased Image Gallery Magic. Since it's
    overwhelmingly praised on
    > this
    > forum, I am hoping someone here can quickly help me with
    a couple
    > problems.
    > First - here's the link:
    >
    www.intelligentbydesigngraphics.com/transcendingtime/weddings.html
    >
    > Questions:
    > 1) I've inserted the gallery into an existing site that
    has a black
    > background. There must be a way to change the background
    color of the
    > thumbnail panel to something other than white, but how?
    > 2) As you roll your mouse over the thumbnail panel
    number boxes they get
    > smaller, why and how do I fix it?
    >
    > Thanks in advance for any advice!
    > P.S. I am a novice, so please take that into
    consideration before
    > replying! ;)
    >
    >

  • Set Background color for headers in excel

    DECLARE
       v_fh     UTL_FILE.file_type;
       v_dir    VARCHAR2 (30)      := 'my dir';
       v_file   VARCHAR2 (30)      := 'test.xls';
       PROCEDURE run_query (p_sql IN VARCHAR2)
       IS
          v_v_val   VARCHAR2 (4000);
          v_n_val   NUMBER;
          v_d_val   DATE;
          v_ret     NUMBER;
          c         NUMBER;
          d         NUMBER;
          col_cnt   INTEGER;
          f         BOOLEAN;
          rec_tab   DBMS_SQL.desc_tab;
          col_num   NUMBER;
       BEGIN
          c := DBMS_SQL.open_cursor;
          -- parse the SQL statement
          DBMS_SQL.parse (c, p_sql, DBMS_SQL.native);
          -- start execution of the SQL statement
          d := DBMS_SQL.EXECUTE (c);
          -- get a description of the returned columns
          DBMS_SQL.describe_columns (c, col_cnt, rec_tab);
          -- bind variables to columns
          FOR j IN 1 .. col_cnt
          LOOP
             CASE rec_tab (j).col_type
                WHEN 1
                THEN
                   DBMS_SQL.define_column (c, j, v_v_val, 4000);
                WHEN 2
                THEN
                   DBMS_SQL.define_column (c, j, v_n_val);
                WHEN 12
                THEN
                   DBMS_SQL.define_column (c, j, v_d_val);
                ELSE
                   DBMS_SQL.define_column (c, j, v_v_val, 4000);
             END CASE;
          END LOOP;
          -- Output the column headers
          UTL_FILE.put_line (v_fh, '<ss:Row>');
          FOR j IN 1 .. col_cnt
          LOOP
             UTL_FILE.put_line (v_fh, '<ss:Cell>');
             UTL_FILE.put_line (v_fh,
                                   '<ss:Data ss:Type="String">'
                                || rec_tab (j).col_name
                                || '</ss:Data>'
             UTL_FILE.put_line (v_fh, '</ss:Cell>');
          END LOOP;
          UTL_FILE.put_line (v_fh, '</ss:Row>');
          -- Output the data
          LOOP
             v_ret := DBMS_SQL.fetch_rows (c);
             EXIT WHEN v_ret = 0;
             UTL_FILE.put_line (v_fh, '<ss:Row>');
             FOR j IN 1 .. col_cnt
             LOOP
                CASE rec_tab (j).col_type
                   WHEN 1
                   THEN
                      DBMS_SQL.COLUMN_VALUE (c, j, v_v_val);
                      UTL_FILE.put_line (v_fh, '<ss:Cell>');
                      UTL_FILE.put_line (v_fh,
                                            '<ss:Data ss:Type="String">'
                                         || v_v_val
                                         || '</ss:Data>'
                      UTL_FILE.put_line (v_fh, '</ss:Cell>');
                   WHEN 2
                   THEN
                      DBMS_SQL.COLUMN_VALUE (c, j, v_n_val);
                      UTL_FILE.put_line (v_fh, '<ss:Cell>');
                      UTL_FILE.put_line (v_fh,
                                            '<ss:Data ss:Type="Number">'
                                         || TO_CHAR (v_n_val)
                                         || '</ss:Data>'
                      UTL_FILE.put_line (v_fh, '</ss:Cell>');
                   WHEN 12
                   THEN
                      DBMS_SQL.COLUMN_VALUE (c, j, v_d_val);
                      UTL_FILE.put_line (v_fh,
                                         '<ss:Cell ss:StyleID="OracleDate">'
                      UTL_FILE.put_line (v_fh,
                                            '<ss:Data ss:Type="DateTime">'
                                         || TO_CHAR (v_d_val,
                                                     'YYYY-MM-DD"T"HH24:MI:SS'
                                         || '</ss:Data>'
                      UTL_FILE.put_line (v_fh, '</ss:Cell>');
                   ELSE
                      DBMS_SQL.COLUMN_VALUE (c, j, v_v_val);
                      UTL_FILE.put_line (v_fh, '<ss:Cell>');
                      UTL_FILE.put_line (v_fh,
                                            '<ss:Data ss:Type="String">'
                                         || v_v_val
                                         || '</ss:Data>'
                      UTL_FILE.put_line (v_fh, '</ss:Cell>');
                END CASE;
             END LOOP;
             UTL_FILE.put_line (v_fh, '</ss:Row>');
          END LOOP;
          DBMS_SQL.close_cursor (c);
       END;
       PROCEDURE start_workbook
       IS
       BEGIN
          UTL_FILE.put_line (v_fh, '<?xml version="1.0"?>');
          UTL_FILE.put_line
             (v_fh,
              '<ss:Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">'
       END;
       PROCEDURE end_workbook
       IS
       BEGIN
          UTL_FILE.put_line (v_fh, '</ss:Workbook>');
       END;
       PROCEDURE start_worksheet (p_sheetname IN VARCHAR2)
       IS
       BEGIN
          UTL_FILE.put_line (v_fh,
                             '<ss:Worksheet ss:Name="' || p_sheetname || '">'
          UTL_FILE.put_line (v_fh, '<ss:Table>');
       END;
       PROCEDURE end_worksheet
       IS
       BEGIN
          UTL_FILE.put_line (v_fh, '</ss:Table>');
          UTL_FILE.put_line (v_fh, '</ss:Worksheet>');
       END;
       PROCEDURE set_date_style
       IS
       BEGIN
          UTL_FILE.put_line (v_fh, '<ss:Styles>');
          UTL_FILE.put_line (v_fh, '<ss:Style ss:ID="OracleDate">');
          UTL_FILE.put_line
                           (v_fh,
                            '<ss:NumberFormat ss:Format="dd/mm/yyyy\ hh:mm:ss"/>'
          UTL_FILE.put_line (v_fh, '</ss:Style>');
          UTL_FILE.put_line (v_fh, '</ss:Styles>');
       END;
    BEGIN
       v_fh := UTL_FILE.fopen (v_dir, v_file, 'w', 32767);
       start_workbook;
       set_date_style;
       start_worksheet ('OM');
       run_query ('select PARTY_ID,PARTY_NAME from HZ_PARTIES
        where PARTY_ID<1080');
       end_worksheet;
       start_worksheet ('PO');
       run_query ('SELECT AGENT_ID,TYPE_LOOKUP_CODE FROM PO_HEADERS_ALL
            WHERE PO_HEADER_ID<20');
       end_worksheet;
       end_workbook;
       UTL_FILE.fclose (v_fh);
    END;
    Here i will get two outputs in same excel with different spread sheets,
    now i want to set background color for headers i
    ex:PARTY_ID,PARTY_NAME,AGENT_ID,TYPE_LOOKUP_CODE are the headers,in excel output i want background color as blue.
    Please do need full help,its urgent req.

    Hello,
    open the file in Excel and save it, just to ensure that Excel writes all the additional stuff it thinks is necessary.
    Now change the background colour of the header and save the file again but with a different name.
    Open both files in a text editor and look at the differences. That's what you need to change in your code.
    Alternatively you can use packages like xml_spreadsheet or ExcelDocumentType, both write the same file format that you use in your code and you don't have to reinvent the wheel.
    Regards
    Marcus

Maybe you are looking for