How to check if JComponent is JLabel or not??

I would need just a little check if a certain JComponent variable is a JLabel or not.
I know JLabel is a subclass of JComponent but don't have any ideas.
How to do that?
Is there some method like:
JComponent component;
component.isLabel();Thanks for you help!!!!

Provide a sampleok!
     Paint scaleGradient(Paint paint,View view){
          if (view.scale!=100){
               if (GradientPaint.class.isInstance(paint) ){
                    GradientPaint gp = (GradientPaint)paint;
                    Point2D p1 = gp.getPoint1();
                    Point2D p2 = gp.getPoint2();
                    double scale = ((double)view.scale)/100;
                    p1 = new Point2D.Double(p1.getX()*scale,p1.getY()*scale);
                    p2 = new Point2D.Double(p2.getX()*scale,p2.getY()*scale);
                    paint = new GradientPaint(p1, gp.getColor1(), p2, gp.getColor2(), gp.isCyclic());     
               else if (Radial.isRadial(paint))
                    paint = Radial.scale(paint, view.scale);
          return paint;
     }This snippet is from some paint code. Painting a shape, possibly with a gradient fill. If the view scale is not 100%, then the gradient needs scaling. But the Paint might be just a Color, or a GradientPaint, or a RadialGradientPaint. So isInstance( ) is used to find which.

Similar Messages

  • How to check was the object bound or not without exception handling?

    context.lookup("someName");throws NameNotFoundException in case object was not bound to someName.
    How to check was the object bound or not without exception handling?

    context.lookup("someName");throws NameNotFoundException in case object was not bound to someName.
    How to check was the object bound or not without exception handling?

  • How to check a XMLTYPE table for corrupted (not invalid!) XML records ??

    Hello,
    I'd like to get help on the following issue, please. I need to check the XML data in a number of tables with XMLTYPE data type. Some of the data is corrupted but in terms not that the XML format is wrong but there is no XML at all in the fields but just only, for example, control characters (no tags, no anything, just corrupted data).
    So, I have made a PL/SQL procedure cursor to get all the tables from a list, and then another cursor inside to browse each table for corrupted records. But can you help me how to check this? Any of the XML functions like for example: XMLIsValid, isFragment(), getrootelement(), etc. return to me an Oracle error "ORA-31011 XML parsing failed" and the procedure gets stuck on the first found bad record. But I need to continue and check all of them. Is it possible to get the ORA-31011 error with EXCEPTION, write to a logging table the corrupted record ID, and then continue?
    Here is my simple procedure:
    CREATE OR REPLACE PROCEDURE CHECKXML (v_schema in VARCHAR2)
    IS
         v_Message     VARCHAR2(254);
         sql_stmt1     VARCHAR2(1000);
         sql_stmt2     VARCHAR2(1000);
         c1           SYS_REFCURSOR;
         c2           SYS_REFCURSOR;
         cur_tab          varchar2(100);
         cur_appl     varchar2(100);
         cur_rec     varchar2(200);
         valid_flag     number;
         criteria     VARCHAR2(20);
         tab1          VARCHAR2(20);
         tab2          VARCHAR2(20);
    BEGIN
         criteria := 'XMLTYPE';
         sql_stmt1 := 'select id, path from ' || v_schema || '.stubfiles where type=:bcriteria';
         open c1 for sql_stmt1 using criteria;
         loop
         begin
              fetch c1 into cur_tab, cur_appl;
              exit when c1%notfound;
                   insert into system.log_table values (sysdate, v_schema, 'next table', 'id ' || cur_tab, 'appl ' || cur_appl, '');
              sql_stmt2 := 'select t.recid, t.xmlrecord.isFragment() from ' || v_schema || '.' || cur_tab || ' t';
              open c2 for sql_stmt2;
              loop
              begin
              fetch c2 into cur_rec, valid_flag;
                   exit when c2%notfound;
                   insert into system.log_table values (sysdate, v_Schema, 'next record', 'id ' || cur_tab, 'recid ' || cur_rec, 'valid ' || valid_flag);
                   commit;
              EXCEPTION
                   WHEN OTHERS THEN v_Message := sqlerrm;
                   dbms_output.put_line('Error for ' || cur_tab);
                   dbms_output.put_line('-' || v_Message);
                   insert into system.log_table values (sysdate, cur_tab, 'id err' || c_Row.ID,'appl err' || c_Row.path, v_Message,'');
              end;
              end loop;
              close c2;
              commit;
         end;
         end loop;
         close c1;
         commit;
    END CHECKXML;
    Thanks in advance
    Evgeni

    Hi
    Why do you use a GTT? Just keep your xml in memory...
    HTH
    Chris

  • How to check MAxl is running properly or not

    Hi All,
    i am working on ASO cube which has to implement Automation for dimension building and data loading. I am unable to execute even a single sample systax with out error. Is there any specific method to use Maxl in ASO cube or any precautions to be taken in ASO for Maxl scripts.
    I don't know it is a foolish question or not to ask like "how to check the Maxl is working properly or not" bcoz it is raising me doubt by raising error for sample script also.
    please help me out from this issue .
    Regards

    Can you log into Essbase through MaxL interactively.
    If so, can you do it from a script? Something like:
    login username password on servername ;
    exit ;
    If you can't do the first, yup, your MaxL client is hosed or you don't have a valid username/password. Or you don't know the servername.
    If you can't do the latter, perhaps your client (could be the server itself, if you're running it from there) has a pathing issue when running batch files.
    If both work, it is a syntax issue. Now you're just faced with your mistake(s). :) But at least you don't have to spin wheels trying to figure out if MaxL is working or not.
    Regards,
    Cameron Lackpour
    P.S. You might want to try using the MaxL editor in EAS and see if your login code works there. I believe (not sure, but I think so) that EAS has its own flavor of MaxL as I know you can run code there without having the Essbase client installed on a local machine.

  • How to check whether portal user exists or not using UM API.

    Hi Experts,
    Let us say i need to create an user account "PortalUser",i know how to create an user,setting first name,lastname,password for that.
    but here before creating the portal user, i need to check whether that user exists or not.If user already exists ,then i  need to skip the below for creating the user.
    IUserFactory userFact = UMFactory.getUserFactory();
    IGroupFactory groupFact = UMFactory.getGroupFactory();
    IRoleFactory roleFact = UMFactory.getRoleFactory();
    IUser tuser = userFact.getUserByLogonID("PortalUser");
    IUserMaint newUser = userFact.newUser("PortalUser");
    newUser.setFirstName("PortalUser");
    newUser.setLastName("Test");
    newUser.setEmail("PortalUser.Testatgmaildotcom");
    //Locale PortalLanguage = new Locale(Lang.toLowerCase(), "");
    Locale PortalLang=new Locale("en");
    newUser.setLocale(PortalLang);
    newUser.save();
    newUser.commit();
    IUserAccount userAcc = UMFactory.getUserAccountFactory().newUserAccount("PortalUser", newUser.getUniqueID());
    userAcc.setPassword("test1test$");
    userAcc.save();
    userAcc.commit();     
    Thanks in advance.
    Thanks
    Sony.

    Hi,
    Try this code,
    IUserFactory factory = UMFactory.getUserFactory();
    IUser user = factory.getUserByLogonID(userId);
    lastName = user.getLastName();
    firstName = user.getFirstName();
    refer this pdf,its very helpful
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/events/webinars-nw-rig/using%20the%20user%20management%20api%20with%20ep%20applications%20-%20webinar%20powerpoint.pdf
    Regards,
    Sunaina Reddy T

  • How to check RBS maintainer is running or not and how to stop the RBS maintainer for a specific content db.

    HI
    how to check RBS maintainer is running after deleting orphan blobs and  while deleting the blobs from rbs storage,
    and also how to stop the RBS maintainer for a specific content db.
    when I run below query  I found the orphancleanup value true
    SELECT [config_key],[config_value] FROM [mssqlrbs_resources].[rbs_internal_config]
    where config_key='orphan_cleanup_in_progress'
    adil

    HI
    the  RBS maintainer was run from one of web front end server  And for one content database , that fine
    but I  now know this information only this did by other administrators.
    Now I did not found this Maintainer running in windows task scheduler, but blobs are decreasing from content database RBS storage folder, and  also I found this maintainer running I checked from  when  run sql queriy in  sql
    server
    SELECT
    [config_key],[config_value]
    FROM
    [mssqlrbs_resources].[rbs_internal_config]
    where
    config_key='orphan_cleanup_in_progress’
    it  given me true
    here now  I want to stop this orphan cleane up , what settings and script I will run?
    adil

  • How to check  DBMS_JAVA package is installed or not a database

    Hi all,
    I 'm using an oracle 10g on Solaris 10 machine.Does any one knows how to check if the DBMS_JAVA package is installed or not in my database
    thanks.

    Handle:      user11191992
    Status Level:      Newbie
    Registered:      Feb 9, 2010
    Total Posts:      60
    Total Questions:      29 (18 unresolved)
    So many question & so few answers
    :-(

  • How can check rollup level and autoconfigure or not on 11i

    Hello;
    I installed a vis 11i, wondering how can I check my rollup level and autoconfigure or not, please give advice. -thanks first

    portcommand wrote:
    Hello;
    I installed a vis 11i, wondering how can I check my rollup level and autoconfigure or not, please give advice. -thanks firstUsing AutoConfig to Manage System Configurations with Oracle Applications 11i [ID 165195.1]
    Autoconfig FAQ [ID 218089.1] -- 7. Is AutoConfig compatible with Oracle Applications 11.5.x?
    How to check, which EBS Techstack Patchsets have been applied on 11i or Release 12.1.x ? [ID 390864.1]
    How to Get The Patchset Level of Oracle Applications Products in R12 [ID 550654.1]
    Oracle Applications Current Patchset Comparison Utility - patchsets.sh [ID 139684.1]
    Thanks,
    Hussein

  • How to check whether a Record Exists or not in Ztable

    Hi all,
    I have Req like this
    In ZTable i have 2 fields  * Legacy System , Legacy Material No*
    Environment Value is coming in one of the field in Idoc
    The logic is if the Environment Value is UK and a Record Exists on the ZTable for Legacy Sysyetm = Leg1 means i have send Legacy Material No , else  Send 01
    Please suggest me the process for this
    REgards
    Vamsi
    Edited by: Vamsi Krishna on May 19, 2009 5:31 PM

    Hi Michal / Aamir,
    Thanks for your replies.
    The ZTable is at R/3 side only, iam using RFC Lookup for this, but iam bit confuse on how to construct the logic to check whether there is a record Exists or not on Ztable
    Logic shld be If the Environment value is UK and a record exists on the Ztable for Legacy system "ABC" means then send Legacy material number else send 01
    In Table we will have the fields Legacy System   Legacy Material No  & Environment value is coming from Idoc itself( Ex: UK or US)
    Regards

  • How to check mailer configuration is set or not

    Dear,
    We are on r12,right now all the notification are being sent and appear after login the application in woklist window, now i want to know that is mailer is configured or not, how to verifiy that mailer is proper configure and there is not issued in mailer configuration
    --thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Thanks for reply,
    i followed all the setups as you mentioned but when i check record in wf_notifications table,it show's MAIL_STAT as Failed, so what this mean?
    could you please advice.
    --thanks                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to Check whether laptop is OEM or Not ?

    I had bought a  Envy 15 notebook through flipkart. But due to technical problem I had refreshed my pc using HP recovery. At last I cant activate windows 8. When I contacted Microsoft technical support I had given my product ID and they told me that it was not a product of OEM. Whats the solution for this problem ?

    Hi,
    It will blow air out. You can use you hand or a piece of tissue to check. Normally fan will only work when machine is getting warmer. You may run machine for 10 or 15 mins then check. BUT making beeping noise at startup is not a good news, what is the actual noise ? How many times ?
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How to check whether a file exists or not

    i am in an image uploading utility. i hav succesfully uploaded the image to the server directory (say /uploads). but when displaying the uploaded image, i wanna show the picture only if the image exits (bcoz for some records there is no image). so i hav used this code
    if(new File("uploads/1.jpg").exists())
         out.print("image exists");
    but its not working for me. i got it working fine when i give the full path "D:/Tomcat/webapps/diary/admin/uploads/1.jpg". but i think giving this absolute path is not an efficient method bcoz its a web application, bcoz i may not be able get the absolute path always. so how can i do this by specifieing the relative path
    help me ASAP if u can
    aleens

    Haii ameen
    This is one way to rectify your problem..
    if(new File("uploads/1.jpg").exists())
    out.print("image exists");
    instead of this u can write like
    <%
    ServletConfig cf=getServletConfig();
    ServletContext c=cf.getServletContext();
    if(new File(c.getRealPath("uploads")+"/test.txt").exists())
    out.print("image exists");
    %>If u are not clear of what it is done let me know..i will xplain to you furthur...
    Happy New Year
    Shanu

  • How to check jms server is running or not

    Hi,
    Is there any to check whether defined jms sever in a weblogic domain,10.3, is running or not?
    thanks

    Hi bala
    T code for checking your ABAP and Java ports is SMICM.
    Then select GOTO --> Parameters --> Find the parameter given below for ABAP port.
    icm/server_port_0 = PROT=HTTP,PORT=8000,TIMEOUT=30,PROCTIMEOUT=600
    Java Port:
    icm/j2ee_0 gives you Java port.
    Refer the point no 8 of the web log it states about  start the J2EE server.
    /people/krishna.moorthyp/blog/2006/07/23/http-errors-in-xi
    Regds
    Abhishek

  • How to check where DB uses ASM or not.

    I do not know customer Oracle DB environment well.
    Customer uses oracle 11g on win2008R2 and OEM is not installed.
    How could I know whether that DB uses ASM or not ?

    Hi
    Thanks for reply.
    There is no record in rpd in cache manger.
    But I run the report(my cache is enable)
    still I have no record in my cache.
    so how i know..
    1. my cache having the data.
    2. Query is going to cache/db
    3. cache is purged.

  • How to check my ipad is refurbished or not by serial number ???

    Sorry for my english. I bought 1 Ipad 1 from friend, no box. I have only Model and Serial number in Ipad.
    And now, I want to know my Ipad is refurbished or not.
    Help me, please.

    Really no way to tell.

Maybe you are looking for

  • My iPhone 5s Siri and voice txt not working

    several weeks ago I notice that Siri wasnt working nor was my voice to txt. I attributed this to not updating my iOS because my cloud storage was full. The holidays were crazy, waited until I had time to transfer my pictures to my computer, so I coul

  • I can't update apps after switching from my dad's Apple ID to mine.

    After I switched my dads ID to mine when I go to update apps it requests his password. What do I do to. change it to mine?

  • IPhone + Apple iPod Universal Dock?

    Does anyone know if the iPod Universal Dock is really compatible with the iPhone? When I plug my iPhone into the UD it says "This accessory was not made to work with iPhone" and then proceeds to ask if I want to go into Airplane mode to reduce audio

  • "Send mail as" function in Apple Mail?

    Hi all, Does anyone know if Apple Mail has a "send mail as" function? Gmail has this so that you can sent up your gmail account to "send mail as" a different address than your gmail account. (This is great for cases like if you have a university alum

  • Attaching Files to Yahoo Mail

    Hello, I am trying to attach files that I have just recently imported from my digital camera to Yahoo Mail. When I go to attach files, then to Pictures on the menu, I then click on Iphoto library, thats as far as it will go unless I want to attach th