Set Gradiant color for JTabbedPane

Hi,
can any one tell me how to set a gradient color to Jtabbedpane?
Thanks in advance.
Regards,
Nandha.

There's a section on Gradients here:
http://java.sun.com/products/jfc/tsc/articles/swing2d/index.html

Similar Messages

  • How to set highlight color for JTabbedPane????

    Hi,
    In JTabbedPane class There are methods
    setbackGround(...) setForeGround(..) methods but
    what is the way to tell that, when a perticular Tab of a tabbedPane
    is selected it should be highlight with this color..
    Now every thing is defaulting to grey???
    Thanks

    you're talking about the tab/s of JTabbedPane?
    if so, put this line prior to creation of the JTabbedPane (will affect all JTabbedPanes)
    UIManager.put("TabbedPane.selected",new javax.swing.plaf.ColorUIResource(Color.YELLOW));

  • 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>

  • 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

  • A quick way to set different color for certain items in JList?

    is there a quick way of setting different color for certain items in JList?

    Either use HTML strings as the values in your JList (quickest, but may not be the most convenient, especially if your model isn't just text), or create your own ListCellRenderer (e.g. extend DefaultListCellRenderer).
    There is no such thing as "list.setItemForeground(int index, Color c)". You'll have to use one of the methods above.

  • Set different color for one JTree node

    hello,
    I managed to find how to set a color for Jtree nodes but the problem is that with my method all the nodes will b the same color whereas i'm looking to have nodes of different color depending on the situation.
    the method for setting all Jtree nodes the same color(other than black):
    tree.setCellRenderer(
    new DefaultTreeCellRenderer() {
       public Color getTextNonSelectionColor() {
         return Color.lightGray; } });I WANT TO CHOSSE EACH COLOR FOR EACH NODE
    help plz
    thanks

    You need to implement TreeCellRenderer interface
    public Component getTreeCellRendererComponent(JTree tree,
                                                  Object value,
                                                  boolean sel,
                                                  boolean expanded,
                                                  boolean leaf,
                                                  int row,
                                                  boolean hasFocus)You can know which node is rendering by check value argument. Please read DefaultTreeCellRenderer's code.

  • Hw do i set background color for ComboBox?

    If anyone knows how to set background color for disabeld (setEnabled(false)) of ComboBox in Windows Look and Feel. It will help me a lot.
    I don't know hoe to do it
    regards
    arun.

    At the start of your program add:
    UIManager.put("ComboBox.disabledBackground", Color.green);
    UIManager.put("ComboBox.disabledForeground", Color.blue);For a list of all the properties you can change with the UIManager see:
    http://www.discoverteenergy.com/files/ShowUIDefaults.java

  • How can I set the color for a textfield

    Hi all,
    I use a textfield and I want to set the color for characters which are typed in the textfield. I didn't find anywhere a solution for this. Do you know how I should implement this?
    Thanks

    Not possible. If you want this, you'll need to make a custonItem that implements this.

  • How to set background color for a JFrame

    Hi,
    i am new to swing programming. I have created a JFrame called framehelp and i placed some labels in the frame.
    I have set the background color as yellow for the frame ie by setBackground(new java.awt.Color(255, 255, 204));
    But after compiling the program i am still getting the background color of frame as gray.
    How can i change the background color of frame as lightish yellow.
    I have used NETBEANS to generate this code and i am posting the code..
    Kindly help me
    Thanks in adavance
    public class framehelp extends javax.swing.JFrame {
        /** Creates new form framehelp */
        public framehelp() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            jLabel4 = new javax.swing.JLabel();
            jLabel5 = new javax.swing.JLabel();
            jLabel6 = new javax.swing.JLabel();
            jLabel8 = new javax.swing.JLabel();
            jLabel9 = new javax.swing.JLabel();
            jLabel10 = new javax.swing.JLabel();
            jLabel11 = new javax.swing.JLabel();
            jLabel12 = new javax.swing.JLabel();
            jLabel13 = new javax.swing.JLabel();
            jLabel7 = new javax.swing.JLabel();
            jLabel14 = new javax.swing.JLabel();
            jLabel15 = new javax.swing.JLabel();
            jLabel16 = new javax.swing.JLabel();
            jLabel17 = new javax.swing.JLabel();
            jLabel18 = new javax.swing.JLabel();
            jLabel19 = new javax.swing.JLabel();
            jLabel20 = new javax.swing.JLabel();
            jLabel21 = new javax.swing.JLabel();
            jLabel22 = new javax.swing.JLabel();
            jLabel23 = new javax.swing.JLabel();
            jLabel24 = new javax.swing.JLabel();
            jLabel25 = new javax.swing.JLabel();
            jLabel26 = new javax.swing.JLabel();
            jLabel27 = new javax.swing.JLabel();
            jLabel28 = new javax.swing.JLabel();
            jLabel29 = new javax.swing.JLabel();
            jLabel30 = new javax.swing.JLabel();
            jLabel31 = new javax.swing.JLabel();
            jLabel32 = new javax.swing.JLabel();
            jLabel33 = new javax.swing.JLabel();
            getContentPane().setLayout(null);
            setBackground(new java.awt.Color(255, 255, 204));
            setForeground(new java.awt.Color(204, 204, 204));
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            jLabel1.setText("The CAME framework software measurement process evaluation is used to determine the Level of  measurement in the ITarea. This measurementprocess evaluation is ");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(40, 50, 41, 16);
            jLabel2.setText("performed individually for software coomponents ie SoftwareProduct, SoftwareProcess and SoftwareResource.");
            getContentPane().add(jLabel2);
            jLabel2.setBounds(40, 70, 41, 16);
            jLabel3.setText("Below we describe the steps which will guide through the measurement process evaluation. There are two types of evaluation considerd here, General evaluation");
            getContentPane().add(jLabel3);
            jLabel3.setBounds(40, 100, 913, 16);
            jLabel4.setText("and Evaluation with respect to a standard. The measurement intensions considerd by varoius measurement standards will be used in our tool based method.  ");
            getContentPane().add(jLabel4);
            jLabel4.setBounds(40, 120, 893, 16);
            jLabel5.setText("Information about the measurement standards can be found at     www.iso.org ,    www.ieee.org.");
            getContentPane().add(jLabel5);
            jLabel5.setBounds(40, 140, 542, 16);
            jLabel6.setText("Steps to calculate the MetricsLevel");
            getContentPane().add(jLabel6);
            jLabel6.setBounds(40, 190, 199, 16);
            jLabel8.setText("2 )  The opened frame consists of several  metrics and measures, evaluation level buttons, result textfields and selection choice lists. To calculate");
            getContentPane().add(jLabel8);
            jLabel8.setBounds(70, 240, 41, 16);
            jLabel9.setText("general Metricslevel without any standard, select general from Measurement standard choice list. then select Both from scaleType choice list and finally select metrics ");
            getContentPane().add(jLabel9);
            jLabel9.setBounds(90, 260, 949, 16);
            jLabel10.setText(" and measures from the frame and press MetricsLevel Button. The metricslevel for the selected metrics will be displayed in textfield1.");
            getContentPane().add(jLabel10);
            jLabel10.setBounds(90, 280, 756, 16);
            jLabel11.setText("3 ) To determine MetricsLevel with respect to a standard select a standard from MeasurementStandard choice list, select Both from ScaleType choice list and finally ");
            getContentPane().add(jLabel11);
            jLabel11.setBounds(70, 300, 933, 16);
            jLabel12.setText("select darkened metrics and measures and press MetricsLevel Button. The Metrics Level for the selected Metrics and standard will be diplayed in textfield1.");
            getContentPane().add(jLabel12);
            jLabel12.setBounds(90, 320, 883, 16);
            jLabel13.setText("4 ) Repeat steps 1 2, 3  for ProcessMeasurementEvaluation and ResourceMeasurementEvaluation menu items from the select menu.");
            getContentPane().add(jLabel13);
            jLabel13.setBounds(70, 340, 751, 16);
            jLabel7.setText("1 ) Select ProductMeasurementEvaluation menu item from the select menu,a frame called CAME framework software product measurement evaluation will be opened. ");
            getContentPane().add(jLabel7);
            jLabel7.setBounds(70, 220, 946, 16);
            jLabel14.setText("Steps to calculate MeasurementLevel");
            getContentPane().add(jLabel14);
            jLabel14.setBounds(50, 390, 214, 16);
            jLabel15.setText("1 ) Select ProductMeasurementEvaluation menu item from the select menu,a frame called CAME framework software product measurement evaluation will be opened.");
            getContentPane().add(jLabel15);
            jLabel15.setBounds(80, 420, 943, 16);
            jLabel16.setText("2 ) The opened frame consists of several  metrics and measures, evaluation level buttons, result textfields and selection choice lists. To calculate");
            getContentPane().add(jLabel16);
            jLabel16.setBounds(80, 450, 822, 16);
            jLabel17.setText("general Measurementlevel without any standard, select general from Measurement standard choice list. then select Quantitative measures from scaleType choice list ");
            getContentPane().add(jLabel17);
            jLabel17.setBounds(100, 470, 943, 16);
            jLabel18.setText("and finally select metrics and measures from the frame and press MeasurementLevel Button. The MeasurementLevel for the selected metrics will be displayed in textfield2.");
            getContentPane().add(jLabel18);
            jLabel18.setBounds(100, 490, 973, 20);
            jLabel19.setText("3 ) To determine MeasurementLevel with respect to a standard select a standard from MeasurementStandard choice list, select Quantitative measures from ScaleType choice list");
            getContentPane().add(jLabel19);
            jLabel19.setBounds(80, 510, 1009, 16);
            jLabel20.setText("and finally select darkened metrics and measures and press MeasurementLevel Button. The MeasurementLevel  will be diplayed in textfield2.");
            getContentPane().add(jLabel20);
            jLabel20.setBounds(100, 530, 799, 16);
            jLabel21.setText("4 )Repeat steps 1 2, 3  for ProcessMeasurementEvaluation and ResourceMeasurementEvaluation menu items from the select menu.");
            getContentPane().add(jLabel21);
            jLabel21.setBounds(80, 550, 748, 16);
            jLabel22.setText("Steps to calculate MeasurementProcessLevel");
            getContentPane().add(jLabel22);
            jLabel22.setBounds(50, 600, 262, 16);
            jLabel23.setText("1 ) Select ProductMeasurementEvaluation menu item from the select menu,a frame called CAME framework software product measurement evaluation will be opened.");
            getContentPane().add(jLabel23);
            jLabel23.setBounds(80, 630, 943, 16);
            jLabel24.setText("2 )The opened frame consists of several  metrics and measures, evaluation level buttons, result textfields and selection choice lists. To calculate");
            getContentPane().add(jLabel24);
            jLabel24.setBounds(80, 650, 819, 16);
            jLabel25.setText("general MeasurementProcesslevel without any standard, select general from Measurement standard choice list. then select Quantitative measures from scaleType ");
            getContentPane().add(jLabel25);
            jLabel25.setBounds(100, 670, 930, 16);
            jLabel26.setText("choice list, enter migrated metrics if any in textfield  below migrated metrics label and finally select metrics measures from the frame and press ");
            getContentPane().add(jLabel26);
            jLabel26.setBounds(100, 690, 818, 16);
            jLabel27.setText("MeasurementProcessLevel Button. The MeasurementProcessLevel for the selected metrics will be displayed in textfield3.");
            getContentPane().add(jLabel27);
            jLabel27.setBounds(100, 710, 691, 16);
            jLabel28.setText("3 ) To determine MeasurementProcessLevel with respect to a standard select a standard from MeasurementStandard choice list, select Quantitative measures from ");
            getContentPane().add(jLabel28);
            jLabel28.setBounds(80, 740, 937, 16);
            jLabel29.setText("from ScaleType choice list, enter migrated metrics if any in textfield below migrated metrics and finally select darkened metrics and measures and press  ");
            getContentPane().add(jLabel29);
            jLabel29.setBounds(100, 760, 873, 16);
            jLabel30.setText("MeasurementProcessLevel Button. The MeasurementprocessLevel for the selected metrics will be displayed in textfield3");
            getContentPane().add(jLabel30);
            jLabel30.setBounds(100, 780, 687, 16);
            jLabel31.setText("4 ) Repeat steps 1,2,3 for ProcessMeasurementEvaluation and ResourceMeasurementEvaluation menuitems.");
            getContentPane().add(jLabel31);
            jLabel31.setBounds(80, 800, 618, 16);
            jLabel32.setText("Steps to calculate MeasuredSoftwareProcessLevl");
            getContentPane().add(jLabel32);
            jLabel32.setBounds(60, 830, 285, 16);
            jLabel33.setText("1 ) Follow the same steps as MetricsLevel calcualtion but select metrics and measures covered by CAME Tools only.");
            getContentPane().add(jLabel33);
            jLabel33.setBounds(90, 860, 657, 16);
            java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-1100)/2, (screenSize.height-940)/2, 1100, 940);
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            new framehelp().show();
        // Variables declaration - do not modify
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel10;
        private javax.swing.JLabel jLabel11;
        private javax.swing.JLabel jLabel12;
        private javax.swing.JLabel jLabel13;
        private javax.swing.JLabel jLabel14;
        private javax.swing.JLabel jLabel15;
        private javax.swing.JLabel jLabel16;
        private javax.swing.JLabel jLabel17;
        private javax.swing.JLabel jLabel18;
        private javax.swing.JLabel jLabel19;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel20;
        private javax.swing.JLabel jLabel21;
        private javax.swing.JLabel jLabel22;
        private javax.swing.JLabel jLabel23;
        private javax.swing.JLabel jLabel24;
        private javax.swing.JLabel jLabel25;
        private javax.swing.JLabel jLabel26;
        private javax.swing.JLabel jLabel27;
        private javax.swing.JLabel jLabel28;
        private javax.swing.JLabel jLabel29;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel30;
        private javax.swing.JLabel jLabel31;
        private javax.swing.JLabel jLabel32;
        private javax.swing.JLabel jLabel33;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JLabel jLabel5;
        private javax.swing.JLabel jLabel6;
        private javax.swing.JLabel jLabel7;
        private javax.swing.JLabel jLabel8;
        private javax.swing.JLabel jLabel9;
        // End of variables declaration
    }

    1. When you post code, post a minimal example. Did we have to scroll through
    all those bloody labels.
    2. Can't say much for the quality of code NetBeans generates.
    3. To answer your question (sorry, I don't have an autographed copy of the photo):
    import java.awt.*;
    import java.net.*;
    import javax.swing.*;
    public class Example {
        public static void main(String[] args) throws MalformedURLException {
            final JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            Container cp = f.getContentPane();
            cp.setBackground(new Color(0xff, 0xff, 0xee));
            cp.add(new JLabel("set the color on the content pane, not the frame"), BorderLayout.SOUTH);
            URL url = new URL("http://today.java.net/jag/bio/JagHeadshot-small.jpg");
            cp.add(new JLabel(new ImageIcon(url)));
            f.pack();
            SwingUtilities.invokeLater(new Runnable(){
                public void run() {
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    }

  • Problem in Setting Background Color for JButton

    Hi,
    I am using Background color for JButton (color is selected from the customized JColorChooser created by us) where it contains the option of transparency. If we choose light color, then the background is set to JButton, but when we mouse-over the JButton, other components inside the container (JPanel) is getting displayed inside the button.
    Can anyone help to sort out this problem.
    Thanks in advance.

    Hi,
    Here is the code.
    DialogWrapper is JDialog and ColorEditorPane is JPanel.
    DialogWrapper     dlg         = new DialogWrapper();
    ColorEditorPane colorPanel = new ColorEditorPane();
    colorPanel.setValue( _data.getTransparentColor());
    dlg.showWrappedDialog( colorPanel, "color_help", "color_dialog" );
    if( dlg.isOK())
    Color chosenColor = (Color) colorPanel.getValue().getContent();
    _data.setTransparentColor( chosenColor );
    _transparentColorDisplay.setBackground( chosenColor );
    _transparentColorDisplay.setOpaque( true );
    this.repaint();
    this.doLayout();
    this.validate();
    }I've several components like JCheckBox, JRadioButton, JTextField in "this".

  • Set Default Color For BarChart YAxis Data Values.

    Remove alert
    |
    Edit
    |
    Delete
    |
    Change type
    0
    I am new to MS Chart. I am drawing a simple bar chart with following code. My chart draws red lines, for my datapoints    (Y Axis), I want to draw, I want to set the color of remaining data points for example for 1st record (i.e. dt1) my jobData
    have value 10, my graph shows red line for 10 points, for remaining 20 points I need to show the Green Line and also for the remaining data points. Thanks in advance.
             double[] jobData = new double[] { 10, 3, 4, 5, 2, 0, 2, 3, 0, 1 };
                DateTime dt1 = new DateTime(2015, 3, 17, 8, 30, 0);
                DateTime dt2 = new DateTime(2015, 3, 17, 8, 35, 0);
                DateTime dt3 = new DateTime(2015, 3, 17, 8, 40, 0);
                DateTime dt4 = new DateTime(2015, 3, 17, 8, 45, 0);
                DateTime dt5 = new DateTime(2015, 3, 17, 8, 50, 0);
                DateTime dt6 = new DateTime(2015, 3, 17, 8, 55, 0);
                DateTime dt7 = new DateTime(2015, 3, 17, 9, 00, 0);
                DateTime dt8 = new DateTime(2015, 3, 17, 9, 05, 0);
                DateTime dt9 = new DateTime(2015, 3, 17, 9, 10, 0);
                DateTime dt10 = new DateTime(2015, 3, 17, 9, 15, 0);
                DateTime[] xData = new DateTime[] { dt1, dt2, dt3, dt4, dt5,dt6,dt7,dt8,dt9,dt10 };
                InitializeComponent();
                //Horizontal bar chart
                //Create a chart area and add it to the chart
                ChartArea area = new ChartArea("First");
                chart1.ChartAreas.Add(area);
               // chart1.x = Color.Green;
              chart1.Size = new Size(1000, 700);
                //Create a series using the data
                Series barSeries = new Series();
                barSeries.XValueType = ChartValueType.DateTime;
                barSeries.BorderColor = Color.Green;
                barSeries.ChartType = SeriesChartType.Column;
                barSeries.Color = Color.Red;
                area.AxisX.LabelStyle.Format = "HH:mm";
                area.AxisY.Maximum = 30;
                area.AxisY.InterlacedColor = Color.Green;
                area.AxisY.Interval = 1;
              //  chart1.ChartAreas(0).AxisX.LabelStyle.Format = "HH:00"
                barSeries.Points.DataBindXY(xData, jobData );
                //Set the chart type, Bar; horizontal bars
                barSeries.ChartType = SeriesChartType.Bar;
                //Assign it to the required area
                barSeries.ChartArea = "First";
                //Add the series to the chart
                chart1.Series.Add(barSeries);

    Remove alert
    |
    Edit
    |
    Delete
    |
    Change type
    0
    I am new to MS Chart. I am drawing a simple bar chart with following code. My chart draws red lines, for my datapoints    (Y Axis), I want to draw, I want to set the color of remaining data points for example for 1st record (i.e. dt1) my jobData
    have value 10, my graph shows red line for 10 points, for remaining 20 points I need to show the Green Line and also for the remaining data points. Thanks in advance.
             double[] jobData = new double[] { 10, 3, 4, 5, 2, 0, 2, 3, 0, 1 };
                DateTime dt1 = new DateTime(2015, 3, 17, 8, 30, 0);
                DateTime dt2 = new DateTime(2015, 3, 17, 8, 35, 0);
                DateTime dt3 = new DateTime(2015, 3, 17, 8, 40, 0);
                DateTime dt4 = new DateTime(2015, 3, 17, 8, 45, 0);
                DateTime dt5 = new DateTime(2015, 3, 17, 8, 50, 0);
                DateTime dt6 = new DateTime(2015, 3, 17, 8, 55, 0);
                DateTime dt7 = new DateTime(2015, 3, 17, 9, 00, 0);
                DateTime dt8 = new DateTime(2015, 3, 17, 9, 05, 0);
                DateTime dt9 = new DateTime(2015, 3, 17, 9, 10, 0);
                DateTime dt10 = new DateTime(2015, 3, 17, 9, 15, 0);
                DateTime[] xData = new DateTime[] { dt1, dt2, dt3, dt4, dt5,dt6,dt7,dt8,dt9,dt10 };
                InitializeComponent();
                //Horizontal bar chart
                //Create a chart area and add it to the chart
                ChartArea area = new ChartArea("First");
                chart1.ChartAreas.Add(area);
               // chart1.x = Color.Green;
              chart1.Size = new Size(1000, 700);
                //Create a series using the data
                Series barSeries = new Series();
                barSeries.XValueType = ChartValueType.DateTime;
                barSeries.BorderColor = Color.Green;
                barSeries.ChartType = SeriesChartType.Column;
                barSeries.Color = Color.Red;
                area.AxisX.LabelStyle.Format = "HH:mm";
                area.AxisY.Maximum = 30;
                area.AxisY.InterlacedColor = Color.Green;
                area.AxisY.Interval = 1;
              //  chart1.ChartAreas(0).AxisX.LabelStyle.Format = "HH:00"
                barSeries.Points.DataBindXY(xData, jobData );
                //Set the chart type, Bar; horizontal bars
                barSeries.ChartType = SeriesChartType.Bar;
                //Assign it to the required area
                barSeries.ChartArea = "First";
                //Add the series to the chart
                chart1.Series.Add(barSeries);
    Hello,
    Since this issue is mainly related to Chart control, I have helped you move this thread to
    Chart Controls for .NET Framework forum to get help.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Set Default Color For BarChart YAxis.

    I am new to MS Chart. I am drawing a simple bar chart with following code. My chart draws red lines, for my datapoints    (Y Axis), I want to draw, I want to set the color of remaining data points for example for 1st record (i.e. dt1) my jobData
    have value 10, my graph shows red line for 10 points, for remaining 20 points I need to show the Green Line and also for the remaining data points. Thanks in advance.
             double[] jobData = new double[] { 10, 3, 4, 5, 2, 0, 2, 3, 0, 1 };
                DateTime dt1 = new DateTime(2015, 3, 17, 8, 30, 0);
                DateTime dt2 = new DateTime(2015, 3, 17, 8, 35, 0);
                DateTime dt3 = new DateTime(2015, 3, 17, 8, 40, 0);
                DateTime dt4 = new DateTime(2015, 3, 17, 8, 45, 0);
                DateTime dt5 = new DateTime(2015, 3, 17, 8, 50, 0);
                DateTime dt6 = new DateTime(2015, 3, 17, 8, 55, 0);
                DateTime dt7 = new DateTime(2015, 3, 17, 9, 00, 0);
                DateTime dt8 = new DateTime(2015, 3, 17, 9, 05, 0);
                DateTime dt9 = new DateTime(2015, 3, 17, 9, 10, 0);
                DateTime dt10 = new DateTime(2015, 3, 17, 9, 15, 0);
                DateTime[] xData = new DateTime[] { dt1, dt2, dt3, dt4, dt5,dt6,dt7,dt8,dt9,dt10 };
                InitializeComponent();
                //Horizontal bar chart
                //Create a chart area and add it to the chart
                ChartArea area = new ChartArea("First");
                chart1.ChartAreas.Add(area);
               // chart1.x = Color.Green;
              chart1.Size = new Size(1000, 700);
                //Create a series using the data
                Series barSeries = new Series();
                barSeries.XValueType = ChartValueType.DateTime;
                barSeries.BorderColor = Color.Green;
                barSeries.ChartType = SeriesChartType.Column;
                barSeries.Color = Color.Red;
                area.AxisX.LabelStyle.Format = "HH:mm";
                area.AxisY.Maximum = 30;
                area.AxisY.InterlacedColor = Color.Green;
                area.AxisY.Interval = 1;
              //  chart1.ChartAreas(0).AxisX.LabelStyle.Format = "HH:00"
                barSeries.Points.DataBindXY(xData, jobData );
                //Set the chart type, Bar; horizontal bars
                barSeries.ChartType = SeriesChartType.Bar;
                //Assign it to the required area
                barSeries.ChartArea = "First";
                //Add the series to the chart
                chart1.Series.Add(barSeries);

    I am not sure this is exactly what you mean, but, I think the only way to change the data color is to use a different series.
    Imports System.Windows.Forms.DataVisualization.Charting
    Public Class Form6
    Private Sub Form6_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'setup the chart
    With Chart1.ChartAreas(0)
    .AxisX.Title = "X"
    .AxisX.MajorGrid.LineColor = Color.LightBlue
    .AxisX.Minimum = 0
    .AxisX.Maximum = 24
    .AxisX.Interval = 6
    .AxisY.Title = "Y"
    .AxisY.MajorGrid.LineColor = Color.LightGray
    .AxisY.Minimum = 0
    .AxisY.Maximum = 24
    .AxisY.Interval = 6
    .BackColor = Color.FloralWhite 'AntiqueWhite 'LightSkyBlue
    .BackSecondaryColor = Color.White
    .BackGradientStyle = GradientStyle.HorizontalCenter
    .BorderColor = Color.Blue
    .BorderDashStyle = ChartDashStyle.Solid
    .BorderWidth = 1
    .ShadowOffset = 2
    End With
    Dim heading1 As String = " 1 - 12"
    Dim heading2 As String = "13 - 24"
    'draw the chart
    Chart1.Series.Clear()
    Chart1.Series.Add(heading1)
    Chart1.Series.Add(heading2)
    Chart1.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.Line
    Chart1.Series(0).BorderWidth = 1
    Chart1.Series(0).Color = Color.Red
    Chart1.Series(0).BorderDashStyle = ChartDashStyle.Dash
    Chart1.Series(0).MarkerStyle = DataVisualization.Charting.MarkerStyle.Square
    Chart1.Series(0).MarkerSize = 4
    Chart1.Series(1).ChartType = DataVisualization.Charting.SeriesChartType.Line
    Chart1.Series(1).Color = Color.ForestGreen
    Chart1.Series(1).BorderWidth = 2
    For x = 1 To 24
    If x > 12 Then
    Chart1.Series(1).Points.AddXY(x, x)
    Else
    Chart1.Series(0).Points.AddXY(x, x)
    End If
    Next
    End Sub
    End Class

  • How to set different color for items in selectManyCheckbox

    hi,
    I would like to change item text background color for each item on selectManyCheckbox (different for each item).
    It is only 5 items so that could be static reference or select.
    I know only how to change background for all items
    af|selectManyCheckbox::item-text {
        background:orange;
    How to select concrete item text and change color for only them?
    I found similar problem:
    css - Set background color of every individual checkbox of p:selectManyCheckbox - Stack Overflow
    but this dont work for me because I dont have in adf tr structure
    I need somethink like this:
    af|selectManyCheckbox::item-text XXXX - select here one of the item by number on list or id  {
        background:orange;

    hi,
    thanks Alejandro and Federico for answers.
    I use JDev 11.1.1.6. I dont write it in previously post because I think that is a more css then adf problem.
    I have 5 selectItem based on simple List<String> {"text1", "text2", "text3", "text4". "text5"}:
    <af:selectManyCheckbox label="List" id="smc2"
                                               layout="horizontal"
                                               value="#{bean.listInBean}"
                                               autoSubmit="true">
                          <af:selectItem label="text1" value="text1" id="si47"/>
                          <af:selectItem label="text2" value="text2" id="si43"/>
                          <af:selectItem label="text3" value="text3" id="si46"/>
                          <af:selectItem label="text4" value="text4" id="si45"/>
                          <af:selectItem label="text5" value="text5" id="si44"/>
                        </af:selectManyCheckbox>
    and I would like to color first selectItem text to orange, second to red.. etc, The list is a static list. Not would be changed.
    After Alejandro answer I build simple for each element (anyCollection contains item with two fields: textValue and label {(text1,text1), (text2,text2)...}
      <af:forEach items="#{bean.anyCollection}"
                                      var="item">
                            <af:selectItem id="si48" value="#{item.textValue}"  styleClass="yourClassName#{var.index}"
                                           label="#{item.label}"/>
                          </af:forEach>
    And now if I have my var called "item" I can write 5 css style classe yourClassName#{var.index} with different color, but there is a problem:
    Attribute styleClass is not defined for af:selectItem
    If it will be so simple I will just add 5 style classes for each selectItem
    <af:selectItem label="text1" value="text1" id="si47" styleClass="yourClassName0"/>
    <af:selectItem label="text2" value="text2" id="si43" styleClass="yourClassName1"/>
    Should I use other component then adf facer rich?

  • How do I set default colors for XY chart series (lines and legend)

    I am implementing a line chart and need to override the default (caspian style) colors for the line colors and the legend symbols. I'm not displaying the chart symbols themselves as that would make the chart look bad. I've been able to successfully set the default colors for the lines via the CSS below, but cannot find a way to do the same for the series symbols that appear in the chart legend. How do I do this? Thanks.
    .default-color0.chart-series-line {
      -fx-stroke: rgb(0, 102, 255);
    .default-color1.chart-series-line {
      -fx-stroke: rgb(0, 255, 102);
    ...Update:
    Figured it out. Need to do the following:
    .default-color0.chart-line-symbol {
      -fx-background-color: rgb(R, G, B);
    }Edited by: 998038 on May 16, 2013 4:09 PM

    Here is some css to customize the line and legend colors in a line chart.
    /** file: chart.css
        place in same directory as LineChartWithCustomColors.java */
    .default-color0.chart-series-line {
      -fx-stroke: rgb(0, 102, 255);
    .default-color1.chart-series-line {
      -fx-stroke: rgb(0, 255, 102);
    .default-color0.chart-line-symbol {
      -fx-background-color: rgb(0, 102, 255), white;
    .default-color1.chart-line-symbol {
      -fx-background-color: rgb(0, 255, 102), white;
    }And a test harness to try it:
    import javafx.application.Application;
    import javafx.event.*;
    import javafx.scene.Scene;
    import javafx.scene.chart.*;
    import javafx.scene.control.*;
    import javafx.scene.input.*;
    import javafx.stage.Stage;
    public class LineChartWithCustomColors extends Application {
        @Override public void start(final Stage stage) {
            stage.setTitle("Line Chart Sample");
            //defining the axes
            final NumberAxis xAxis = new NumberAxis();
            xAxis.setLabel("Number of Month");
            final NumberAxis yAxis = new NumberAxis();
            //creating the chart
            final LineChart<Number,Number> lineChart =
                    new LineChart<>(xAxis,yAxis);
            lineChart.setTitle("Stock Monitoring, 2010");
            lineChart.setCreateSymbols(false);
            //defining a series
            XYChart.Series series = new XYChart.Series();
            series.setName("My portfolio");
            //populating the series with data
            series.getData().setAll(
              new XYChart.Data(1, 23),
              new XYChart.Data(2, 14),
              new XYChart.Data(3, 15),
              new XYChart.Data(4, 24),
              new XYChart.Data(5, 34),
              new XYChart.Data(6, 36),
              new XYChart.Data(7, 22),
              new XYChart.Data(8, 45),
              new XYChart.Data(9, 43),
              new XYChart.Data(10, 17),
              new XYChart.Data(11, 29),
              new XYChart.Data(12, 25)
            lineChart.getData().add(series);
            //adding a context menu item to the chart
            final MenuItem resizeItem = new MenuItem("Resize");
            resizeItem.setOnAction(new EventHandler<ActionEvent>() {
              @Override public void handle(ActionEvent event) {
                System.out.println("Resize requested");
            final ContextMenu menu = new ContextMenu(
              resizeItem
            lineChart.setOnMouseClicked(new EventHandler<MouseEvent>() {
              @Override public void handle(MouseEvent event) {
                if (MouseButton.SECONDARY.equals(event.getButton())) {
                  menu.show(stage, event.getScreenX(), event.getScreenY());
            Scene scene =
              new Scene(
                lineChart,800,600
            stage.setScene(
              scene
            stage.show();
            scene.getStylesheets().add(
              getClass().getResource("chart.css").toExternalForm()
        public static void main(String[] args) {
            launch(args);
    }

  • Can I set default colors for generated shapes in Premiere Pro CC?

    I'm working on some highlight video where I need to generate an ellipse on each clip to highlight a player. I'd like to use a yellow/yellow, 20% softness, 8 thickness ellipse each time, but by default PP gives me an ugly green/blue combination, and I have to change the inside/outside colors, softness and thickness each time I add a clip and generate an ellipse.
    Is there a way to set a default inner/outer color, thickness, and softness setting for each new generated shape so that I don't have to keep repeating these steps?

    If you are using the Title Designer to generate your ellipse, and if I understand what you want, the answer is yes.
    Unless I am completely off-base, your default font style below the title has the colors of that ugly green/blue combo.
    You can easily just set the ellipse the exact way you want it, and then go into the Font Styles menu and create a new font style. Give it a unique name like "Ellipse" and then drag that new style from the end up to the beginning of the list. (Upper left hand corner).
    I created an ellipse using a greenish yellow, rather unattractive color for both the shape and the stroke. I used a higher opacity because it shows up better in the screen shot, but I could have set it for 20% easily enough. I then went to the styles menu, created a new style, gave it a name, then went to the last style and dragged it up to the top left where you see it now. You have to look close.
    It is not particularly obvious that the shapes are based on the font style just as much as the text is.

Maybe you are looking for

  • 2 Macs, 1 blog site.  How can I use 2 Macs to edit my iWeb site???

    I have a Mac at home and my laptop at work. Both have iLife '06 on the and iWeb. I just designed a web site (and uploaded it) using iWeb, and I'd like to add to it from my laptop at work. I brought a pushlised copy with me, but there's no way to load

  • VAL_FIELD selection to determine RSDRI or MDX query: performance tuning

    according to on of the HTG I am working on performance tuning. one of the tip is to try to query base members by using BAS(xxx) in the expension pane of BPC report. I did so and found an interesting issue in one of the COPA report. with income statem

  • Eithernet networking

    Hi all I have a powermac g4running os x leopard and an ibook g3 running mac os 9. How do i use the eithernet connection to transfer files from one computer to another?

  • A Single query with out the sub-queries

    I am using My-SQL as my back-end and it doesnot support the Sub-Queries. i have my table given below UserID..UserName..ParentUserID 1........Admin...........0 2........Sales...........1 3........Sourcing........1 4........SalesHead.......2 5........S

  • Videos not playing anymore...

    Hi, here's my problem. DRM'ed Videos (or basically any video bought on iTunes Store) doesn't play anymore for some reason. Though, videos downloaded from YouTube or my personnal videos still play. I'm guessing codec or DRM problem on my machine becau