How to get the color and stroke of ComboBox

I would get the selected color and stroke selected ComboBoxes to print these values as strings in an .ini file to save the settings.

Here is my example http://s24.postimg.org/q59kivgxh/Z055.png where I have a scene with ComboBoxes.List

The list of colors is an ObservableList in the classroom

public class ComboBoxColorCellFactory {
  
 public static  ObservableList<String> colorList = FXCollections.observableArrayList(
         
"White", "WhiteSmoke", "GhostWhite", "Ivory", "MintCream", "Beige", "Transparent", "Seashell", "Snow", "Honeydew", "FloralWhite", "Cornsilk", "BlancheDalmond","Wheat", "AntiqueWhite", "NavajoWhite"); 

and the list of race

public class ComboBoxLineCellFactory {
    
   public static ObservableList<String> linesList = FXCollections.observableArrayList(
     "-fx-stroke-dash-array: 1;", "-fx-stroke-dash-array: 12 2 4 2;", "-fx-stroke-dash-array: 2 2;", 
     "-fx-stroke-dash-array: 15 5.0 15 5.0;", "-fx-stroke-dash-array: 0.8 8.0;", "-fx-stroke-dash-array: 3 3;", "-fx-stroke-dash-array: 6 3;");

In my previous version of swing, I used to get these values in this way (PriceRetracementIni is the class with the statements of private fields and define and use the get methods).

PriceRetracementIni.setColor1(Integer.toString(((Color)jComboBoxColor1.getSelectedItem()).getRed())+ "|" + Integer.toString(((Color)jComboBoxColor1.getSelectedItem()).getGreen())+ "|" + Integer.toString(((Color)jComboBoxColor1.getSelectedItem()).getBlue()));

PriceRetracementIni.setStyle1(ComboLineTypeConstants.getStrokeArray((BasicStroke)jComboBoxStyle1.getSelectedItem()));

PriceRetracementIni.setFontStyle(jComboBoxFontStyle.getSelectedItem().toString());

How do I make FX 2, assuming that I have comboboxColor, comboboxStyle and comboboxFont?

Thank you.

Post edited by: acepsut missed some info about the color and stroke list

comboBox.getSelectionModel () .getSelectedItem)

See the Javadocs for ComboBox and SelectionModel

Tags: Java

Similar Questions

  • How to get the color of the text information in the text layer?

    How to get the color of the text information in the text layer?  I mean using scripts Photoshop, Version of Photoshop CS 8.0

    The color textItem is readable for me in VBS Note expects the activeLayer be a textLayer and displays the HexValue of the color of the text.

    Option Explicit
    
    Dim appRef
    Dim docRef
    Dim textItemRef
    Dim artLayerRef
    Dim textColor
    
    Set appRef = CreateObject( "Photoshop.Application" )
    
    appRef.BringToFront
    
    Set docRef = appRef.ActiveDocument
    Set artLayerRef = docRef.ActiveLayer
    Set textItemRef = artLayerRef.TextItem
    Set textColor = textItemRef.Color
    
    MsgBox textColor.RGB.HexValue
    

    And returns the color of the text if the text is the same color. But if the text is more than a color textItem.color returns only the color of the first text range.

  • How to get the second and third weekend of every month over a period of time?

    Hello

    No idea how to get the second and third weekend of every month on a given period without use of CLAUSE?

    Thanks in advance.

    Try it below,

    SELECT CASE WHEN TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'SAT '.

    THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 1

    WHERE TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'Sun '.

    THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 6

    Of OTHER NEXT_DAY (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), "SAT") + 1

    END as second_weekendday,

    BOX WHEN TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'SAT '.

    THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 7

    WHERE TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'Sun '.

    THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 7

    Of OTHER NEXT_DAY (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), "SAT") + 7

    END AS third_weekendday

    FROM (SELECT SYSDATE startdate,

    SYSDATE + 300 enddate

    THE DOUBLE)

    CONNECT BY LEVEL<=>

  • How to get the width and height of Flex Mobile view?

    Hello

    The following instructions can get the width and height of the current Flex app:

    var request: UIComponent = FlexGlobals.topLevelApplication as UIComponent;

    trace (application. Width);

    trace (application. Height);

    But I don't know how to get the width and height of mobile display Flex current (i.e. the content size excludes bar action and the Navigation bar). Why the "this.width" always returns 0?

    Thank you!

    Looks like you're running in this bug: https://bugs.adobe.com/jira/browse/SDK-30070

  • How to get the scanning and fax utilities works from 2840 printer. Print function works from pc

    I changed my google chrome browser and I finally got my confiquered pc and printer. He is an all-in-one 2840 color laser jet. How do I get the scan and fax utilities to perform?

    It is useful to include the manufacturer and model number.

    What version of Windows you have, including the service pack?

    How the device is connected to your computer (USB, Ethernet, other)?

    Have you installed the software that came with your HP Color LaserJet 2840 AiO printer?

    If not, why?  If you did, what error messages you are seeing?  Please report messages completely, without paraphrasing.

    Start here: HP Color LaserJet 2820 and 2840 AiO products Series - first installation and install

  • How to get the phone and messages back in my dock apps? And for some reason, I discover now all my app pages from the middle of my phone and not at the top?

    How can I get the phone and messages apps in my dock? And for some reason, I discover now all my app pages from the middle of my phone and not at the top?

    Try

    Settings > general > reset > reset home screen presentation.

    Note: All other applications will be organised by alphabetical order.

  • How to get the color of a single pixel?

    Hi all.

    Part of my application is transparent. The other party is not.

    But I would like to have 'match' colors (is not very pretty orange to pink, but it's a matter of personal taste, I guess).

    That's why I need now to a background color.

    That's what I had in mind:

    Because we cannot get information about the currently active theme, I can do a screen capture and extract a single pixel of interest and get its color information. If it is green (for example) - I'll tryto use more Brown colors in my application.

    So basically, is it possible to get the color of a pixel in a bitmap (or something?)

    My last resort would be to save the Bitmap image to a file and then read that file.

    Bitmap.getARGB (int [] argbData, int offset, int scanLength, int x, int y, int width, int height)
    Gets the raw data ARGB region of this Bitmap and stores it in the table provided.

  • How to get the number and the name of the contacts selector

    Hi all

    I got the Contact Picker work but I have no idea how to get the selected telephone number and the name.

    There are attributes that I can put like contactId.value () to retrieve or there is another way?

    Thanks in advance.

    ImageButton{
                        defaultImageSource: "asset:///images/bluebutton.png"
                        onClicked: {
                            contactPicker.open();
                        }
                        attachedObjects: [
                            ContactPicker {
                                id: contactPicker
                                onContactSelected: {
                                    result.text = "You chose contact: " + contactId;
                                }
                            }
                        ]
    
                    }
    
                    Label {
                        id: result
                        text: "You chose contact: "
                    }
    

    Hello

    You can get the contact name and phone number as this,

    ImageButton{
                        defaultImageSource: "asset:///images/bluebutton.png"
                        onClicked: {
                            contactPicker.open();
                        }
                        attachedObjects: [
                            ContactPicker {
                                id: contactPicker
                                onContactSelected: {
                                    result.text = "You chose contact: " + contactId;
    // call a cpp method to get the details
    
    app.getDetails(contactId); } } ] } Label { id: result text: "You chose contact: " }
    

    the CPP code:

    void ContactDetails(ContactId id)
    {
    Contact contact_info = m_contactService->contactDetails(id);
    
        QString firstName = contact_info.firstName();
        QString lastname = contact_info.lastName();
            QList phoneno_list = contact_info.phoneNumbers();
    
        QStringList no_s;
    
        foreach(ContactAttribute attr, phoneno_list)
        {
            no_s << attr.value();
        }
    }
    

    You can get details like this.

    Kind regards

    Naresh Kodumuri.

  • How to get the name and number of the procedure parameter list or a function?

    I stated the procedure described in the package

    If I want to get the number and the name of the parameter list, so how do I it

    I don't have I her name with the package.

    create or replace package demoApp is

    PROCEDURE insert_data (p_fname IN VARCHAR2,

    p_lname IN VARCHAR2,

    p_address IN VARCHAR2,

    p_cellno IN VARCHAR2,

    p_email IN varchar2);

    end demoApp;

    create or replace package demoApp body is

    PROCEDURE insert_data (p_fname IN VARCHAR2,

    p_lname IN VARCHAR2,

    p_address IN VARCHAR2,

    p_cellno IN VARCHAR2,

    p_email IN varchar2) IS

    EmpID number;

    BEGIN

    Select nvl (max (emp1.empid), 0) + 1 in EMP1 empid;

    INSERT INTO VALUES EMP1 (empid, p_fname, p_lname, p_address, p_cellno, p_email);

    EXCEPTION

    WHILE OTHERS THEN

    raise_application_error (-20001,' insert the problem ' |) SQLERRM);

    END;

    end demoApp;

    -----------------

    I want to get the name of the parameter and the number of use of stroredrprocedure ""demoApp.insert_data " "

    Select *.

    of all_arguments

    where package_name = 'DEMOAPP.

    and object_name = 'INSERT_DATA.

  • How to get the LOGO and company name in the theme of the 4 apex

    Hello

    I use the theme 4 for apex 4.0.2.
    I must have the logo as well as the name of the company the two, but when I select den Image it shows only the image in the dashboard and when I select den text it shows the name of the company.
    How to get the two logo and the name of the company?

    Thanks for your help.

    Kind regards
    Sébastien Pallav.

    Pushpesh Pallav says:
    Hello

    I use the theme 4 for apex 4.0.2.
    I must have the logo as well as the name of the company the two, but when I select den Image it shows only the image in the dashboard and when I select den text it shows the name of the company.

    The word is spelled 'then', not 'den '.

    How to get the two logo and the name of the company?

    Select the text, and include HTML, making reference to the image in the text:

    
    

    The image src URI used depends on the location of the image, which you have failed to specify.

  • How to get the length and sub lymph nodes.

    Hello

    find the script below.

    < List1 >

    < list >

    < List1 >

    < List1 >

    < List1 >

    < / list >

    < list >

    < List2 >

    < List2 >

    < List2 >

    < / list >

    --

    --

    -

    -

    -

    -< / list1 >

    Here the tag list will be growing based on the I / p. Now what I want is to know how to get the length of the tag < list >.

    To implement the above I used the code below

    var number = xfa.record.List1.List [0].nodes.length; (Does not work)

    But if var account = xfa.record.List1.nodes.length; (work)

    and also I want to delete a tag inside the < List > tag. How?

    Very Urgent.

    Thanks in advance.

    Yes, you need to use the name instead of the value to get the tag name...

    xfa.datsets.data.Root.nodes.item (0) .name

    Thank you

    Srini

  • How to get the public and private keys to use recaptcha?

    I registered with google to get a recaptcha for my Web site. I've gotten has been the key to site and the secret key! If I need to get the public and private key for muse!

    Hello

    Please use the site as a 'public key'key key and Secret as "clΘ privΘe".

    Concerning

    Vivek

  • How to get the speed and the influence of the keyframe?

    Hello world

    I'm sorry if my question is due lack of understanding of script in AE but I can't seem to get the speed and influence the properties of selected or closest to the keyframe, I found that the ways to implement.

    Can someone tell me please in the right direction?

    Thank you!

    property.keyInTemporalEase (key) and property.keyOutTemporalEase (key) will give you the objects made easy with speed and influence the attributes for a particular key.

    Dan

  • Get the color and highlighting of text

    Hello.

    I need to create a tool that highlights text using a specified color, excluding the texts written by another color (this is also be specified).

    Is it possible to program by VBA?

    I have no idea to get the color of the text.

    Can someone give me an advice?

    Best account.
    erieru103

    There is no way to get the color of the text through the methods of the IAC.

  • How to get the .rbf and .through files?

    Hello I am currently working on the project, which provides for automatic deployment and launch programs everchanging.

    Ev3 are scattered in different schools. I wrote a simple script that can download a file and then send it to ev3 via wifi.

    But I'm currently stuck on how to get .rbf and Labview .through files.
    I know that I can deploy .vi using the target to ev3 and then upload these files to the PC, but I can't add script.
    Is it possible to compile .vi to the file?

    Sorry, try this

Maybe you are looking for