JOption Pane Background Color

I am trying to change the background color of this JOptionPane. The UIManager changes the outside of the pane but not the area where the text is. How do I change that area too?
JOptionPane optionPane = new JOptionPane();
UIManager.put("OptionPane.background",new ColorUIResource(Color.blue));
UIManager.put("OptionPane.messageForeground",new ColorUIResource(Color.white));
optionPane.setOpaque(false);
optionPane.showMessageDialog(frame,
"Please enter a valid user name and password.

UIManager.put("Panel.backgroun", Color.blue); would do it, but it will also affect all other panels.

Similar Messages

  • Change background color of the message pane

    Morning.
    Is it possible to change the background color of the message pane in the Mail.app main window? I'ld like to have an light yellow background because the white background is too lurid.
    TIA and kind regards, Friedrich

    that's not not possible.

  • Problem while setting background color for jsplit pane

    Hi ALL,
    i am using jsplit frame inside jframe.
    i placed jtree inside left jsplit frame.
    I am not able to set background clolr to jsplit frame.
    when i hide(jtree.setvisible(false)) jtree is shows default background color.it is not showing backgroun color which i set.

    In the below code,i am adding jtree inside jscrollpane and i am adding jscrollpane inside jsplitpane.
    whenever i am setting jtree.setvisible(false),it must show background color which is i am setting for jscrollpane .but its showing default background color.
    Please help me.
    * Demo.java
    * Created on August 19, 2008, 1:44 PM
    public class Demo extends javax.swing.JFrame {
    /** Creates new form Demo */
    public Demo() {
    initComponents();
    jTree1.setVisible(false);
    jScrollPane1.setBackground(new java.awt.Color(136, 194, 252));
    jSplitPane1.setBackground(new java.awt.Color(136, 194, 252));    }
        /** 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.
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            jPanel1 = new javax.swing.JPanel();
            jSplitPane1 = new javax.swing.JSplitPane();
            jScrollPane1 = new javax.swing.JScrollPane();
            jTree1 = new javax.swing.JTree();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jScrollPane1.setViewportView(jTree1);
            jSplitPane1.setLeftComponent(jScrollPane1);
            org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.TRAILING, jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 362, Short.MAX_VALUE)
            org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            layout.setVerticalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            pack();
        }// </editor-fold>
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Demo().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JPanel jPanel1;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JSplitPane jSplitPane1;
        private javax.swing.JTree jTree1;
        // End of variables declaration

  • 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);
    }

  • Dynamically Set Subreport Background Color to the Same Value as Main Report Background Color

    I have a report that contains a subreport.  The main report has groupings in it.  I am dynamically setting the background color of the group rows based on an expression.  That part is working fine.  The problem that I am having is that
    I don't know how to get the subreport to "inherit" the background color of the grouping that holds it.
    Basically, I have different row shadings on my report differentiating the groupings except for the rows where the subreport shows.
    How do I go about setting the subreport background color to equal it's contaiing grouping's background color?  Thanks in advance for any and all assistance provided.

    The parameter method given by gpshukla will send the info to the subreport, but you don't need the color parameter in the main report, only the subreport. The trick is in setting the value of that parameter.
    Right-click the cell with the embedded subreport, you can select subreport properties.
    Select Parameters and add a parameter.
    The name column is the name of the parameter in the subreport (color) and value is the value to set it to.
    Set name to "color" (no quotes).
    Set Value to the same expression used to set the background color for the row.
    In the subreport, click the design surface to select the report (not header or footer).
    In the properties pane, select background color and choose expression from the dropdown.
    Type =Parameters!color.Value into the expression builder.
    This will work assuming that background color in the main report row will not change without also refreshing the subreport.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • How do I change the Background Color of a Shape in iWeb?

    I am adding a comment bubble from the Shape menu for one of my photos. Everytime I try to change the background color of the bubble I end up changing the entire background color of the Web Page.
    How do I only change the background color of the shape?
    G5   Mac OS X (10.4.4)  

    Hi Kyn,
    Perhaps you (or anyone else!) can help me with this too: is it possible to change the color of the border styles that you choose for the thumbnails on a photo page? There is no "fill" option in the Graphic pane of the inspector when I select one of them. I love some of the styles but would like to be able to match the color better to my pages. See here for an example:
    http://web.mac.com/mousie/iWeb/Site/Recount.html
    The twirly border is a little too orange for my taste.
    Thanks in advance.

  • Can the current line be highlighted using a background color or have the cursor flash?

    I use the split screen and left click in the Design pane to jump to where I want to be in the Code pane in Dreamweaver CS6. The problem is that it can be very hard to tell where the cursor is in the Code pane since the cursor doesn't flash.
    Is there a way to force Dreamweaver CS6 to change the background color of the currently selected line or at least have the cursor flash in both panes? There must be some way to make it easier to find the current line of code.
    Thanks.

    John Waller wrote:
    The cursor does not flash in Code View only when Code View is not in focus i.e. you're working in the Design View window in Split View.
    In those caases, I just highlight a word or two in Design View and the corresponding words are highlighted by DW in Code View (even when Code view is not in focus).
    Thanks. I've been doing that, but sometimes there is no text to highlight. I hoped Dreamweaver might have a hidden setting that I could enable. That's a lot of extra sliding of the hand/wrist for no good reason when it would be easy for the Dreamweaver programmers to change the background color of the current line or make the cursor flash or do something else to indicate where you are in the code besides making the user constantly make a smearing action with the mouse. All of those extra movements add up the wear and tear when you're trying to avoid getting a repetitive stress injury, especially if you already use mouse gestures in a browser.

  • How to use a GradientPaint as background color in a JPopupMenu

    I want to use a GradientPaint as background color in a JPopupMenu.
    I try to use something like
    GradientPaint p;
    p = new GradientPaint(0, 12, Color.white, 0, 24, Color.pink);
    UIManager.put("MenuItem.selectionBackground", p);but it doesn't work.
    I also tried to extends BasicMenuItemUI in MenuItems
    public class CMenuItem extends JMenuItem {
         public CMenuItem(String text) {
              super(text);
              setUI(BUI.createUI(this));
         static final class BUI extends BasicMenuItemUI {
             private final static BUI ui = new BUI();
             public static BUI createUI(JComponent c) {
                 return ui;
             @Override
             public void update(Graphics g, JComponent c) {
                   if (c.isOpaque()) {
                        Graphics2D g2 = (Graphics2D)g.create();
                        int w = c.getWidth();
                        int h = c.getHeight();
                        GradientPaint p;
                        p = new GradientPaint(0, 12, Color.white, 0, 24, Color.pink);
                        g2.setPaint(p);
                        g2.fillRect(0, 0, w, h);
                        g2.dispose();
                   paint(g, c);
    }I used this technique for JLabel and it works fine.
    Please help

    ok, here the SSCCE. I hope its helpful for an answer.
    import java.awt.Color;
    import java.awt.GradientPaint;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.UIManager;
    import javax.swing.plaf.basic.BasicMenuItemUI;
    public class Menu {
        public JMenuBar createMenuBar() {
             JMenuBar menuBar;
            JMenu menu;
            JMenuItem menuItem;
            //Create the menu bar.
            menuBar = new JMenuBar();
            //Build the first menu.
            menu = new JMenu("A Menu");
            menuBar.add(menu);
             GradientPaint p;
             p = new GradientPaint(0, 12, Color.white, 0, 24, Color.pink);
             UIManager.put("MenuItem.selectionBackground", p);
            menuItem = new JMenuItem("1st item: when selected its background is black: wrong");
            menu.add(menuItem);
             UIManager.put("MenuItem.selectionBackground", Color.pink);
            menuItem = new JMenuItem("2nd item: when selected its background is pink: ok");
            menu.add(menuItem);
            menuItem = new CMenuItem("3rd item: when selected its background is pink: WRONG!");
            menu.add(menuItem);
            return menuBar;
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            Menu demo = new Menu();
            frame.setJMenuBar(demo.createMenuBar());
            //Display the window.
            frame.setSize(450, 260);
            frame.setVisible(true);
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    class CMenuItem extends JMenuItem {
         private static final long serialVersionUID = 1L;
         public CMenuItem(String text) {
              super(text);
              setUI(BUI.createUI(this));
         static final class BUI extends BasicMenuItemUI {
             private final static BUI ui = new BUI();
             public static BUI createUI(JComponent c) {
                 return ui;
             @Override
             public void update(Graphics g, JComponent c) {
                   if (true || c.isOpaque()) {
    //                    System.out.println("update()");
                        Graphics2D g2 = (Graphics2D)g.create();
                        int w = c.getWidth();
                        int h = c.getHeight();
                        GradientPaint p;
                        p = new GradientPaint(0, 0, Color.white, 0, 10, Color.pink);
                        g2.setPaint(p);
                        g2.fillRect(0, 0, w, h);
                        g2.dispose();
                   paint(g, c);
    }Thanks for the help

  • Keyboard shutcut for choosing background color when brush tool is active?

    Hello,
    I've forgotten the keyboard shortcut for choosing a background color when the brush tool is the active tool . Holding down the alt key with the brush selected chooses the foreground color. What key do you hold down to select the background color?  I'm on a mac. Thanks.

    caligula1 wrote:
    One keyboard shortcut for choosing a background color that you might not be aware of is opt + I  (on a mac)
    That's interesting, but is it a lower case L or upper case i?  I certainly can't make it work on a PC.
    A couple of thought for you...  There are no easy to use shortcuts unused in Photoshop nowadays, so I sometimes steal them from little or never used operations.  For instance, how many people use H for panning instead of the Space bar.  I know H has the benefit of locking in panning, but I don't think I have 'ever' had a need for it.  I have, in the past, stolen Y from Blur and Smudge, but I have not done so in recent versions.
    But for quickly and constantly picking background colours, you need a convenient key, and that suggests the Z key to me, as I always zoom with the mouse and Ctrl (or Alt) Space bar.  Just a thought.
    Another option is the Wacom Express keys if you are using a tablet that has them.  The Keystroke option won't accept some combinations, but I think it would be doable
    Shift F4 is for an Action I used to use a few versions back, to place guides at 50% vertical and horizontal.  They are easy to snap drag nowadays.
    One last idea on a similar vein, are programmable keys on custom keyboards.  I don't know if they are available for the Mac, but I use a Logitech G110 which has 12 programmable keys on the left of the usual layout.  These 12 keys can be programed three different ways, and selected by the M keys above.  I originally bought this keyboard for its illuminated keys, but I quickly got used to the extra functionality.  Even the little volume control, in the top right corner, (highlighted in magenta below) is such a convenience. I use these keys for launching Actions,, although I found I had to make both G8 and G12 mirror the Ctrl key as I occasionally hit them by mistake.

  • Change Background Color Of Work Area

    I am a user of Acrobat 8 Professional and just loaded Acrobat
    9 Professional. Does anyone know if you can change the background
    color of the work area (documentation pane and navigation pane ).
    When I view a PDF the document is ok but the background color of
    the navigation pane and documentation is black.
    Is this the new look for Acrobat 9?
    Is there a way that I can change the color?
    I have searched Acrobat>Help and
    Acrobat>Support>Knowledgebase and find nothing.
    I would appreciate any help I can get.
    Ted

    Thank you for your post. These forums are specific to the
    Acrobat.com website and its set of hosted services, and do not
    cover the Acrobat family of desktop products. Please visit the
    following forums for any questions related to the Acrobat family of
    desktop products:
    http://www.adobeforums.com/cgi-bin/webx/.3bbeda8b/
    Note: The color scheme of Acrobat 9 cannot be changed.

  • Setting JScrollPane background color.

    Does anybody know how to set what color appears in the background of a JScrollPane when the Component in the pane is smaller than the pane itself?
    In particular, I have a JTable in a JScrollPane, and when the pane is bigger than the table, the gray default background of the viewport looks weird behind the white background of the table.
    MyScrollPane.setBackground() doesn't do it, neither does MyScrollPane.getViewport().setBackground().
    Thanks in advance,
    Jason

    This might explain some things, hope it helps...
    it's a cut and paste from the JScrollpane source....
    A common operation to want to do is to set the background color that will be used if the main viewport view is smaller than the viewport, or is not opaque. This can be accomplished by setting the background color
    of the viewport, via scrollPane.getViewport().setBackground().The reason for setting the color of the viewport and not the scrollpane is that by default JViewport is opaque which, among other things, means it will completely fill in its background using its background color. Therefore when <code>JScrollPane</code> draws its background the viewport will usually draw over it.

  • How to change selected pane's color in a JTabbedPane ?

    Hi there !
    I'm tryin' to change selected pane's color (default : light gray) in a JTabbedPane.
    I tried to use the following code :
    UIManager.put("TabbedPane.selected", new Color(255,255,200));
    but it doesn't seem to work.
    Any idea ?
    Thanks.

    For me, there is no TabbedPane.selected filed in TabnedPaneUI....
    try with
    UIManager.put("TabbedPane.highlight", new Color(255,255,200));
    or
    UIManager.put("TabbedPane.background", new Color(255,255,200));

  • Change Outlook Calendar background color but its reverts back to old on restart

    Dear Support,
    I am trying to change Outlook Calendar background color but its reverts back to old on restart 

    Hi,
    Let's take Outlook 2013 for example, go to FILE tab ->
    Options -> Calendar -> Display options
    -> Select the Default calendar color and the checkbox for
    Use this color on all calendar ->
    OK.
    In case the Navigation Pane is corrupted, we may try starting Outlook with the switch "/resetnavpane":
    Press Win + R and type “outlook.exe /resetnavpane” in the blank box, then press Enter.
    I hope this helps.
    Regards,
    Melon Chen
    TechNet Community Support

  • JTabbedPane background color doesn't work in Win XP - SP 1 with JRE 1.4.2

    Setting background color for JTabbedPane doesn't
    work in "Windows XP with SP 1" when using JRE 1.4.2.
    For example, following call doesn't set the
    tab to green:
    tabbedPane.setBackgroundAt(0, Color.green);
    It always displays TABS with the white background.
    Is anybody aware of this problem?
    Thanks-in-advance for any help / suggestions!
    Sundar

    Thanks, bbritta and vairavan.
    I tried setOpaque also, but still doesn't work,
    On my system also:
    UIManager.getSystemLookAndFeelClassName() = com.sun.java.swing.plaf.windows.WindowsLookAndFeel
    I have given below the sample code that doesn't display tab color. Please let me know if you suspect something is wrong here, or any suggestions to make this work under Windows XP - Service Pack 1.
    Thanks,
    Sundar
    // CODE STARTS HERE
    import javax.swing.JTabbedPane;
    import javax.swing.ImageIcon;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.UIManager;
    import java.awt.*;
    import java.awt.event.*;
    public class TEMP_TABBED_PANE extends JPanel {
    public TEMP_TABBED_PANE() {
    JTabbedPane tabbedPane = new JTabbedPane();
         tabbedPane.setOpaque(true);
    Component panel1 = makeTextPanel("Howdy");
    tabbedPane.addTab("One", panel1);
    tabbedPane.setSelectedIndex(0);
    tabbedPane.setBackgroundAt(0, Color.green);
    Component panel2 = makeTextPanel("Howdy Howdy");
    tabbedPane.addTab("Two", panel2);
    tabbedPane.setBackgroundAt(1, Color.yellow);
    Component panel3 = makeTextPanel("Howdy Howdy Howdy");
    tabbedPane.addTab("Three", panel3);
    tabbedPane.setBackgroundAt(2, Color.red);
    Component panel4 = makeTextPanel("Howdy Howdy Howdy Howdy");
    tabbedPane.addTab("Four", panel4);
    tabbedPane.setBackgroundAt(3, Color.cyan);
    //Add the tabbed pane to this panel.
    setLayout(new GridLayout(1, 1));
    add(tabbedPane);
    protected Component makeTextPanel(String text) {
    JPanel panel = new JPanel(false);
    JLabel filler = new JLabel(text);
    filler.setHorizontalAlignment(JLabel.CENTER);
    panel.setLayout(new GridLayout(1, 1));
    panel.add(filler);
    //panel.setOpaque(true); <<-- UNCOMMENTING THIS ALSO DOESN'T HELP :(
    return panel;
    public static void main(String[] args) {
    JFrame frame = new JFrame("Tabbed Pane Demo for Color");
    try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    // UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
    JOptionPane.showMessageDialog(frame,
              "UIManager.getSystemLookAndFeelClassName() = " +
              UIManager.getSystemLookAndFeelClassName(),
              "Look And Feel",
              JOptionPane.INFORMATION_MESSAGE);
    catch(Exception e) {
    e.printStackTrace();
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {System.exit(0);}
    frame.getContentPane().add(new TEMP_TABBED_PANE(),
    BorderLayout.CENTER);
    frame.setSize(400, 125);
    frame.setVisible(true);
    // CODE ENDS HERE

  • Menu: Background color covers all! Urgent

    Made a DVD with a nice menu.
    Next day, when I wanted to change some detail, it had "disappeared", i.e. it was covered by backgropund color matte (Color could be changed in Preferences, but matte could not be removed).
    Templates dragged-dropped into Menu are also immediately covered by background color.
    Can’t work on the menu, - but can see it in Connections pane.
    Any suggestions, please? I have to deliver a DVD this weekend.
    aabenhus

    cool! many thanks, got it. ;-)

Maybe you are looking for

  • Mapping XML into 3rd party system using XIF adapter

    Hi Gurus, First of all let me thank all of you for a tremondous contribution you are making for these kind of topics(CRM XIF) in SDN. I could solve half my problems by looking into your replies. But I have a new & similar problem now. I am able to cr

  • How to Store and Retrieve values in cookie

    Hi am having two List boxes in a jsp page.. By default i will give set of values to one List box and then i will move some value from one list box to another list box.. Now my requirement is i have to store these two list box values into cookie.. If

  • Cannot print to local file path since Adobe Reader XI (11.0.6) update

    I am attempting to print any PDF file to a windows printer that uses a port pointing to a local path (e.g. c:\test\testprint). This functioned successfully in the previous versions of Adobe Reader and since the update to 11.0.6 Adobe Reader will not

  • Circle zooming parts of image - hints to get me started

    Hi! I didn't know how to explain the "zoom" in the message title so I'm linking to the page containing the effect I want to mimic: "Zoom"-effect Can someone give me some hints on how I could remake the "zoom"-effect in a Flex-application? I'm not ask

  • Problem with fireworks popup menu in dreamweaver, has a huge box.

    hi, i made a popup menu in fireworks, and when i open that html page in dreamweaver, there is a huge white box around the popup menu area, so that i cant type anything under the menu or anywhere near it. i was wondering how i get rid of this white bo