Change MetalLookAndFeel JLabel Color?

I am wanting to use the MetalLookAndFeel in my application, but want the color for all my JLabels to be Black instead of the purpleish color I understand how to create your own custom color themes but cannot find out how to change the JLabel color does anybody know what needs to be in myCustom theme that will change that color to black?

Not sure if this is exactly what you are after but...
JLabels are usually transparent to start with and show the underlying component's background colour. If you want to change the background, you have to set the color and then use setOpaque(true).

Similar Messages

  • Change disabled JLabel text color

    Hi all
    I have some JLabels labelled black on grey color.
    When I disable them, the text color is too close to th background color to keep them readable. Is there a way to change the disabled color of the text to keep it dark enough to be read?
    Thanks

    import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    public class Test {
        public static void main(String[] args) {
             UIDefaults uid = UIManager.getLookAndFeelDefaults();
             for(Iterator i = uid.keySet().iterator(); i.hasNext(); ) {
                 String key = (String) i.next();
                 if (key.startsWith("Label"))
                    System.out.println(key);
             UIManager.put("Label.disabledForeground", new Color(0x80, 0x40, 0));
             JPanel contentPane = new JPanel();
             JLabel label1 = new JLabel("This one is enabled");
             label1.setOpaque(true);
             contentPane.add(label1);
             JLabel label2 = new JLabel("This one is disabled");
             label2.setOpaque(true);
             label2.setEnabled(false);
             contentPane.add(label2);
             final JFrame f = new JFrame();
             f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             f.setContentPane(contentPane);
             f.pack();
             SwingUtilities.invokeLater(new Runnable(){
                public void run() {
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    }

  • Changing a JLabel?

    Im trying to update a JLabel as my mouse moves this is what I have.
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import java.awt.*;
    import java.io.IOException;
    import java.net.MalformedURLException;
    public class RightPanelEarth extends JPanel
         private static class RightPanelHolder
           private static RightPanelEarth instance = new RightPanelEarth();
        public static RightPanelEarth getInstance()
          return RightPanelHolder.instance;
    private int xcoord;
    private int ycoord;
    private final JLabel coordLabel = new JLabel("X,Y");
         public RightPanelEarth()
             this.add(new JButton("Button"));
             this.add(coordLabel);
        public void setCoords(int x, int y)
         this.xcoord = x;
         this.ycoord = y;
         updateCoord();
        public void updateCoord()
            coordLabel.setText(this.xcoord+","+this.ycoord);
            System.out.println((this.xcoord)+","+(this.ycoord));
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import java.awt.*;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.util.ArrayList;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    public class LeftPanelEarth extends JPanel
         private static class LeftPanelHolder
           private static LeftPanelEarth instance = new LeftPanelEarth();
        public static LeftPanelEarth getInstance()
          return LeftPanelHolder.instance;
    Image map;
         public LeftPanelEarth()
             try
          map = javax.imageio.ImageIO.read(new java.net.URL(getClass().getResource("MyImage.jpg"), "MyImage.jpg"));
        catch(Exception e){}
        addMouseMotionListener(new CoordListener());
         class CoordListener extends MouseAdapter {
         public void mouseMoved(MouseEvent e) {
             RightPanelEarth rightPanel = RightPanelEarth.getInstance();
             rightPanel.setCoords(e.getX(), e.getY());
         public void paintComponent(Graphics g)
        super.paintComponent(g);
        if(map != null) g.drawImage(map, 0,0,this.getWidth(),this.getHeight(),this);
    }It works fine but it wont change the JLabel, I have a System.out.println just to make shur it works and it does. Any idea on how I can get the Label to change?

    Simple demo:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    public class MMLTest extends JFrame
      JLabel label = new JLabel("x,y");
      public MMLTest()
        super("Where's the mouse?");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JPanel mousePanel = new JPanel();
        mousePanel.setBorder(new LineBorder(Color.BLUE, 1));
        mousePanel.addMouseMotionListener(new MouseMotionAdapter(){
          public void mouseMoved(MouseEvent e)
            label.setText(e.getX() + ", " + e.getY());
        JPanel panel = new JPanel(new BorderLayout());
        panel.add(label, BorderLayout.WEST);
        Container c = getContentPane();
        c.setLayout(new BorderLayout());
        c.add(mousePanel, BorderLayout.CENTER);
        c.add(panel, BorderLayout.SOUTH);
        setSize(400,200);
      public static void main( String[] args )
        MMLTest frame = new MMLTest();
        frame.setVisible(true);
    }

  • Change the Black Color to BufferedImage?...or change size later of created?

    Cordial Greetings...
    I want to change the black color of BufferedImage later of Created and change the size too?
    Can I to
    Sorry, There are several questions about BufferedImage...
    As I can put in a Panel (or Canvas) a BufferedImage?
    Thank you....

    joseluisbz.hotmail wrote:
    I want to change the black color of BufferedImage later of CreatedThat is not as easy as it sounds. Perhaps this link can help you.
    [http://helpdesk.objects.com.au/java/changing-the-colormodel-of-a-bufferedimage|http://helpdesk.objects.com.au/java/changing-the-colormodel-of-a-bufferedimage]
    and change the size too?That is not specific enough. "Change the size" - what will happen to the image itself? Will the image be stretched to the new size? Do you want to keep the original size add empty space around it?
    Sorry, There are several questions about BufferedImage...
    As I can put in a Panel (or Canvas) a BufferedImage?That at least is easy. Add a JLabel with as content an ImageIcon that holds your BufferedImage.

  • HT203175 How do you change the backround color on your Itunes page.

    How do you change the backround color on your Itunes page.

    JLabel textLabel = new JLabel ("Radius: ",JLabel.RIGHT);
    textLabel.setForeground (Color.black);
    i hope this helps
    good luck

  • Changing JCheckBox default color when disabled

    I am using JCheckBoxes to serve as a checklist providing feedback to the user on how far through a sequence of events the program has progressed. I do not want the user to be abel to check the boxes himself.
    I currently am using JCheckBox.setEnabled(false) to keep the user for ticking the boxes. Unfortunately this changes the foreground color from black (readable) to gray (unreadable). setForeground has no effect.
    So I have two questions:
    1. Is there a better way to secure JCheckBoxes from the user?
    2. If not is there a way to alter the default disabled color for specific CheckBoxes?

    hopefully there's a better way than this
    (the checkBoxIcon code is just to do with the tick)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.plaf.metal.*;
    class Testing extends JFrame
      public Testing()
        UIManager.put("CheckBox.disabledText",Color.BLACK);
        setLocation(400,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JCheckBox cbx = new JCheckBox("Disabled",new CheckBoxIcon(),true);
        getContentPane().add(cbx,BorderLayout.NORTH);
        getContentPane().add(new JCheckBox("Enabled",true),BorderLayout.SOUTH);
        pack();
        cbx.setEnabled(false);
      public static void main(String[] args){new Testing().setVisible(true);}
    class CheckBoxIcon implements Icon
      protected int getControlSize() { return 13; }
      private void paintOceanIcon(Component c, Graphics g, int x, int y)
        ButtonModel model = ((JCheckBox)c).getModel();
        g.translate(x, y);
        int w = getIconWidth();
        int h = getIconHeight();
        if (model.isPressed() && model.isArmed())
          g.setColor(MetalLookAndFeel.getControlShadow());
          g.fillRect(0, 0, w, h);
          g.setColor(MetalLookAndFeel.getControlDarkShadow());
          g.fillRect(0, 0, w, 2);
          g.fillRect(0, 2, 2, h - 2);
          g.fillRect(w - 1, 1, 1, h - 1);
          g.fillRect(1, h - 1, w - 2, 1);
        g.setColor( MetalLookAndFeel.getControlInfo() );
        g.translate(-x, -y);
        if (model.isSelected())
          drawCheck(c,g,x,y);
      public void paintIcon(Component c, Graphics g, int x, int y)
        ButtonModel model = ((JCheckBox)c).getModel();
        int controlSize = getControlSize();
        if (model.isPressed() && model.isArmed())
          g.setColor( MetalLookAndFeel.getControlShadow() );
          g.fillRect( x, y, controlSize-1, controlSize-1);
          drawPressed3DBorder(g, x, y, controlSize, controlSize);
        else
          drawFlush3DBorder(g, x, y, controlSize, controlSize);
        g.setColor( MetalLookAndFeel.getControlInfo() );
        if (model.isSelected())
          drawCheck(c,g,x,y);
      private void drawFlush3DBorder(Graphics g, int x, int y, int w, int h)
        g.translate(x, y);
        g.setColor(MetalLookAndFeel.getControlDarkShadow());
        g.drawRect(0, 0, w-2, h-2);
        g.setColor(MetalLookAndFeel.getControlHighlight());
        g.drawRect(1, 1, w-2, h-2);
        g.setColor(MetalLookAndFeel.getControl());
        g.drawLine(0, h-1, 1, h-2);
        g.drawLine(w-1, 0, w-2, 1);
        g.translate(-x, -y);
      private void drawPressed3DBorder(Graphics g, int x, int y, int w, int h)
        g.translate(x, y);
        drawFlush3DBorder(g, 0, 0, w, h);
        g.setColor(MetalLookAndFeel.getControlShadow());
        g.drawLine(1, 1, 1, h-2);
        g.drawLine(1, 1, w-2, 1);
        g.translate(-x, -y);
      protected void drawCheck(Component c, Graphics g, int x, int y)
        int controlSize = getControlSize();
        g.fillRect( x+3, y+5, 2, controlSize-8 );
        g.drawLine( x+(controlSize-4), y+3, x+5, y+(controlSize-6) );
        g.drawLine( x+(controlSize-4), y+4, x+5, y+(controlSize-5) );
      public int getIconWidth() {return getControlSize();}
      public int getIconHeight() {return getControlSize();}
    }

  • How can I change the background of a running webpage on my own. Example Facebook I want to change its backround color from white to black just in my view not for all

    How can I change the background of a running webpage on my own. Example Facebook I want to change its background color from white to black just in my view, not for all. Cause I really hate some site with white background because as I read for an hour it aches my eyes but not on those with darker background color.

    You can use the NoSquint extension to set font sizes (text/page zoom) and text colors on web pages.
    *NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/

  • In Pages 5.0 How do I change the highlight color?

    In Pages 5.0 How do I change the highlight color?

    Oh!  I understand now.  See screenshot below.  It's called "Character Fill Color":

  • Change the font color of a text field in a table by key-combination

    I want to change the font color of a text field in a table (single cell only) on pressing a key combination. Does anybody know how to do this.
    I have a lot of data in a table. During an evaluation of the data in a meeting I want to change the color of the text depending on the result of the meeting. (for example: High risk = CTRL+R makes the text red).
    I know how to change the color using a button, but I do not want to add a button after each cell. For this reason I would like to do it on a key combination that alway refers to the active cell.
    Many thanks for your help in advance.
    Marcel

    Hi,
    I don't think you can use the ctrl key like that as those shortcuts will be intercepted by Reader (ctrl-R toggles the ruler display on / off).  You also might have trouble updating the color while you still have focus on it.  You can use the shift key in a similar way, so if you only have lower case characters in the text fields then you can do something like;
    if (xfa.event.shift)
        switch (xfa.event.change)
            case "R":
                this.fontColor = "255,0,0";
                break;
            case "O":
                this.fontColor = "255,102,0";
                break;
            case "G":
                this.fontColor = "0,255,0";
                break;
        xfa.event.change = ""; // ignore character
    If you need uppercase characters maybe you can have one button to set "review mode" and test that on the if (xfa.event.shift) line.  But again it wont take effect until you have tabbed out of the field.
    Regards
    Bruce

  • How do I change the text color of footers on select pages? (InDesign CS6)

    Good afternoon,
    Months ago, I worked with a graphic designer to put together a 100-page workbook for my training company. He turned all of the files over to me and I'd like to make a small change before we print another run for a new client. Specifically, I'm having trouble changing the text color on select pages. Since a picture says 1,000 words, let me give you an example:
    As you can see, the copyright information on the right side of the page is difficult to read here when placed over the photo (you may have to look closely, but it's along the guy's sleeve). What I'd love to do is change that part of the footer (not the left, page number side) to white text. This would make it quite a bit easier to read. There's a number of other pages in the book that I want to make this change to. I'm not sure why I never noticed it or mentioned it to the designer. I suppose I've become more discerning since then.
    Let me tell you what I've tried to do:
    I learned how to override master pages by CTRL+SHIFT clicking on the footer. However, this has not worked for me. It allows me to change the page number part, but not the copyright side. Additionally, sometimes when I override the master the formatting of the footer goes goofy. For instance, the left side and right side come together and end up in the middle of the page I'm working on.
    I'm looking for a quick way to go through and make the footers easier to read on pages where they are backed by a photo. Hoping you can help me. Please let me know if you need any other information.
    Best,
    Taylor

    I think you should have left it as it was. It seems like what you had was single pages flowing as spreads within InDesign. Like below. That is the correct way, and when you changed it to all single, it did create your footer problems.
    Will you be sending the file as a PDF to your online printer? If so, then leaving the InDesign file set as below is fine. The PDF output will separate the pages.
    All you have to do is make sure that Pages, not Spreads, is chosen when you output the PDF

  • How do I change font and colors back to default?

    I have changed the font and color of the text through the tools button and the options button and the content tab. I find nothing telling me how to change the font and colors back to default font and colors. Can you advise me? I'm using Windows 7 Home Premium OS. Thanks.

    Hi Brenda19605,
    You can use this article to set the fonts and colors: https://support.mozilla.org/en-US/kb/change-fonts-and-colors-websites-use?esab=a&s=font&r=0&as=s
    The default settings for the font are in this article:
    https://support.mozilla.org/en-US/kb/Some%20text%20shows%20up%20bold%20after%20upgrade
    Unfortunately for the default colors has no good reference. But for text it is black (most lower left) color, background is white (most upper left color). Unvisited links is blue (column 8, row 5) and visited link is purple (column 9, row 5).
    Let me know if you need anymore help!
    Lordfreak

  • How to change the default color of the selected row

    hi all,
    I need to know how to change the default color(yellow) of the selected row in a table component.whether i need to change anything in the stylesheet.If so, where should i make the changes in the stylesheet.
    thanks and regards,
    rpk

    The chart colors are being referred to *'palette.cxml'* file in these directories
    BI_HOME\web\app\res\s_oracle10\chartsupport
    BI_HOME\oc4j_bi\j2ee\home\applications\analytics\analytics\res\s_oracle10\chartsupport
    you can change to your custom colors.
    Restart OC4J and PS to make the new ones work..
    Regards,
    Raghu

  • I have trouble reading in Black and White. changing the background color for all

    I have trouble reading in Black and White. On my PC I can change the background  color (and I am not just talking about for a word or pages document) but for eveything so anything that was a white background I can put in what ever color I like but it still prints in Black and white.. I can't see how to do this on the Macbook air. on my PC I do this in display. Sort of putting colored film over the screen I dont know what to do. Can anyone help?

    Hello Floridamacbookpro,
    You may be interested in the 'invert colors' Accessibility feature. This can be invoked by pressing the Control, Option, Command, and 8 keys on your keyboard. This only affects your display, and does not have any affect on printed items.
    Mac OS X displays inverted image colors (white on black, reverse type)
    http://support.apple.com/kb/HT3488
    Cheers,
    Allen

  • How to change object background color on  java run time

    Hi,
    I create object loading program. my problem is run time i change object background color using color picker. i select any one color of color picker than submit. The selecting color not assign object background.
    pls help me? How to run time change object background color?
    here follwing code
    import com.sun.j3d.loaders.objectfile.ObjectFile;
    import com.sun.j3d.loaders.ParsingErrorException;
    import com.sun.j3d.loaders.IncorrectFormatException;
    import com.sun.j3d.loaders.Scene;
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.universe.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import java.io.*;
    import com.sun.j3d.utils.behaviors.vp.*;
    import java.net.URL;
    import java.net.MalformedURLException;
    import java.awt.Graphics ;
    import javax.swing.*;
    public class ObjLoad1 extends Applet implements ActionListener
    private boolean spin = false;
    private boolean noTriangulate = false;
    private boolean noStripify = false;
    private double creaseAngle = 60.0;
    private URL filename = null;
    private SimpleUniverse u;
    private BoundingSphere bounds;
    private Panel cardPanel;
    private Button Tit,sub;
    private CardLayout ourLayout;
    private BorderLayout bl;
    Background bgNode;
    BranchGroup objRoot;
    List thelist;
    Label l1;
    public BranchGroup createSceneGraph()
    BranchGroup objRoot = new BranchGroup();
    TransformGroup objScale = new TransformGroup();
    Transform3D t3d = new Transform3D();
    t3d.setScale(0.7);
    objScale.setTransform(t3d);
    objRoot.addChild(objScale);
    TransformGroup objTrans = new TransformGroup();
    objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
    objScale.addChild(objTrans);
    int flags = ObjectFile.RESIZE;
    if (!noTriangulate) flags |= ObjectFile.TRIANGULATE;
    if (!noStripify) flags |= ObjectFile.STRIPIFY;
    ObjectFile f = new ObjectFile(flags,(float)(creaseAngle * Math.PI / 180.0));
    Scene s = null;
         try {
              s = f.load(filename);
         catch (FileNotFoundException e) {
         System.err.println(e);
         System.exit(1);
         catch (ParsingErrorException e) {
         System.err.println(e);
         System.exit(1);
         catch (IncorrectFormatException e) {
         System.err.println(e);
         System.exit(1);
         objTrans.addChild(s.getSceneGroup());
         bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
    if (spin) {
         Transform3D yAxis = new Transform3D();
         Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE,0,0,4000,0,0,0,0,0);
         RotationInterpolator rotator = new RotationInterpolator(rotationAlpha,objTrans,yAxis,0.0f,(float) Math.PI*2.0f);
         rotator.setSchedulingBounds(bounds);
         objTrans.addChild(rotator);
    //Background color setting
    Color3f bgColor = new Color3f(100,200,230);
    bgNode = new Background(bgColor);
    bgNode.setApplicationBounds(bounds);
    objRoot.addChild(bgNode);
    return objRoot;
    private void usage()
    System.out.println("Usage: java ObjLoad1 [-s] [-n] [-t] [-c degrees] <.obj file>");
    System.out.println("-s Spin (no user interaction)");
    System.out.println("-n No triangulation");
    System.out.println("-t No stripification");
    System.out.println("-c Set crease angle for normal generation (default is 60 without");
    System.out.println("smoothing group info, otherwise 180 within smoothing groups)");
    System.exit(0);
    } // End of usage
    public void init() {
    if (filename == null) {
    try {
    URL path = getCodeBase();
    filename = new URL(path.toString() + "./galleon.obj");
    catch (MalformedURLException e) {
         System.err.println(e);
         System.exit(1);
         //setLayout(new BorderLayout());
         //setLayout(new GridLayout(5,0));
         //setLayout(new CardLayout());
         //setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
    GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
    Canvas3D c = new Canvas3D(config);
    add(c);
    BranchGroup scene = createSceneGraph();
    u = new SimpleUniverse(c);
    ViewingPlatform viewingPlatform = u.getViewingPlatform();
    PlatformGeometry pg = new PlatformGeometry();
    Color3f ambientColor = new Color3f(45,27,15);
    AmbientLight ambientLightNode = new AmbientLight(ambientColor);
    ambientLightNode.setInfluencingBounds(bounds);
    pg.addChild(ambientLightNode);
    Color3f light1Color = new Color3f(111,222,222);
    Vector3f light1Direction = new Vector3f(1.0f, 1.0f, 1.0f);
    Color3f light2Color = new Color3f(1.0f, 1.0f, 1.0f);
    Vector3f light2Direction = new Vector3f(-1.0f, -1.0f, -1.0f);
    DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);
    light1.setInfluencingBounds(bounds);
    pg.addChild(light1);
    DirectionalLight light2 = new DirectionalLight(light2Color, light2Direction);
    light2.setInfluencingBounds(bounds);
    pg.addChild(light2);
    viewingPlatform.setPlatformGeometry(pg);
    viewingPlatform.setNominalViewingTransform();
    if (!spin) {
    OrbitBehavior orbit = new OrbitBehavior(c,OrbitBehavior.REVERSE_ALL);
    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0);
    orbit.setSchedulingBounds(bounds);
    viewingPlatform.setViewPlatformBehavior(orbit);     
    u.addBranchGraph(scene);
         public ObjLoad1(String[] args) {
              if (args.length != 0) {
                   for (int i = 0 ; i < args.length ; i++) {
                        if (args.startsWith("-")) {
                             if (args[i].equals("-s")) {
                                  spin = true;
                             } else if (args[i].equals("-n")) {
                                  noTriangulate = true;
                             } else if (args[i].equals("-t")) {
                                  noStripify = true;
                             } else if (args[i].equals("-c")) {
                                  if (i < args.length - 1) {
                                       creaseAngle = (new Double(args[++i])).doubleValue();
                                  } else usage();
                             } else {
                                  usage();
                        } else {
                             try {
                                  if ((args[i].indexOf("file:") == 0) ||
                                            (args[i].indexOf("http") == 0)) {
                                       filename = new URL(args[i]);
                                  else if (args[i].charAt(0) != '/') {
                                       filename = new URL("file:./" + args[i]);
                                  else {
                                       filename = new URL("file:" + args[i]);
                             catch (MalformedURLException e) {
                                  System.err.println(e);
                                  System.exit(1);
    public void actionPerformed(ActionEvent e)
         if (e.getSource() == Tit)
    //Color Picker tool
              Color c1 = JColorChooser.showDialog(((Component)e.getSource()).getParent(),"Zaxis Color Picker", Color.blue);
              cardPanel.setBackground(c1);
              objRoot.removeChild(bgNode);
              int a = c1.getRed();
              int b = c1.getBlue();
              int c = c1.getBlue();
              System.out.println(a);
              System.out.println(b);
              System.out.println(c);
              Color3f ccc = new Color3f(a,b,c);
              bgNode.setApplicationBounds(bounds);
         objRoot.addChild(bgNode);
         else
              System.out.println("mathi");
    public ObjLoad1()
    Tit = new Button("BG Color");
    sub = new Button("Object Color");
    cardPanel = new Panel();
    cardPanel.add(Tit);
    cardPanel.add(sub);
    //cardPanel.add(l1);
    //cardPanel.add(thelist);
    sub.addActionListener(this);
    Tit.addActionListener(this);
    // thelist.addActionListener(this);
    //setLayout for applet to be BorderLayout
    this.setLayout(new BorderLayout());
    //button Panel goes South, card panels go Center
    this.add(cardPanel, BorderLayout.SOUTH);
    //this.add(cardPanel, BorderLayout.CENTER);     
    this.setVisible(true);
    public void destroy() {
    public static void main(String[] args) {
         new MainFrame(new ObjLoad1(args),400, 400);

    hi,
    i am using setColor(Color3f color) method
    like
    if (e.getSource() == Tit)
              Color c1 = JColorChooser.showDialog(((Component)e.getSource()).getParent(),"Zaxis Color Picker", Color.blue);
              bgColor = new Color3f(c1);
              System.out.println(bgColor.get());
         bgNode.setColor(bgColor);
         bgNode.setApplicationBounds(bounds);
         objRoot.addChild(bgNode);
    but error will be displayed
    like
    javax.media.j3d.CapabilityNotSetException: Background: no capability to set color
         at javax.media.j3d.Background.setColor(Background.java:307)
         at ObjLoad1.actionPerformed(ObjLoad1.java:230)
         at java.awt.Button.processActionEvent(Unknown Source)
         at java.awt.Button.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    pls help me

  • How to change the background color only for one HTML-Portlet?

    Hi all,
    I have created a HTML-Portlet in my root-page. The root page have a style: Main-Style.
    I want to change the background-color only for this one HTML-Portlet:
    <html>
    <header><title>Test</title></header>
    <body bgcolor="#999999">
    Test
    </body>
    </html>
    But this does not work...
    When I use the CSS, then it will change the background-color for the root-page too.
    Thans
    Leonid Pavlov

    could you try this
    <table bgcolor="#999999">
    <tr>
    <td>
    test
    </td>
    </tr>
    </table>
    I don't think you need <html><header><title>Test</title></header>
    <body></body></html> for your HTML-Portlet.

Maybe you are looking for