Changing the foreground color of CloseButton in tabbedpane

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Changing the foreground color of CloseButton in tabbedpane

Postby CassidianUser » Mon Sep 08, 2014 7:01 am

Hello team,
I am using JidetabbedPane.
I have a CloseButton on tab. I have changed the foreground color of CloseButton by extending the NoFocusButton class.
But that will change the color for everytab
I would like to have the different foreground color of CloseButton when tab is not selected.
Is this possible?

here is my code
Code: Select all
@Override
   public NoFocusButton createNoFocusButton(int arg0) {
      return new ExtendedNoFocusButton(arg0);
   }

   public class ExtendedNoFocusButton extends NoFocusButton {

        public ExtendedNoFocusButton(int type) {
            super(type);
        }

        @Override
      public void setOpaque(boolean isOpaque) {

         super.setOpaque(true);
      }

      @Override
      public void setBorder(Border border) {

         super.setBorder(BorderFactory.createLineBorder(Color.ORANGE, 2));
      }

      @Override
      protected Color getForegroundColor() {
         return Color.GREEN;
      }

      @Override
      protected Color getShadowColor() {

         return Color.BLACK;
      }

      @Override
      protected Color getPressedShadowColor() {

         return Color.BLACK;
      }
      @Override
      public void setBackground(Color bg) {
      
         super.setBackground(Color.BLUE);
      }
   }


Thanks in advance
CassidianUser
 
Posts: 21
Joined: Fri Apr 11, 2014 4:19 am

Re: Changing the foreground color of CloseButton in tabbedpa

Postby JIDE Support » Mon Sep 08, 2014 7:16 am

The only way I can think of is to add a setter to the close button to set to different foreground colors. Then add listener to detect tab change and call the setter to change the buttons foreground color.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Changing the foreground color of CloseButton in tabbedpa

Postby CassidianUser » Mon Sep 08, 2014 11:40 pm

thankyou for your reply.

I will try that
CassidianUser
 
Posts: 21
Joined: Fri Apr 11, 2014 4:19 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 12 guests