Use different 'fx-border-image-source"to the first tab and remaining tabs

Hello

I'm using something like this
. Tab {}
-fx-padding: 0px 5px - 2px 5px;
0 0 0;
-fx-background-color: transparent;
-fx-text-fill: #c4d8de;
-fx-border-image-source: url("images/tab5.png");
-fx-border-image-slice: 20 20 20 20 fill;
-fx-border-image-width: 20 20 20 20;
-fx-border-image-repeat: stretch;
-fx-font-size: 22px;
}
. Tab: selected {}
-fx-border-image-source: url("images/tab-selected5.png");
-fx-text-fill: #333333;
/*
-fx-background-color: red; * /
}

to customize the appearance of the tab of a TabPane.

That has worked well. But I need to use a different set of images for just the first tab. Does anyone know how?

Thank you.

After you add the tab to a scene pane active, searching the first tab of the scene, it is id the first-tab value and style of the first tab via css.

import javafx.application.Application;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.*;

public class ThumbTabPane extends Application {
  public static void main(String[] args) { launch(args); }
  @Override public void start(Stage stage) {
    // create some tabs.
    TabPane tabPane = new TabPane();
    Tab tab1 = new Tab("Sites"); tab1.setContent(new Rectangle(400, 200, Color.LIGHTGREEN));
    Tab tab2 = new Tab("Favorites"); tab2.setContent(new Rectangle(400, 200, Color.LIGHTSTEELBLUE));
    Tab tab3 = new Tab("Loves"); tab3.setContent(new Rectangle(400, 200, Color.PINK));
    tabPane.getTabs().addAll(tab1, tab2, tab3);
    tabPane.setMaxSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE);

    // layout the stage.
    StackPane layout = new StackPane();
    layout.getChildren().add(tabPane);
    layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10;");
    Scene scene = new Scene(layout);
    scene.getStylesheets().add(ThumbTabPane.class.getResource("stylishtabs.css").toExternalForm());
    stage.setScene(scene);
    stage.show();

    Node node = scene.getRoot().lookup(".tab");
    node.setId("first-tab");
  }
}
// file stylishtabs.css
.tab {
  -fx-border-image-source: url("http://th33.photobucket.com/albums/d73/siewsammuk/th_icon_cool.gif");
  -fx-border-image-slice: 20 20 20 20 fill;
  -fx-border-image-width: 20 20 20 20;
  -fx-border-image-repeat: stretch;
}
.tab:selected { -fx-border-image-source: url("http://www.panic.com/blog/wp-content/themes/panic/images/icon_smile.png"); }  

#first-tab.tab { -fx-border-image-source: url("http://roi.ltcdn.com/roidsn/en/main/icon_6.jpg"); }
#first-tab.tab:selected { -fx-border-image-source: url("http://pensacolatodo.com/icon_images/icon_wordpress.gif"); }

Tags: Java

Similar Questions

  • to convert a string - higher capitalized the first letter and remaining at lower ceilings

    Hello

    I have a query that returns a list of cities in a table... some of the cities are in low caps and some at the top and others in the combination of upper and lower case...

    is there a way to display the output in a format that the first letter must be in the senior caps and the rest down... for example

    Toronto
    Chicago
    Cairo
    Paris
    Los Vegas

    Thanks in advance

    Hello

    qwe12654 wrote:
    Hello

    I have a query that returns a list of cities in a table... some of the cities are in low caps and some at the top and others in the combination of upper and lower case...

    is there a way to display the output in a format that the first letter must be in the senior caps and the rest down... for example

    Yes: INITCAP.

    CREATE TABLE     table_x          AS
    SELECT 'Toronto' AS raw_txt     FROM dual     UNION ALL
    SELECT 'chicago'          FROM dual     UNION ALL
    SELECT 'CAIRO'               FROM dual     UNION ALL
    SELECT 'pArIs'               FROM dual     UNION ALL
    SELECT     'lAS vegAS'          FROM dual;
    
    SELECT     raw_txt
    ,     INITCAP (raw_txt)     AS initcap_txt
    FROM     table_x
    ;
    

    Output:

    RAW_TXT   INITCAP_T
    --------- ---------
    Toronto   Toronto
    chicago   Chicago
    CAIRO     Cairo
    pArIs     Paris
    lAS vegAS Las Vegas
    
  • How to check the image source for the image which is losted?

    Hello world

    How to check the image source for the image which is losted?

    If the image source already exists, I can read the PlaceItem.file.fsName.

    But if remove the image of the source, read the PlaceItem.file.fsName will report the error: there is no file associated with this element

    Thank you

    If (app.documents.length > 0) {}

    var sourceDoc = app.activeDocument;

    sourceName = sourceDoc.name var;

    artItem =]

    for (i = 0; i < sourceDoc.pageItems.length; i ++) {}

    artItem [i] = sourceDoc.pageItems [i];

    If (.) TypeName artItem [i] == 'PlacedItem') {}

    If (.imageColorSpace [i] artItem == undefined) {}

    Alert ("the file is the link, but I don't know whether or not the source image is losted");

    }

    }

    }

    }

    Use try/catch to catch the error

    if (app.documents.length > 0) {
        var sourceDoc = app.activeDocument;
        var sourceName = sourceDoc.name;
        artItem = []
        for (i = 0; i < sourceDoc.pageItems.length; i++) {
            artItem[i] = sourceDoc.pageItems[i];
            if (artItem[i].typename == 'PlacedItem') {
                if (artItem[i].imageColorSpace == undefined) {
                    try {
                        var fname = artItem[i].file.name;
                        alert("file name: " + fname);
                    }
                    catch (e) {
                        alert("The file is linking ,but source image is lost");
                    }
                }
            }
        }
    }
    
  • Resize the image sources - change the size of the images database

    Hi all

    I have a trivial problem, but I can't deal with it. I have a project with compositions called slides. Each slide have JPG image as layer and this image is assigned 100% to 106% Resize effect (two keyframes). The images have their own folder. I need to replace all the images but the problem is that the new images have different sizes, for the most part, they are bigger than originals. When I right-click the imported images directly on I don't see any options to change their size (single space reserved or solid). When I double click them to open it in a new tab I don't see no resizing tool and layer menu is grayed out for the most part.

    So far, I found that I have three possibilities:

    1. resize as a layer in the composition of each slider. Unfortuately I don't see any way to change the database size, so resize here means add another keyframe or change existing. If I change the first keyframe on the layer in the composition of the slide then I have to proportionally resize the last of them. There are about 20 slides this process would be quite painful

    2. resize the images before importing - with PSP, GIMP or same IrfanView. It would be a much better solution than before however, this means a blind resizing - without no preview as the composition. Whenever I want to change the size a bit, I have to import image again. Painful.

    3 convert the images to the compositions,

    Convert each JPG file in composition, put this composition as the layer to each composition drag next to layer JPG, transformation of copy of layer of JPG to the composition of the image layer and delete the JPG layer. Long process but the effect is exaclty as I want and the project is fairly durable for any other modification of the image. However, in larger projects where there are many effects assigned to layers, it would be very painful.

    So is there an easy way to change the sizes of the imported images database? I can't believe that in such a huge program like After Effects, there is no way for such a simple task. I believe firmly im just something missing.

    You can resize your layers in Ae with scale parameter. (transform-> scale). If there is no animation, you need not place a keyframe. for example, you can resize your layer to 46% and decide to evolve for a while, so the first keyframe will be 46%, and the last keyframe is 83%.

    Yes, I know that if you have layer with no keyframes for the scale property then scaling ways to change the size of its base. However, in my example, I have two frames - 100% and 106%. If I import large image so I have to resize. If im on the first keyframe, and then it wil change its size to 100% for example, 56%. But the last keyframe is not changed - its still 106%. So that means animation past from 56% to 106% - image develops much more quickly than in an original animation.

    But now I found that I can select all the points of the keyframe by clicking on the entire property scale and resize proportionally when I resize the image, all the points of the keyframe. It's the simplest and most effective solution for me!

    Thanks for the help!

  • I try to add an image map for the first time using Dreamweaver CC

    I am trying to add an image map for the first time using Dreamweaver CC in an html site.

    I can get map controls is displayed when I select the image in the code, and I can select the rectangle tool.

    However, when I try to select the area of the image disappears from the section of the map of the properties viewer and I can't select the area for my hyperlink.

    What I am I missing videos online are it seems so simple, but something with my page is not allowing me to withdraw this.

    This is the code section and the image that I'm trying to add the link.

    < side class = "sidebar" >

    < img src = "images/flowchart.jpg" alt ="product dev. Flowchart">

    < / side >

    Please help or give me any advice... There might be something to do with the fact that my site is "sensitive"?

    Hello

    You could just add links to each box, but a better solution would be to use svg for this. Unfortunately, it is easier for me to write for someone who does not know svg to do.

    If you have Adobe Illustrator create your svg using this program, then it would be a case to add links manually to each box created in the svg code. SVG is an xml-based language and not a real image, even if this is how a browser will display the it.

    PZ

  • Anyone know if you can use FTP, when you save, just save the selected file and not all images and cs

    Someone knows If you can use FTP, When you save , just Save the selected file and not all the images et CSS includes ...

    What?  Can you please rephrase your question in order to understand what you're asking?

    If you ask how a file on the remote site via FTP without FTPing any dependent files?  That the answer is Yes, you can do this by changing the SITE > dependent files: option in the PREFERENCES to enable the option "prompt on put/check-in."  The next time you download a file, you will be asked if you want to also download dependent files.  If you say NO and check the don't ask again option, then you will always simply load the file and not the dependents. You can change it back at any time by changing the preferences of this setting.

  • Different presentation between the first page and following pages within a section

    Hello

    I met a requirement as follows:

    The report prints some information to order. Each command is a section, including the header and the lines. For a section, there may be several pages (if the number of lines is good enough). It is necessary that, on the first page of each section, it prints all order information in the header of the report and for the next page, it displays only the sequence number in the header of the report.

    It seems necessary different presentation between the first page and the following pages. Has anyone required even like that? Any advice will be useful.

    Thank you
    Clark

    Do you use a for-each@section to get the different sections?

    In this case use "Different first Page" in the "Page layout".

    Published by: amri on July 13, 2010 15:34

  • My portfolio is currently configured to allow access when locked. I used to be able to double-click the home button and seems my card and I would enter my access code. I have updated to IOS 10 and I am no longer able to do this.

    My portfolio is currently configured to allow access when locked. I used to be able to double-click the home button and seems my card and I would enter my access code. I have updated to IOS 10 and I am no longer able to do this. All the settings are there. I have an IPhone 6.

    Are? you double click in front of the screen of the iPhone are? (pending). This is what seems to work for me.

    I hope this can help.

  • How can I disable the newtab most used feature display sites. I want the new tab to open the page displayed in the newtab:url in the topic: function config

    How can I disable the newtab most used feature display sites. I want the new tab to open the page displayed in the newtab:url in the topic: function config

    41 of Firefox is no longer uses the browser.newtab.url setting in about: config because he was constantly attacked by malware. From 41 of Firefox, you need an add-on to change the new tab page.

    Here are a few options (I'm learning more all the time):

    • If you are already using the extension classic restaurateur theme: There is an option somewhere (!) in his dialogues of the parameters to select another page in the new tab.

    Setting up substitute again tab

    After installing this extension, you must use the Options page to set the new desired tab page (instead of use subject: config).

    Open the page modules using either:

    • CTRL + SHIFT + a (Mac: Cmd + shift + a)
    • "3-bar" menu button (or tools) > Add-ons

    In the left column, click Extensions. Then on the side right, find the new tab override and click the Options button. (See first screenshot attached).

    Depending on the size of your screen, you may need to scroll down to enter the address in the form. (See second screenshot attached). For example:

    • (Default) page thumbnails = > subject: newtab
    • Blank tab = > subject: empty
    • Built-in Firefox homepage = > topic: welcome
    • Any other page = > full URL of the page

    Then tab or click this form field and you can test using Ctrl + t.

    Success?

    Once you have set it as you wish, you can close the Add-ons page (or use the back button to return to the list of Extensions of this Options page).

  • By pressing the ENTER key in the first tab-&gt; a button in a different tab is pressed?

    Hi guys,.

    I am facing a problem. I have a tab with 4 different tabs. When I'm in the first tab and try to change the value of a control by pressing the Enter key, it suddenly switches to the second tab and presses a button here.

    No idea how it goes? I want to avoid that from happening.

    Thank you

    Check your tab order and control is enabled is a shortcut bound to it.

  • Is it possible to update the first pro and still be able to use the projects of the old version

    Is it possible to update the first pro and still be able to use the projects of the old version

    You can open projects from versions with Premiere Pro, Yes. But I agree with Bob - make a copy of the project and open the copy. You won't be "up the Creek" if something goes wrong.

  • Hello, a few months ago, I joined a CC + adobe stock subscription. I downloaded my first 10 images of the first month and paid the other. The problem is that since the second month, I have not my 10 free photos more... why? Thanks to you all

    Hello, a few months ago, I joined a CC + adobe stock subscription. I downloaded my first 10 images of the first month and paid the other. The problem is that since the second month, I have not my 10 free photos more... why? Thanks to you all

    Hello

    Sorry - I've added the image apply to your account.

    Kind regards

    Bev

  • I work for an organization not-for-profit, and I wondered what might be a plan of this organization to use? Really looking for us in the first but are interested in the complete set of CC.

    I work for an organization not-for-profit, and I wondered what might be a plan of this organization to use? Really looking for us in the first but are interested in the complete set of CC.

    Please see this link

    Non profits

    If your institution not-for-profit or charity meets the conditions above, you can browse the education of Adobe software versions. Once you are ready to buy, you will be asked to present evidence or your qualification status when ordering.

  • When I have a pdf file open, I used to be able to click on the "Bookmarks" tab on the left side and allow me to click on every page and delete if I had to.  Now when I click on the Bookmarks tab, this section is empty.  How can I show him each

    When I have a pdf file open, I used to be able to click on the "Bookmarks" tab on the left side and allow me to click on every page and delete if I had to.  Now when I click on the Bookmarks tab, this section is empty.  How can I show him each page once again?

    Hi chrismarks1,

    I think you can be confused bookmarks with thumbnails. If you click on the miniatures Page icon (the one above the bookmarks icon), you can delete a page by clicking on its thumbnail, clicking the delete page (icon of the Recycle Bin). Just make sure that you see the PDF file in Acrobat (rather than Acrobat Reader), you cannot remove the drive pages.

    Best,

    Sara

  • Different footer on the first page and last page

    Hello
    I try to display continue on the first page and average pages and Total amount on the last page on a multipage PO. I can view the page of different footer for the first page and last page, but the pages means is not a footer. What to do if possible. There are so many threads here, but not one gives exact measurements.


    first page header footer

    Add a Page break
    2nd foot header

    Add the Section break = > Next Page
    <? start@last-page-first:body? > <? end body? >
    last page footer


    Help, please

    Thank you

    Did you miss this?

    http://winrichman.blogspot.com/search/label/different%20page%20header
    http://winrichman.blogspot.com/search/label/element%20in%20header
    http://winrichman.blogspot.com/search/label/diff%20header

Maybe you are looking for