Each tab in JTabbedPane has different border color

Is it possible for the content of each tab in JTabbedPane area to have a different border color? By selecting the points highlights Tab1 content area of the component by tabs in yellow, by selecting tab2 it highlights in red, etc...

Thank you

I can't see the pictures of my work here. Here's a simple demo:

import java.awt.*;

import javax.swing.*;

public class TabbedPaneTest implements Runnable
{
  public void run()
  {
    JTabbedPane pane = new JTabbedPane();
    pane.addTab("A", createTab(Color.RED));
    pane.addTab("B", createTab(Color.YELLOW));
    pane.addTab("C", createTab(Color.BLUE));

    final JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.add(pane);
    frame.setSize(500, 200);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
  }

  private JPanel createTab(Color color)
  {
    JPanel p = new JPanel();
    p.setBorder(BorderFactory.createLineBorder(color, 2));
    return p;
  }

  public static void main(String[] args) throws Exception
  {
    SwingUtilities.invokeLater(new TabbedPaneTest());
  }
}

Tags: Java

Similar Questions

  • I wish that the tabs colorful. is it possible with Firefox? And or each new topic have a different color tab.

    I wish that the tabs colorful. is it possible with Firefox? And or each new topic have a different color tab.

    The ColorfulTabs extension can be useful for you.

  • I have an acer 2006 copyright edition 32 bit operating system computer and each update since 2007 has no im always getting error code 8000fff and different numbers that start with Ko failed

    Windows update error codes kb937287 kb960714

    each update since 2007 has no...

    Backup of personal data (which none should be considered 100% reliable at this point) then do a format and clean install of Windows.  Please note that a repair (upgrade AKA on-site) installation will fix it!

    Once installed the clean, you will have the equivalent of a "new computer" in order to take care of everything on the next page before connecting the machine to the internet or a network otherwise and before using a USB key that is not brand new, or has not been freshly formatted:

    5 steps to help protect your new computer before going online
         http://www.Microsoft.com/protect/computer/advanced/XPPC.mspx

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • How can I set different background color for the slider?

    Hello
    I want to set a different color for track Slider, slider track is spitted into two sections by slider-button.
    I want to put a left gray, the right of a white.
    Under css only changes the background of the entire track, but how I can change different background color for the slider?
    Any suggestion?
    .slider {
        -fx-border-width: 0;
    }
    .slider *.track {
        -fx-background-color:white;
        -fx-background-insets:  0, 1;
        -fx-border-color: #faf0e6;
        -fx-border-width: 1;
        -fx-border-style:solid;
        -fx-progress-color:yellow;
        -fx-border-radius: 20;
    }
    .slider.knobStyle:focused .knob {
        -fx-effect: dropshadow( three-pass-box , red , 5 , 0.5 , 0 , 0 );
    }
    .slider.knobStyle:unfocused .knob {
        -fx-effect: dropshadow( three-pass-box , red , 5 , 0.5 , 0 , 0 );
    }
    .slider .thumb {
         -fx-background-color:rgb(224,225,226);
         -fx-background-repeat:stretch;
         -fx-background-size:stretch;
         -fx-background-position:center top;
         -fx-background-image:url("../images/volume_ball.png");
            -fx-padding: 10;
    }

    I don't know why I can't get the node of the track, track has always set to null and the thumb or the other.

    After that the cursor was displayed on an active scene are you doing research?

    (ex.: after you have added the slider to a scene, the scene for scene, then called stage.show ())

  • Value selected in the drop-down list, the value border and subform border color

    OK, I'm busy to create a form that has a field drop-down list. There are five values inside the drop-down list. I have also four subforms which contain tables and fields for each option in the drop-down list except the first. Now, I want to put the border and the color of the border of the subform if you have selected the correct value.

    As part of the output, I created the code as follows:

    If (this.rawValue == '5') {}

    this.resolveNode("TextfieldName").presence = "visible"; This affects a visible text... works like a charm

    Optie1.UI.oneOfChild.border.color.value = "255,153,0"; After an example I found Niall

    Optie1.UI.oneOfChild.border.color.thickness = "0,0200" in

    }

    I've changed this in Optie1, is the name of the subform. Somehow it is not applied in the subform. I know I'm wrong, but can't find what I want on the forums. Someone at - it an idea on that?

    Well, managed to resolve myself to play around with the code.

    It should be:

    Optie1.border.edge.color.value and Optie1.border.edge.thickness.

  • How can I make each tab appears in the taskbar Linux

    The version of Windows 7 Firefox has the option to display of each tab in a separate post in the taskbar. I use Linux now (specifically, Linux Mint, Office MATE with compiz) and I miss this feature. In compiz, I can press Super + W to show all my windows at once on the screen. It does not help, however, because only the active tab exists on the bar of tasks and in the view of all windows.

    If it is not possible to display all the tabs as part of the taskbar, is there a way to configure firefox to not use tabs and just do a new window while he took a tab?

    On your main question, I have no idea.

    As for your second question, you can disable the derivation of new windows in new tabs in the settings here:

    Edit menu > Preferences > tabs

    Nevertheless, Firefox to open tabs on its own (for example, when you select Tools > modules or help > troubleshooting information), but it should address most of the cases. If you want to get totally rid of the tabs, there is an add-on for that. It is discussed in this thread: How can I completely disable tabs? Personally, though, I think it is probably overkill for most people.

  • When opening Firefox, all beginning tabs connect without websites, gray treatment circle on each tab periodically return to gray and green tours.

    When I run firefox opens not the normal page and rather the tabs start connection and without any Web site and the gray circle that each tab has fired green, and gray and the process repeats. And if I try to type an address that I can not because the support of 'w', it tries to connect to what I don't know.

    Hello, it sounds like a theme or extension could be interfering here. Please, try to start firefox in safe mode once and see if the problem occurs here also. in case it does not work, please go to firefox > addons > extensions and disable/remove no matter what extension that suspicious look / you install not intentionally, or which may interfere with the load behavior tab.

    Troubleshoot extensions, themes, and issues of hardware acceleration to resolve common problems of Firefox

  • Even if it worked perfectly until the automatic update to 3.6.13, Firefox displayed now ANY Web site, display (Untitled) on each tab.

    IE still works fine. Firefox has been excellent until 30 minutes ago when he if kindly updated itself, and now it shows me all the Web sites. I deleted all history, checked the proxy settings, nothing helped. Each tab displays (untitled).

    December 17, 2010 05:47 PM CST

    The problem is usually related to your firewall not allowing access to an unknown program; the new version of Firefox is not your firewall, although the old version. Remove references to firefox.exe in the list of programs in your firewall, then start Firefox, let the firewall re - detect Firefox and give it permissions to access the internet.

    See: http://support.mozilla.com/en-US/kb/Cannot+connect+after+upgrading+Firefox

  • change the border color of an image control

    Hi all

    I shows 30 photos on the façade by using an image control. I want the user to select 12 peaks of 30 photos.

    is there an interactive way to show what image has been selected. I thought that it would be OK to change the color of the border of the control.

    I would like to know how to change the border color of th and you are really welcome if you have a better way to say what peak has been selected.

    Thank you

    Ritesh

    Hi Ritesh,

    in my LV7.1 installation I could change bordercolor using the tool to color in development mode, but I couldn't find a property to change the colors by programming...

    So my advice would be to put a little bigger Boolean flags (or color boxes) behind the indicators of the photo. When the image is clicked/selected just change you the color of the underlying Boolean value. In this way imitate you the colorchanging of an indicator of the photo border...

  • The task manager has different headings

    I use Vista OS.  I opened my task manager, but instead of the usual information, it has different sections.  On the top line, section 1 says "User".  As such, it shows my user name.  Section 2 says "I.D." as such, it has a 1.  Section 3 says 'Customer name'.  It's empty.  Section 4 says "Session".  As such it is said 'Console '.

    The bottom line has a choice to 'disconnect '.  Another choice for 'logoff.  A third said choice 'send message '.  This topic is low and will not let me click on it.  There is no 'x' in the upper right corner to close it.  Everything else is empty.

    I tried to unplug, then restart your computer.  Then I disconnected and restarted.  She will not close unless I restart, and then not use it again.

    I've updated everything keep and my anti-virus is clear.

    Any suggestions?

    Hello Winniethepoo,

    Simply double-click anywhere in the upper part of the window Task Manager will bring back your borders and tabs. Make it a great day!

    "In the end, the love you take, is equal to the Love You Make"

  • Dreamweaver CC 2015 table border colors

    Is there a way to change a table border color in Dreamweaver CC 2015?

    Thank you

    If you don't want to or don't know how to manually encode the border, you can do it from the interface of DW...

    1. click on the Board design or Live View
    2. I know it sounds counterintuitive, but in the Properties window, set the border 0 (disables the html border and allows you to control your styles with css only)

    3. also set the CellSpace and CellPad fields to 0
    4. click on the + sign in the selectors section of the CSS designer

    5 double-click element selector he created (usually something like 'body div table') and change it to something like '.borders td' (with the forwards and the space between) so you can affect all cells of a table with class = 'borders' in its html code

    6. with .borders has highlighted, scroll down to the setting of the border in the Properties section of the CSS designer (to half way down)
    7. set the width, style and color it (1px green solid)

    8. click again on the table and make sure that the "borders" class is displayed in the field of the property inspector main class. (just 'borders' not 'borders td"

  • Change the border color of the elements required

    Adobe Livecycle Designer ES v8.2.1

    Dynamic PDF

    I spent the last hour searching the tangential broken links and tutorials. I have a group of required exclusion (radio buttons), and the user must select one of the values so that the form is valid. The problem is, I have hundreds of boxes, and they all have a gigantic red border stuck around them. There is no highlight when it is not verified and the form is submitted, they are all simply bright red.

    Here is what I tried:

    Group of exclusion on "initialize".

    This.Border.Presence = "invisible";

    This.Border.Edge.Presence = "invisible";

    This.Border.Fill.Presence = "invisible";

    this.borderColor.fillColor = "invisible";

    this.borderColor.presence = "invisible";

    this.fillColor.presence = "invisible";

    Group of exclusion on 'form::ready '.

    This.Border.Presence = "invisible";

    This.Border.Edge.Presence = "invisible";

    This.Border.Fill.Presence = "invisible";

    this.borderColor.fillColor = "invisible";

    this.borderColor.presence = "invisible";

    this.fillColor.presence = "invisible";

    Group of exclusion on 'layout::ready '.

    This.Border.Presence = "invisible";

    This.Border.Edge.Presence = "invisible";

    This.Border.Fill.Presence = "invisible";

    this.borderColor.fillColor = "invisible";

    this.borderColor.presence = "invisible";

    this.fillColor.presence = "invisible";

    None of them work. Is there honestly no way to control the border color / visibility of a required element? I can do him point together disappear pretty easy but that solves nothing. If the default value is not an option that the customer wants to ensure that all fields have been reviewed by the "clicked".

    Thanks for your time.

    Hello

    LC Designer ES2 has improved handling for Forms validation. It does not require the user to have version 9 of Acrobat/Reader.

    So, for these features, you must upgrade to LC Designer ES2 and you need be happy that your users would have version 9 of Acrobat/Reader.

    If this isn't the case, then you can enable and disable highlighting. However, this applies to all fields. Also you can change the color of the highlighted field using script, you can change the color of the Red manditory border. See: http://assure.ly/ * 6tn.

    John Brinkman has several examples of custom/scripted validation models, with samples:

    http://blogs.Adobe.com/formfeed/2008/11/validation_patterns_part_1.html

    http://blogs.Adobe.com/formfeed/2008/11/validation_patterns_part_2.html

    http://blogs.Adobe.com/formfeed/2008/11/validation_patterns_part_3.html

    Hope that helps,

    Niall

  • Border color and background

    Hello

    is there a way to remove the border and the background color of an image?

    I know the funtion srw.set_background_fill_color (color) that changes the background color, but how do I remove it? Is there a value corresponding to a color "without color"?

    Also, I know that the function srw.set_background_border_color (color) that changes the color of the border, but it does not work. In help, there is the following note: "this procedure does not apply to Windows platforms because they do not support a border model. As a result, the foreground of border color is the only visible under Windows. »
    I saw the function srw.set_border_width (width) in aid, indicating 'Zero indicates no border', but it seems that this does not work with 0.
    How can I change the color of the border or remove it?

    Thank you very much

    Jordi

    It might be easier to use two frames with different color or no color and display a dynamically at run time.

  • ADF: Line of Table border color

    Is it possible to make a different border for a table row color using ADF?
    Ideally, I want to make the lower border of the line 1 and line 2 in red top border to indicate an action of treatment.

    Hello

    How do you find if the data in the row 1 / 2 is under treatment? Any column value (something like status)? If so, you can set the line style / content of the red line style by comparing the value of the column using EL.

    Check out this thread
    Re: color of lines in

    He gives the example on how to set different color line if the line is new. You can change the logic to adapt to your needs.

    Arun-

  • (1) the background & menu bar tabs / unused replaced by same blue color, making navigation difficult. Help to change it back?

    XP with SP3 and updates.

    Installed newest Firefox update 29 & have 2 new problems.
    

    (1) the background & menu bar tabs / unused replaced by same blue color, making navigation difficult. Any help on how to change their return?
    (2) Firefox now runs incredibly slow.
    ddbob

    Hi supmozilla, if you are interested in making the background more visible tabs, you can view these custom style rules that I posted:

Maybe you are looking for

  • Upgrade all access CBS

    Hello does anyone know how to upgrade the All Access CBS on Apple TV subscription (not fourth generation) or iOS CBS access all the app?  I can't find it anywhere!  Help!

  • How to copy Contact addresses in the address book of TB in Win7?

    In Win7 have addresses in the Contacts under the USER folder. How to copy all the Thunderbird addresses at once. Currently you can not move at the same time. Pls info. Thank you.

  • Shut down the computer.

    Just installed fan UPC and upgrade memory to 4 GB.  Started using computer and it ran fine for about 5 minutes.  Then he comes to close.  It has no power.  Is that what I am able to fix or should I get fix?  It is a Compaq Presario, of SR5601P.  Than

  • OfficeJet 4630 insufficient for a pdf image

    OfficeJet 4630 When I open a pdf file that was created by the scanner using adf, I get this error, "insufficient for an image" in Adobe Acrobat format.

  • VM does not start from CD/DVD

    Hello I just finished installing Hyper-V on my windows server 2012 and I created my first VM. I try to install the operating system of the CD/DVD drive, but it does not start. It displays "Boot Failure. Restart from a proper boot device... ». I tried