JTabbedPane Background Color incorrect when using SCROLL_TAB_LAYOUT

I am tring to set the background (JDK 1.41_02) on a JTabbedPane that uses SCROLL_TAB_LAYOUT. It is reported as a bug with this example:-
import javax.swing.*;
import java.awt.*;
import java.util.*;
public class TestFrame extends JFrame {
JSplitPane jSplitPane1 = new JSplitPane();
JTabbedPane jTabbedPane2 = null;
JPanel jPanel1 = new JPanel();
JPanel jPanel2 = new JPanel();
JPanel jPanel4 = new JPanel();
JPanel jPanel3 = new JPanel();
JTabbedPane jTabbedPane1 = null;//new JTabbedPane();
public TestFrame() {
try {
jbInit();
catch(Exception e) {
e.printStackTrace();
public static void main(String[] args) {
TestFrame untitled11 = new TestFrame();
untitled11.setSize(250,250);
untitled11.show();
private void jbInit() throws Exception {
jTabbedPane1 = new JTabbedPane();
jTabbedPane2 = new JTabbedPane();
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT);
jTabbedPane1.setBackground(Color.red);
// jTabbedPane1.setOpaque(false);
jTabbedPane1.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
jTabbedPane1.add(jPanel3, "Problem");
jTabbedPane1.add(jPanel4, "Pane");
jTabbedPane2.setBackground(Color.orange);
jTabbedPane2.setOpaque(true);
jTabbedPane2.add(jPanel1, "Working");
jTabbedPane2.add(jPanel2, "Pane");
jSplitPane1.add(jTabbedPane1, JSplitPane.TOP);
jSplitPane1.add(jTabbedPane2, JSplitPane.BOTTOM);
jSplitPane1.setDividerLocation(100);
this.getContentPane().add(jSplitPane1, BorderLayout.CENTER);
I have tried added the suggested solution
javax.swing.UIManager.put("TabbedPane.tabsOpaque", Boolean.FALSE);
javax.swing.UIManager.put("TabbedPane.contentOpaque", Boolean.FALSE);
prior to creating the tab pane but stll get the problem.
am I doing something wrong.

The fix for the bug 4690946(http://developer.java.sun.com/developer/bugParade/bugs/4690946.html) was integrated only in jdk 1.5

Similar Messages

  • Background color changes when using AJAX

    I'm using NetBeans and the plugin Project Dynamic Faces Ajax Components. Each time a radio button is selected a few textfields are hidden/shown.
    But each time I press a radio button, my background color of my JSF page is changed (from blue) back to white.
    Does anyone know how to disable this, or just how I can set the background of the page manualy in the java code.
    I've tried this.setBackground(...); , but it doesn't work.

    Hi. I currently use Canon, and i only see it in my RAW files.  All camera firmware is up-to-date. I am running latest version of Aperture, but still running 10.6.8. I went through a bunch of old photos where there was a good red color of something and i was able to duplicate the problem each time. Where there was a large area of red, it was VERY noticable. Also, I used to shoot with Nikon and my NEF files do the same thing where there is a nice red.  It seems to be an Aperature "thing."
    What i find so curious, is that even if I make no adjustments to the Levels sliders, just checking the box alters the color, same with the Vignette brick.  Also, I do color calibrate my monitor. thanks.

  • The canvas background color disappeared when using updateDisplayList

    If I put code in the updateDisplayList for canvas. The
    background color is disappeared. if I called
    super.updateDsplayList(), all the drawing is not show.
    What 's wrong with my code or Canvas class?
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns:cmp="PlanUI.*" creationComplete="init()">
    <mx:Style source="2dStyle.css"/>
    <mx:Script>
    <![CDATA[
    import PlanUI.TestCanvas;
    public function init():void
    var dc:TestCanvas=new TestCanvas();
    dc.percentWidth=100;
    dc.percentHeight=100;
    dc.setStyle("backgroundColor",0xFF0000);
    this.addChild(dc);
    ]]>
    </mx:Script>
    </mx:Application>
    package PlanUI
    import mx.containers.Canvas;
    public class TestCanvas extends Canvas
    public function TestCanvas()
    super();
    this.percentHeight=100;
    this.percentWidth=100;
    override protected function
    updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
    this.graphics.clear();
    // super.updateDisplayList(unscaledWidth, unscaledHeight);
    this.graphics.lineStyle(1,0xFF0000,0.3);
    this.graphics.drawRect(0,0,200,200);

    Yes, it is the same drag and drop project.
    I changed color of draw rectangle The rectangle showed up. If
    I called super.updateDisplayList(unscaledWidth, unscaledHeight) in
    updateDisplayList function, the background will show up, however,
    show in front of the rectangle.
    There are 2 problems:
    1> background color is show in front of rectangle,
    2> I set rectangle.x=0, rectangle.y=0, but the begin point
    is out side of the the canvas.
    package PlanUI
    import mx.containers.Canvas;
    public class TestCanvas extends Canvas
    public function TestCanvas()
    super();
    this.percentHeight=100;
    this.percentWidth=100;
    this.setStyle("borderThickness", 0);
    override protected function
    updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
    // super.updateDisplayList(unscaledWidth, unscaledHeight);
    this.graphics.clear();
    this.graphics.lineStyle(33,0x00FF00,1.0);
    this.graphics.drawRect(0,0,unscaledWidth/2,unscaledHeight/2);
    // super.updateDisplayList(unscaledWidth, unscaledHeight);
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns:cmp="PlanUI.*" creationComplete="init()">
    <mx:Style source="2dStyle.css"/>
    <mx:Script>
    <![CDATA[
    import PlanUI.TestCanvas;
    public function init():void
    var dc:TestCanvas=new TestCanvas();
    dc.percentWidth=100;
    dc.percentHeight=100;
    dc.alpha=1.0;
    dc.setStyle("backgroundColor",0xFFEE00);
    this.addChild(dc);
    ]]>
    </mx:Script>
    </mx:Application>

  • Is there a way to remove the blurred background wallpaper effect when using the phone in iPhone 4S' iOS 7?

    Hello.
    A few nights ago, my picky client finally upgraded his iPhone 4S' iOS 6 to iOS 7. He doesn't like the blurred background wallpaper image when using the phone feature (e.g., calling and talking). Is there a way to disable this new visual effect like in iOS 6?  I am pretty sure this is by design by Apple.
    Thank you in advance.

    sberman wrote:
    I'm not completely sure I understand, but ...
    Might Settings > General > Accessibility > Reduce Motion = "On" do what the customer wants?
    I will tell him about that, but I don't think that would be it if that is related to animation.
    We're talking about the wallpaper background that get blurry during the phone screens like http://www.tekrevue.com/wp-content/uploads/2013/09/20130923_ios7emergencycallfla w.jpg (left side) and http://i.i.cbsi.com/cnwk.1d/i/tim2/2013/09/20/ChangingYourTheme.png ... You can see there are background images that got blurred out.

  • 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

  • Item Background Color changes when placed in production (Forms 10g)

    Hello All,
    I have searched the forum on this topic, but have not been successful in finding a topic/solution for multi-line items that need to render a different color than the rest.
    I have used set_item_instance_property (and set_item_property) as well as using a VA to resolve this issue to no avail.
    When I view the form in the browser - initially in query-mode, I see the color that I have set for the item. Once the query is fetched and I am in non-query mode (display), the items background color is replaced to the standard color (off yellow) for non-editable fields.
    I have taken all of the subclasses off, used the item property from the pallette as well as manually programmed within a trigger and cannot get this item to stay the color that I have set.
    Can anyone help me get this working?

    Are you using the 0 to 100 rgb color assignments you see in the Forms Builder color palette? If so, that is your problem. At run time, you have to convert the color numbers to 0 to 255 numbers. Just multiply each of the three parts by 2.55
    Or maybe there is come code running elsewhere in your form that is setting the color after your code is run.
    Search your form for background_color.

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

  • AS2 TextInput Background Color - Issues when trying to change dynamically

    Hello,
    I'm having issues changing a TextInput background color after the initial onLoad using AS2.
    On load, I have no issues setting the background color with this code:
    Code:
    onClipEvent (load) {
        this.background = true;
        this.backgroundColor = 0x1E1C1C;
    However, I have a form validator run when focus is lost but yet I cannot set the background color at that point. For example, I'm trying to set the background color to orange and text to white if the field's contents are invalid. Even something simple like this doesn't affect the colors.
    Code:
    on (focusOut) {
            this.backgroundColor = 0xFAA523;
            this.borderColor = 0xFAA523;
            this.borderStyle = "solid";
            this.color = 0xFFFFFF;
            this.text = 'Enter your first name';
    All code is in actions for the TextInput itself.
    Anyone know what I'm doing wrong?
    Thanks in advance!

    Actually, that's not the solution. You need to use setStyle to access the backgroundColor property when the TextInput is already generated.
    This worked for me:
    this.setStyle("backgroundColor",0x1E1C1C);

  • Portlet Background Color Disappears when displayed

    Hi,
    I am using ver 9.0.4.0.99 of Portal and I'v created several Navigation Pages for the top banner and footer of my pages.
    The banner is divided into two regions each holding an image. To 'fill in' the white space that surrounds the images I've specified a background color (blue) in a 'banner style' and added it to each region of the Navigation Page.
    When we look at the Navigation Page alone, all looks well, but when we add the Navigation Page as a portlet to our root page in a banner region, the background color just disapears. I am left with two images surrounded by
    whitespace.
    I have just recently done the same process (nav pages with separate styles) in version 9.0.2.6 with another company and I did not have this problem. It worked fine. I even went back to make sure I followed the exact same steps and settings.
    Has something changed with this version (9.0.4.0.99)?
    Any ideas what we are doing wrong? Thx for your input.

    In the properties for your navigation page, on the Others tab, ensure the "Use Style Of Page On Which Portlet Is Placed " checkbox is unchecked. This should force it to use the style you picked in the banner page and not on the display page. Please note this checkbox only has affect on item regions in the navigation page. Portlet regions on the navigation page will take the colors from the style on the display page.
    Hope this helps,
    Candace

  • SWF background color changes when uploaded to server

    I built my Flash all pretty, based upon a black background.
    When ran on the local copy, the black shows up as black & the
    Flash is like it should be. However, as soon as I upload it to the
    server and run it from there, the Flash background changes to
    white, which as you can imagine, royally screws up the visuals. Any
    clue as to why it would do this?! I can't think of any reason why
    it should. The server is in-house and will only be used for an
    Intranet page, so any possible corruption over the web should be
    negated. Help!!

    I'd like to post a link, but like I said, it's only internal.
    When I look at the HTML, it's set to black (background-color:
    #000000). Also, when I load it, the page itself is black, but the
    background of the Flash *only* has turned white. I can load the
    exact same page on my local drive and it comes up black. I've got
    publish settings to Flash 8 (my version) and AS 2.0. I checked that
    first because I've published lower in the past and had
    issues.

  • Numeric Control - Text and Background Color changes when operating inc/dec arrows

    Hi,
    I'm developing an application that has a panel with black background and green or red numbers. I've added numeric controls and configured the text color and text background color attributes accordinglingy. I set the numeric control to hot or validate  control mode and show the inc/dec arrows, since I want to be able to incr/decr the numbers.
    The problem is that when I run the application and I hit the inc/dec arrows, then the colors inside the numeric control frame become inverted: the black background becomes white and the green number becomes cyan. I've created a callback function assosicated with the numeric control and tried forcing the text and background color, in the EVENT_VAL_CHANGED section, using the SetCtrlAttrribute() function, but to no avail. Also added ProcessDrawEvents didn't help.
    When I mouse click again outside the numeric control, then it reverts back to its original colors (green text, black background).
    Any suggestions as to how I can fix this ?
    I want it to keep its original colors at all times, even when I'm clicking the incr/decr arrows...
    Kind regards,
    pgriep
    Solved!
    Go to Solution.

    Ok, now I see what's happening.
    The effect you are seeing is a resul of standard numeric control behaviour combined with the black bcakground: when you use arrows to increment/decrement a numeric control its value will be automatically highlighted; on the default background you'll see the white area and figures highlighted in black (white numbers on balck background). If you set the background to black the system will automatically change the colors used to highlight the text, and that's what you're seeing.
    By the way, this does not happens if you use up and down keys on the keyboard: text is not highlighted so colors are not changing.
    Additionally, this is not only valid for numerics: see the behaviour of the string controls on the bottom of your panel when you tab up to them. This effect does not happen on controls set as indicator like the big clock in the upper part of the panel.
    The only way I can see to overcome this behaviour is to hide control built-in arrows and create your own up and down buttons with which you can manipulate the numeric control. I am attaching a modified version of your project with buttons on the left numeric; sorry for the poor aesthetic:  I have used some arrow icons I had on my disk, you may want to create your own arrows with the colors and shape you prefer.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?
    Attachments:
    ModifiedApplication.zip ‏9 KB

  • Photo losing color/contrast when using "save as" to save it.

    When I first started using CS6 I would edit my photos and when I used "save as" to save my photos then open them in a different photo viewer they would have lost a lot of color and contrast. When I reopened them in CS6 they still had no color. This is all occured on my PC. I used to use PSE 7 (on my PC) and the "save as" function to save them and they turned out fine. I recently got an iMac and when saved on there the same way and reopened in a different viewer they'd have the correct color, but when opened on my PC the color would be lost again. Also tried opening the images I saved on my PC in CS6 on the iMac and they still had no colo/contrast. So that would mean it's not a monitor calibration thing. I'm trying to figure out how to save my photos so they have the best quality they can have for printing and also the correct color for clients to view on their computers. Hope this all makes sense, it's a little confusing. Any help is much appreciated!! Thanks!
    PS: I did use the "save for web" option on my PC and the photos have the correct color that way! But those aren't the proper size and stuff for printing. Also I'm very new to iMac and full photoshop so I'm not sure what sizes/pixels/color modes/etc are normal or what photos are supposed to be.

    It has to do with embedded profiles  and what app you are using to open on PC

  • Cell/Background color changes when copying to other Excel 2010 document

    When you copy and paste report cells (e.g. CO report outputted in Office integration, MS Excel) to a new Excel file, the background color changed dramatically (to bright red).
    SAP Theme:  SAP Signature Theme
    Excel 2010
    We tried paste option > match destination formatting but does not help.
    Anyone has similiar problems?  Appreciate any help.

    dear friend,
    you would do:
    1. search SAP Notes;
    2. check out the updates/patches for your MS Office;
    3. replicate it on another computer/another sap user (make sure it is a local issue)
    good luck!

  • Re:Setting background color in BSP using HTMLB

    Hi All,
    I am new to BSP's and i am using htmlb tags .The problem is i am able to set the background color of the page using html but i want the same using htmlb tags.Is there any tag to do this or shall i have to use themes?.Please help me in this issue.Thanks in advance.

    Hi Lokesh,
    This is the syntax of setting the background color
    <style type="text/css">
    .urGrpTtlBox{
      background-color:#FF0000;
    </style>
    paste it in layout page.
    Award me if this answer is helpful to u.

  • Color difference when using a different programs

    I find this very odd, but now that I am using multiple program within the Creative Suite I am beginning to notice color differences. For instance, if I use hex: #200add in Photoshop it renders a different blue then in Illustrator or InDesign. Why is this? And how can I keep the colors consistent? It's not just with hex colors but with RGB/CYMK. Is there a way I can move my color specs from Photoshop to InDesign and Illustrator?
    It's the same monitor, same file, same everything, but a different program renders a different color. I am also running CS5.5 on a iMac
    Any help would be greatly appreciated!

    Hex color shifts appearance on screen depending on what source ICC profile is being used (or passed through to the monitor) and the monitor profile
    in other words hex color on the monitor seems to be dependent on the profile (colorspace) it was set in and how different the monitor profile is from that profile (colorspace)
    to keep it consistent in a Web browser, Convert your files to sRGB before setting a hex color before saving for web
    acuracy is a different matter
    COLOR CONSISTENCY vs. COLOR ACCURACY
    A real problem for Web designers and color-managed Web browsers is mixing tagged and untagged color where the graphic background needs to "match" or blend seamlessly into an HTML background color. The choice really boils down to designing Web pages for color consistency or color accuracy...MORE (see the COLOR CONSISTENCY vs. COLOR ACCURACY tutorial)
    printing, I would think, is bound by the same rules
    Photoshop, InDesign and Illustrator -- you could start by syncing your Color Settings in those apps and being aware of the rules (how each app uses profiles) but i don't think there is a simple answer here

Maybe you are looking for