How to get name of color from Color class

Hi there,
I'm just starting my adventure with java and just on the beginning of this trip I found some issue.
How to get something like this:
String getColorName(Color var) { ??? }
String test = getColorName(Color.RED); // test = "red"; or test = "RED";Thank in advance for some constructive ideas

profidancer wrote:
dcminter, would You say it in other words, because I'm not following You.
Do You mean by that to create class like below with some connection inside ??
public class ColorMap {
     private String name;
     private Color color;
public String toString() {
     return name;
I suppose that's one way to do it. Or you could just use the [Map |http://java.sun.com/docs/books/tutorial/collections/interfaces/map.html] interface.
Another option is to simply make the JButton the color it represents, instead of displaying some String with a color name. That way you could support any color pretty easily.

Similar Messages

  • How to get name of table from front end

    Hi,
    How to get name of table from front end in EBS 11i?
    thanx
    Ashish

    Hi
    Sandeep is correct. The "Help"/"Record History" will give you the table/view name, but sometimes this particular menu function give me a "Record History is not available here." error message.
    I then use the following menu functions (this will also give you additional information, like column details).
    1) Open Forms
    2) Click on Help/Diagnostics/Examine (*you might have to enter the APPS password at this point)
    3) Change "Block" to "System"
    4) Change "Field" to "Last_query"
    The system will populate the "Value" field with the query that was executed in order to populate the form.
    Regards
    Frank

  • How to get name of person from user id

    Gurus,
    I am working on an extractor based on FM and in one of the tables we have the user information saved in the form of SAP ID. What is the best way to get the name of the person from the user id either in the ECC or on the BW side? Thanks.
    Thanks
    AK

    Please create an infoobject (ZUSERID )with text. Create a generic extractor based on table USR01( as mentioned by Durgesh ) to populate the text for this infoobject.
    Use this ZUSERID infoobject in your transaction data and display this as text in your report.
    Thanks,
    Krishnan

  • How to get a int value from another class method?

    Hi,
    how can I get a value of another class method variable value.
    example,
    class elist
            int a;
         ArrayList<Event> eventArray;
         void addEvent(Event e);
         Event getEvent(int index);
         void removeEvent(int index);
         void orderEventByTime();
    interface Event
         void Command();
    class servo implements Event
         String ip;
         int time = 10;
         void Command();
    class servo_2 implements Event
         String ip;
         int time = 20;
         void Command();
    [\code]
    I want to get the time value in elist variable a; 
    and want to compare each class time?.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi,
    1) this foum provides means to format/tag code, no need to manually add -tags
    2) by default, classname start with a capital letter, method names with a lower case letter
    3) where do you want to get the time value to Elist.a? During addEvent()?
    4) what do you want to do with the time value of each event? Sum all values up to make a an overall sum?
    5) where do you want to compare the time value(s)?
    To put it in one sentence: please be more specific with your description and answer.
    Bye.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How do I remove extra profiles from color mangement in Print Module?

    How do I remove extra profiles from color mangement in Print Module?

    If you're talking about the "short list" then click on other and then uncheck the ones that you don't want displayed. If you're talking about the long list, then you will have to browse to the folder containing the profiles and then delete them manually.

  • How to get all the values from the dropdown menu

    How to get all the values from the dropdown menu
    I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
    How do I get number of item is selection dropdown?
    How do I extract a ?name? for each value, one by one?
    How do I change a selection by referring to particular index of the item in a dropdown menu?
    Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
    RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
    Message was edited by: testtest

    The findElement method allows various attributes to be used to search. Take the following two examples for the element below:
    <Select Name=ProdType ID=testProd>
    </Select>
    I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
    Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
    If I want to search by id I could do the following:
    Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
    Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
    You can use the FindElement to grab links, text boxes, etc.
    The next example grabs from a link on a page
    Home
    Set x = RSWApp.om.FindElement("Home","A","innerText")
    I hope this helps clear it up.

  • How to get auto proxy configuration from plugin?

    I need to retrieve the name of the client's proxy server to pass it along to my signed applet (because it doesn't seem to be getting the information automatically despite the fact that the java plugin is set to the use the browser settings for proxies).
    The Java Plugin loads the proxy server information based on the browser preferences, but I haven't figured out how to retrieve that proxy information from the Plugin itself. Sometimes the javaplugin.proxy.auto.url system property is null, even if the browser (MSIE) is configured to use an auto-configuration script/url for the proxy server configuration. I can see in the Java Console that the plugin knows the auto-config url, so how can I access that property from within my applet?
    Even if javaplugin.proxy.auto.url is not null, I don't know how to call the javascript function at that URL from within the applet to get the proxy server host name and port.
    Does anyone know how to get the proxy information from the plugin?

    Thank you! Indeed, the answer was there, but I hadn't been able to find it earlier (I guess I was searching on the wrong forums). For those who might be interested, here's the thread that helped:
    http://forum.java.sun.com/thread.jsp?forum=30&thread=281981

  • How to get day of week from NSDate?

    How to get day of week from NSDate?

    Here's a way to get the name of the weekday as an NSString if you've already got an NSDate...
    NSDate * testDate = [NSDate date];
    NSString * weekdayString = [testDate descriptionWithCalendarFormat:@"%A" timeZone:nil
    locale:[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]];
    NSLog(@"Day of the week: %@", weekdayString);
    The output is something like:
    Day of the week: Monday
    You can use a lower-case "%a" as the descriptionWithCalendarFormat if you just want the three character weekday abbreviation ("Mon", "Tue", "Wed", etc).
    Steve

  • How to get names of sub tabs?

    Hi All,
    Could someone tell me how to get names of all sub tabs?
    I have Parent Tab T1. T1 has 3 sub tabs T1_1, T1_2 and T1_3.
    I would like to have T1_1, T1_2 and T1_3 sub tab names in the list.
    Thanks in advance!!
    Dip

    Dip,
    You can get the tab names from apex dictionary views, apex_application_tabs & apex_application_parent_tabs . Thanks.
    Regards,
    Manish

  • How can get 40,000 pix from old computer restored by Carbonite to new computer into PE 11 or 12?

    I bought a new,  faster, more storage Windows 8 computer.
    I had 40,000 pix on old computer tagged with names, event, location, date with PE 11. Also several projects involving hundreds of pix.
    Carbonite restored all files (250 gig) from old computer to new, and their tech support says they all are on the new computer.
    I bought the new PE 12 and installed it on new computer.  It has only found 4,000 pix.  I don't at all like PE 12 after enjoying PE2-11 and managing all my  pix with it.  PE11 was clearer in the pix presentation.
    Apparently when imported to the new computer, I lost the tags that went to events, location, and the person tags did not  separate family from friends etc.  I can't even find my projects.
    I was so frustrated with PE12, that I installed PE11, but everytime I try to open the Organizer, it doesn't open.
    Help.  I am so frustrated.  I am pretty sure  before I made the transition that I had written all tags to files.  When I put PE11 on the new computer, why won't it give me what I had on the old.
    This is probably my 10th generation computer change, and I never had such problems before with PE.

    I am using 10 and 11 instead of 11 and  12.  I tried to go back and edit,
    but couldn't figure out how.  Sorry,  typing errorC.
    In a message dated 2/6/2013 7:02:33 P.M. Eastern Standard Time, 
    [email protected] writes:
    Re:  How can get 40,000 pix from old computer restored by Carbonite to new 
    computer into PE 11 or 12?
    created by Jeff A Wright (http://forums.adobe.com/people/JeffAWright) 
    in  Photoshop Elements - View the full  discussion
    (http://forums.adobe.com/message/5050443#5050443)

  • How to get the return values from a web page

    Hi all :
       how to get the return values from a web page ?  I mean how pass values betwen webflow and web page ?
    thank you very much
    Edited by: jingying Sony on Apr 15, 2010 6:15 AM
    Edited by: jingying Sony on Apr 15, 2010 6:18 AM

    Hi,
    What kind of web page do you have? Do you have possibility to for example make RFCs? Then you could trigger events (with parameters that could "return" the values) and the workflow could react to those events. For example your task can have terminating events.
    Regards,
    Karri

  • How to get warranty service claim from nokia c5-03...

    how to get warranty service claim from nokia c5-03 in india because i have problem with nokia c5-03 I Purchase 2 week ago a new nokia c5-03 but from day 1 i facing same problem like 1) app close itself 2) internet browse close if any thing is downloading or downloading over 3) memory full always then i should reboot the phone then it work. 4) ovi map is open it shows memory full close the app So kindly help me how to get warranty service claim from nokia c5-03 in india i am unhappy with nokia c5-03
    Solved!
    Go to Solution.

    i updated software also but the same problem cont... I want to know that nokia will give back money or exchange for other new mobile

  • For some reason the system is telling me my birth date is wrong when it's not and it won't let me proceed to reset my password. Can someone tell me how to get a "real" person from tech on line?

    For some reason the system is telling me my birth date is wrong when it's not and it won't let me proceed to reset my password. Can someone tell me how to get a "real" person from tech on line?

    contact itunes support

  • How to get the current week from sysdate?

    Hi sir,
    i want to know how to get the current week from sysdate?
    thanks

    Hi Nicolas
    It seems you like to check my post and also make commend ;) thanks for your attention
    Have you ever read the posts above and given solutions ?Yes, I did
    Have you read the docs ? Yes, I checked
    What's the added value here ?Did youYou shared doc with solution(long one), I shared short one which point same solution(Check what Joel posted)..So what is benefit, As you can guess oracle docs are sometimes become so complicated as specialy for beginner...(At least it was like that for me and Belive me somedocs are still sooo complicated even for oracle coworkers ) But for you I dont know ;)
    => Why writting the PS in bold ?Why.. Let me think... Ohh Maybe I am looking some questions(many) and even user get answer they should not changed status so I am reading some posts and try to get problem and loosing time..
    So I am putting that PS wiht BOLD because I dont wanna lose time my friend ;) Because While I am trying to help ppl here In same time I am trying to giving support to my customer prod systems. Which mean time is very important for me...
    Hope my answer could satisfy you..
    One important PS for you.. You may not like my posts (or someone) but my friend I become tired to read&answer and make commend to on your comment which is about my posts.
    I am not newbie in forum(At least I fell like that) and I belive I know how I should make post..
    Thank you
    Regards
    Helios

  • How to get the selection parameters from logical database into one of the t

    Hi Sap ABAP Champians,
    How to get the selection parameters from logical database into one of the tab in the tabstrip selection-screen.
    Please help me for this
    Thanks
    Basu

    Hi
    Thanks, that will work, but then I'll have to insert code into all my reports.
    I can see that "Application Server Control Console" is able to rerun a report.
    This must mean that the Report Server has access to the runtime parameters.
    But how?
    Cheers
    Nils Peter

  • How to get payment document number from paid column in monthly invoice

    Dear experts
    I use SBO japan version and i need to know how to get payment document number from paid column in monthly invoice ?
    in table MIN1, only contain invoice and credit note document number, there is no payment document number
    thank you for your help
    Best Regards
    JeiMing

    Dear Gordon
    Yeah, you are right, i can use field MIentry in RCT2
    thank you
    Best regards
    jeiming

Maybe you are looking for

  • How can I change my email address on my Itunes account if the old email address has been closed down?

    Hi, my brother is struggling to log in to his itunes account. He has been using an old email address but not actually logged into his email account for quite a while. All of a sudden he hasn't been able to sign in to itunes. He has been trying to cha

  • Horizons are missing in product view

    Hi Frns, In my product view of a KMAT material, the SNP Horizon & PP/DS Horizon lines are missing !! What could be the reason ?? I have maintained the horizons in the product master (SNP2 & PP/DS tabs) Still the horizon lines are not visible in produ

  • Referencing WCF (Windows Communication Foundation) web services

    I am having some issues referencing a WCF based web service. Apex can consume the WSDL just fine, but when I attempt to use any of the methods I start running into errors. For example, there is a simple method that accepts a username and returns a fa

  • Saving data for a custom assignment block

    Hi All, I have created a custom assignment block where data is coming from custom table successfully. Now when I am modifying data from that block, MODIFY method of my custom implementation class is getting triggered. Till that point, I can get the m

  • Maintenance Plan Problem

    We have an issue whereby the folks in Engineering are saying that the inspection items are not being  flagged up as due. This appears to be the case when there are two or more items assigned to one inspection plan but each item item has a different d