Button background color

i know this is stupid but how would u make a button with the same background color as a JPanel default color
Edited by: dxb222 on Jan 27, 2008 9:04 PM

if the button is directly on the panel
button.setContentAreaFilled(false);

Similar Messages

  • How to make button background color chnage

    Hi
    In my custom application having 12 buttons, out of  12 buttons one button should look totally differance than other buttons like button background color to red color.
    we found two solution even though  those are not adopted to my solution
    1. CSS technic for application, its changing whole application insted of one button inside a iview.
    2. client is not happy with  button design  like STANDARD/EMPHASIZED/PREVIOUS/NEXT
    Regards
    Malli

    Hello
    You can also use the imageAlt, imageFirst,imageSource properties of the image to enhance the button.
    and to change the background you can change the portal theme.
    Thanks

  • Wrong command button background color on web

    Hello.
    We have a problem with background color of command button.
    If we set background color to lime, only upper line of button is in lime color. Rest of the button is in default color.
    This happens when user runs application on web (standalone server and embedded).
    In jdeveloper button is in correct color (whole button in lime color).
    What could be the problem?
    Thanks.

    On debugging, i found that the commandButton is using background-image to show the silver/grey background.
    So, in order to modify it to other background color, you have set the background-image as none as follows:
    <af:commandButton text="commandButton 1" id="cb1"
    inlineStyle="background-color:red; background-image:none"/>
    Thanks,
    Navaneeth

  • Why does JButton background color change when  clicking ?

    Hello,
    I have defined :
    JButton mybutton = new JButton(Icon xxx) ;
    with no associated text and I set both foreground and background colors to black, and an empty border.
    This is because the background color of the container which contents this button is also black and I want to see only the button icon.
    When I click on the icon , the button background color becomes grey. How can I change this to make it remains black ?
    Thanks a lot.
    Gege

    Well, the color changes because that is how the look and feel is defined,
    presumably to give better feedback to the user that she has clicked the
    button.
    If you don't want this, you could try using a different L&F which doesn't do this.
    Alternatively, If you've only got the one button, you could just do
        UIManager.put( "Button.select", Color.BLACK );If you have multiple buttons, and you want the other buttons to behave
    normally, you can extend the one button and have it change the color
    while it is pressed, e.g.,
    import java.awt.*;
    import java.io.IOException;
    import java.net.URL;
    import javax.swing.*;
    public class ButtonSelect extends JFrame {
         public ButtonSelect() throws IOException {
              super();
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel panel = new JPanel();
              panel.add( new JButton( "Normal" ) );
              Image img = Toolkit.getDefaultToolkit().getImage( new URL("http://www.google.com/intl/en/images/logo.gif" ) );
              ImageIcon ii = new ImageIcon( img );
              JButton b = new JButton( ii ) {
                   static final private String KEY = "Button.select";
                   public void paint( Graphics g ) {
                        Color save = null;
                        if ( getModel().isArmed() && getModel().isPressed() ) {
                             save = UIManager.getColor( KEY );
                             UIManager.put( KEY, Color.WHITE );
                        super.paint( g );
                        if ( save != null )
                             UIManager.put( KEY, save );
              b.setForeground( Color.WHITE );
              b.setBackground( Color.WHITE );
              b.setFocusPainted( false );
              panel.add( b );
              getContentPane().add( panel );
              pack();
              setVisible( true );
         public static void main( String[] a ) throws IOException {
              new ButtonSelect();
    }

  • Want to change button background using UIManager for WindowsLookAndFeel

    Hi first i used ocean look and feel in my application. i used UIManager to change to color of the button. so all the buttons colors are change. fine
    But if i change the look and feel to windows look and feel it shows the windows look only. i sant to change the color to white. how?

    de to set the look and feel:
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");code to change button property
    UIManager.get("Panel.background");
    UIManager.put("Button.background", Color.WHITE);
    UIManager.put("Button.border", javax.swing.BorderFactory.createLineBorder(Color.black));
    UIManager.put("Button.opaque", true);change button properties are not affecting the jbutton. if i create.
    But if i remove the setLookAndFeel line properties are applying. why? remedy? is changing the ButtonUI is only option?

  • Button background fill "Linear - to top" not showing after save.

    I've made the proper edits to make these buttons look very "cool" having the background filled to a gradient look which is called "Linear to top", but once I save this form and open the PDF the button color is solid rather then gradient or "linear to top"
    Any explination?

    If you have done the changes to your your button background color at the design time, it should retain the changes anywhere you open it.
    If you have done the changes to your button background color through Script, then you may need set the Save changes automatically.
    If your issue is not resolved, by changing the settings, you can post the form to [email protected], so I can have a look..
    Thanks
    Srini

  • Setting a default background color

    Hi All,
    I would like to set a default background color for all the
    components that I'm going to draw. What is the best
    way to achieve this?
    Thanks.
    Syed

    You can set using UIManager of the Look and Feel.
    UIManger.put("Button.background", Color.blue);
    will set the color of all the JButtons to blue. Like that you can change for all the components you need.
    Mohan

  • Help w/ photoshop7  background color

    When you click file\new
    ..then select the radio button  background color,,,,
    is there a way instead of solid clors to get patterns or a fade from one color to another?

    No, you have to do that after the file is created.

  • How to apply background color to link button in Flex 2

    I need to apply background color to link button as the Rollover color has  on its over event.How is this possible in Flex 2 ?I am using the above  in Xcelsius as custom component so if I apply graphics and draw rect  method it does not have any effect.Please help.

    These might help:
    http://jdevadf.oracle.com/adf-richclient-demo/components/skinningKeys/column.jspx
    http://jdevadf.oracle.com/adf-richclient-demo/components/skinningKeys/table.jspx

  • Set background color for conditional text fields by click of button.

    Hi,
    I am new to apex, the scenario is when i click on a button i.e. Save, it shoulld compare 2 fields P1 and P2 which are text fields.
    If the value of P1 is greaterthan P2 then the whole P1 text field background color should change to "Red" otherwise in any other condition the P1 field should be "Green" color.
    In which section the color function should be called on the Save button?
    On the page in the HTML Header section i have added the below code but the background color is not getting set.
    <script type="text/javascript">
    function fncChangeColor()
    var num1 = $v('P1');
    var num2 = $v('P2');
    if ( num1 > num2 ) {
    document.getElementById("P1").style.background = "RED";
    else {
    document.getElementById("P1").style.background = "GREEN";
    </script>
    Can any one help me in moving ahead with this scenario with a detailed information.
    Thanks,
    Priyanka.

    Hi,
    Call function on button URL target
    javascript:fncChangeColor()If button should submit page, then I think you do not need color field to green.
    Just change to run submit function.
    <script type="text/javascript">
    function fncChangeColor(){
    var num1 = $v('P1');
    var num2 = $v('P2');
    if ( num1 > num2 ) {
      $x("P1").style.background = "RED";
      return false;
    apex.submit({request:"YOUR_REQUEST"});
    </script>Regards,
    Jari

  • Spry vertical menu button shows background color instead of image in preview

    Hello All, I'm a newbie (to the forum and Dreamweaver) so my apologies if my question is not in good form.  I've searched for this issue but cannot seem to find the exact problem I have. 
    I've created a website (my first) and used the spry menu bar.  It works well using the default blue and grey colors for button and hover.  However, I decided I want to spruce it up a little and change the buttons to use a background image (rainbow pattern) instead of background color.  I internet researched this for some time and watched all the youtube videos people have posted for this process and editing the spry vertical menu bar CSS.  Using the .a and hover lines from the CSS, I was able to add my background .jpg image file.  In the design view, the button look exactly how I want them to.  However, when I attempt to preview in IE, Chrome, or FF, the buttons still have the default colors and no image.  I've gone back and deleted the default blue and grey, but then the preview just shows dark grey and white for the buttoms.  is there something that I am overlooking that would cause the background color to show instead of the image I have attached to the buttons.  I can't figure out why it looks right in DW but not in preview.
    BTW, I'm editing a template file and all the pages are updated with the new image buttons, but none of the pages show correctly in preview. 
    Thanks

    Point taken :-)
    This is my spry vertical css code.  No sub-menus. 
    DESIGN INFORMATION: describes color scheme, borders, fonts
    /* Outermost menu container has borders on all sides */
    ul.MenuBarVertical
    border: 1px solid #CCC;
    /* Submenu containers have borders on all sides */
    ul.MenuBarVertical ul
    border: 1px solid #CCC;
    /* Menu items are a light gray block with padding and no text decoration */
    ul.MenuBarVertical a
    display: block;
    cursor: pointer;
    padding: 0.5em 0.75em;
    color: #333;
    text-decoration: none;
    font-weight: bold;
    background-image: url(/Images/Rainbow_Button.jpg);
    background-color: ;
    background-repeat: no-repeat;
    background-position: center;
    /* Menu items that have mouse over or focus have a blue background and white text */
    ul.MenuBarVertical a:hover, ul.MenuBarVertical a:focus
    background-color: #666666;
    color: #333333;
    background-image: url(/Images/Rainbow_Button_Hover.jpg);
    /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
    ul.MenuBarVertical a.MenuBarItemHover, ul.MenuBarVertical a.MenuBarItemSubmenuHover, ul.MenuBarVertical a.MenuBarSubmenuVisible
    background-color: #0000FF;
    color: #FFF;

  • How to download background color of ALV with button "Export to Excel"

    Dear Experts:
    I can download the data of ALV in webdynpro for ABAP, but the color is missing.
    Does anybody know how to download background color of the ALV cells also by "Export to Excel" button?
    Could anybody help on this?
    Thanks in advance!
    Best Regards
    Lingxing Meng

    never experienced that...
    [chk this link|Download colored ALV output in to EXCEL sheet;
    a couple of intersting posts, they talk abt general ALV...
    try one of the last post ...when downloading
    use local file->HTML only.. but while choosing the file location to save give extension as XLS.

  • LinkBar: how to set a selected button's background color?

    I was able to set the text color of a selected LinkBar button by "disabledColor" style of LinkBar. Accordingly, I expect to set the background color of the selected button by "backgroundDisabledColor" style, however, it didn't work; and except "backgroundDisabledColor", I didn't see any other style that could possibly achieve this. Please help. Thanks.

    Solved this myself by writing a programmatic skin and set it to LinkButton's disabledSkin.

  • Change the background color in a button

    I want to change the background color in a button that have a text(It not have an icon).
    DO you know how to do it?

    Hi suasna
    i have a solution for your ask actually i did when i wanted to change the bgcolor of a button ....but i this case u need to use Icon editor to create the icon with the color u want and add to it the text u want to apply ...then set the inconic ptoperty of the button to YES and set the Icon name that u have created with the software ..
    hope this helps u
    thanks

  • JComboBox: Background color of button different to the popup

    Hello,
    I want to have a combo box in wich the background color of the arrow button would be different to the color of popup menu.
    I did this, but it didn't take the effect.
    setUI(new MetalComboBoxUI(){
                protected javax.swing.JButton createArrowButton() {
                    javax.swing.JButton button = new MetalComboBoxButton( comboBox,
                            icon,
                            comboBox.isEditable(),
                            currentValuePane,
                            popupList );
                    button.setMargin( new java.awt.Insets( 0, 10, 10, 30 ) );
                    button.setBorder(null);
                    button.setBackground(Color.green);
                    return button;
            });thanks in advance.

    Try this:import java.awt.Color;
    import java.awt.FlowLayout;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import javax.swing.UIDefaults;
    import javax.swing.UIManager;
    import javax.swing.plaf.ColorUIResource;
    import javax.swing.plaf.basic.BasicComboBoxUI;
    public class ComboWithGreenButton {
       String [] data = {"option0", "option1", "option2", "option3"};
       JComboBox combo;
       void makeUI() {
          combo = new JComboBox(data);
          combo.setUI(new BasicComboBoxUI());
          JFrame frame = new JFrame("Combo with green button");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(100, 60);
          frame.setLayout(new FlowLayout());
          frame.add(combo);
          frame.setLocationRelativeTo(null);
          frame.setVisible(true);
       public static void main(String[] args) {
          SwingUtilities.invokeLater(new Runnable() {
             public void run() {
                UIDefaults defaults = UIManager.getDefaults();
                defaults.put("ComboBox.buttonBackground",
                      new ColorUIResource(Color.GREEN));
                new ComboWithGreenButton().makeUI();
    }luck, db

Maybe you are looking for

  • Security and/or filtering error in data form creation

    Hi, I am getting this error when I am trying to preview my data form. This is the first time I am creating an application and data form in Hyperion. The data form is multicurrency and plan type is Plan1. Row: Account members: Descendants(Account) Col

  • Questions on composition and assosiation relationship

    Which two are true about the composition relationship "A Blip consists of many Blipverts."? (Choose two.) A. A Blip must have at least two Blipverts. B. A Blipvert can be a part of only one Blip. C. A Blipvert must be part of at least one Blip. D. Wh

  • How can I force an ISP to refresh a file in proxy server cache?

    Hi all, In my applet I am getting a remote file. But with some ISP's I have the problem that when I try to get that file again I get the older version which they had in their proxy servers cache. Is it possible for me to enforce refresh on this ISP's

  • Function Module to create Tasks in a Quality Notification

    Hi, I am trying to create Tasks in an existing Quality Notification through a program. I have used 'BAPI_QUALNOT_MODIFY_DATA', 'BAPI_QUALNOT_SAVE' and 'BAPI_TRANSACTION_COMMIT', but it create any tasks in the given quality notification. I am passing

  • Users looged in whole day

    Hello, I am trying to know how many users logged in server and logged off from the server in a day. And how much time they were in the server. Is there any table or report from where i can fetch this report. Best Regards, Prashant Dubey