Extending JComponent  and creating new derived class

<!--[if gte mso 9]><xml>
Normal
0
false
false
false
EN-US
X-NONE
X-NONE
MicrosoftInternetExplorer4
</xml><![endif]--><!--[if gte mso 9]><xml>
</xml><![endif]-->
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}
</style>
<![endif]-->
Dear Friends,
I developed new component SwingComponent and I extends it
from JComponent and also implements
the interfaces like
KeyListener and MouseListener .. but when I press ctrl+b and ctrl +n  it wont recognize in the KeyEvent but it works fine if i press  individual keys. Please give me an idea
public class SwingComponent extends JComponent implements
KeyListener,
MouseListener{

This one working fine for individual character for example if i press 'A' in keyborad it was working but how to activate if i press ctrl + n or ctrl + b in the JComponent or Component. did you got my question?
private KeyListener keyListener;
     public void addKeyListener(KeyListener listener) {
              keyListener = AWTEventMulticaster.add(keyListener, listener);
          enableEvents(AWTEvent.KEY_EVENT_MASK);
     public void removeKeyListener(KeyListener listener) {
          keyListener = AWTEventMulticaster.remove(keyListener, listener);
     public void processKeyEvent(KeyEvent evt) {
          if (keyListener != null) {
               System.err.println("" + evt.getKeyChar() + " " +                                    
                                    evt.getKeyCode());
               switch (evt.getID()) {
               case KeyEvent.KEY_PRESSED:
                    keyListener.keyPressed(evt);
                    break;
               case KeyEvent.KEY_RELEASED:
                    keyListener.keyReleased(evt);
                    break;
               case KeyEvent.KEY_TYPED:
                    keyListener.keyTyped(evt);
                    break;
          super.processKeyEvent(evt);
       public void keyTyped(KeyEvent e) {
                 System.out.println(e.getKeyChar());
     public void keyPressed(KeyEvent e) {
            System.out.println(e.getKeyCode());
     public void keyReleased(KeyEvent e) {
             System.out.pirntln(e.getKeyCode());
          }

Similar Messages

  • What is the diffrence between extends and creating new object?

    HI ALL,
    what is the diffrence between extends and creating new object?
    meaning
    class base{
    class derived extends base{
    class base{
    class derived {
    derived(){
    base var = new base();
    can u people tell me diffence from the above examples.
    THANKS.
    ANANDA

    When you create a new object you have to supply the class to which that
    object belongs. A class can extend from another class. If it does so
    explicitly you can define the 'parent' class from which the class extends.
    If you don't explicitly mention anything, the class will implicitly extend
    from the absolute base class named 'Object'.
    Your example is a bit convoluted: when you create a Derived object,
    its constructor creates another object, i.e. an object from the class from
    which the Derived class extends.
    Extending from a class and creating an object don't have much in common.
    kind regards,
    Jos

  • Transfer assets collectively to new class and create new assets like ABUMN

    We need to change the account determination for a few Asset Classes that already have assets with postings.  As a result we must create new asset classes and assign a new account determination.
    Is there a program that would allow transfer assets collectively to a new asset class and create new assets automatically similar to ABUMN?  T-code ABUMN allows you to transfer multiple assets but you must create the new assets first.  ABUMN will transfer and create new asset but only does one asset at a time. 
    There are hundreds of assets with postings to be transferred from the old asset classes to the corresponding new asset classes.
    Appreciate whatever input you can provide.
    Tara

    download the asset master data(original) and create new asstes using lsmw or any third party tool also.

  • How can I make the popup with empty fileds and create new record?

    I would like to use a popup to create new record.
    I created a af:popup by drag and drop a VO from data control to jsff. then, I created a button and place a af:showPopupBehavior. I was able to popup window by click the button.
    however, the window filled with the information from the 1st record. and when I select a record in table and click popup, the popup is filled with that record.
    How can I make the popup with empty fileds and create new record by saving the popup?
    Thanks

    You can have edit and new buttons, in the PopupFetchEvent identify button source (using popupFetchEvent.getLaunchSourceClientId()) if new button clicked clear the binding using below code.
    If you want to see empty fields, in the popup PopupFetchEvent clear the input component bindings.
    resetBindingValue("#{bindings.<componentid>.inputValue}", null);
        public static void resetBindingValue(String expression, Object newValue) {
            FacesContext ctx = FacesContext.getCurrentInstance();
            Application app = ctx.getApplication();
            ExpressionFactory elFactory = app.getExpressionFactory();
            ELContext elContext = ctx.getELContext();
            ValueExpression valueExp = elFactory.createValueExpression(elContext,expression,Object.class);
            Class bindClass = valueExp.getType(elContext);
            valueExp.setValue(elContext,newValue);
        }

  • Hw to create new valuation class..?

    Hi gurus
    can anybody explain me how to create new valuation class for Some materials types eg finished goods.
    What is valuation class..? were to assign the valuation class after creation..?
    Thanks
    sap-mm

    Hi,
    Goto SPRO->IMG->Materials Management>Valuation and Account Assignment>Account Determination->Account Determination Without Wizard->Define Valuation Classes
    Valuation class means:
    Assignment of a material to a group of G/L accounts
    With other factors, the valuation class determines the G/L accounts that are updated as a result of a valuation-relevant transaction or event such as a goods movement.
    The valuation class makes it possible to:
    Post the stock values of materials of the same material type to different G/L accounts
    Post the stock values of materials of different material types to the same G/L account
    Account category reference is assigned to val.class and val.class is assigned to material type and g/l is assigned to v.class
    Venkatesh

  • I have a new email address. Changed this on my itunes account. On iPhone deleted old icloud account and created new with new email. I have set find my phone to on. When I download music it no longer goes to icloud an does not show up on my iphone.

    I have a new email address. Changed this on my itunes account. On iPhone deleted old icloud account and created new with new email. I have set find my phone to on. When I download music from itunes it no longer goes to icloud an does not show up on my iphone.

    I have the same problem - it is maddening. I rely on this iPad for work so this is not just an annoyance! The above solutions of changing the appleid on the device or on the website do not work.
    The old email address no longer exists - I haven't used it in a year probably and I no longer have the account.  I logged into the appleid website and there is no trace of the old email address so there is nothing that can be deleted or changed there.  On the iPad there is no trace of the old email address so nothing can be deleted there either. I have updated the iPad software and the same problem comes right back.  Every 2 seconds I am asked to log in using the old non-existent email.  The device is currently useless.
    The only recent change to anything was the addition of an Apple TV device, which was set up using the correct login and password.
    Does anyone have any ideas? The iPad has been backed up to the iCloud so presumably it now won't recognize the current iCloud account? So restoring may notbe an option?

  • Copying home DVD videos, editing, and creating new DVDs

    Here is the situation:
    I have the 17" and this is my first Mac to own. I am computer literate with most my experience on Windows and Linux.
    That being said, I am trying to edit home videos; but they are already on DVDs. I got a LiteOn DVD/VCR combo recorder for my entertainment center. I have a camcorder that uses Hi-8 media and it is only able to use S-video/composite outputs (no USB or Firewire). I am using the LiteOn recorder to archive all my videos to DVDs because it has composite inputs. The LiteON has hardly any editing capability. So I want to take the "simple" DVDs I made, copy them to my HD, edit them (to cut out junk, create better menus, and give it as nice touch), and create new DVDs to distribute to my family and to get rid of old tapes.
    So in short, the process I want to do on the Mac is:
    1. Copy my family home DVDs
    2. Edit the video.
    3. Create more "creative" DVDs for my family.
    I have been looking around the website and reading posts and I don't see how to do this. I did try to create an image on disk utility, but it failed for whatever reason (maybe I am missing a step). How can I accomplish the three steps above?
    Please help.
    Thank you, Michael

    If these are true, standard video DVDs that the drive creates, there are a number of utilities that can extract and convert the videos for use in editing applications. A couple of utilities that people have reported success with are DVDxDV, Cinematize, and MPEG Streamclip (MPEG Streamclip is freeware but requires that you have Apple's QuickTime MPEG2 Playback Component), and there are no doubt others.
    Once extracted, you can use iMovie to edit the clips and iDVD to burn them to a new DVD. Then you can use Disk Image or a third-party application such as Roxio's Popcorn to make additional copies.
    Hope this helps.

  • Reconfigure sales BOM deletes line item and creates new line item

    We are having issue with Sales BOM. Once sales BOM is reconfigure, line item is automatically deleted and creates new line item. These changes are not captured by reporting tool. Is it standard SAP behavior? if its not standard behavior, how to fix this issue?

    Hi,
    If i am not wrong, i assume you are using site instead of plant.   If it is plant , then "yes", we can have a order with same material being line item 10 and 20 with different plants.  Reg delivery, if the plants are configured to a same shipping point then you will have one delievery.  if the plants are configured for a different shipping point , then delivery will be split up.
    Reward if it helps,
    Thanks & regards,
    CLN

  • Dynamic Action-Delimiting a record and creating new record

    Hi ,
    My requirement is in dynamic Action I need to delimit all records in a Subtype of an Infotype and create New record for these records with BEGDA as ENDDA + 1 of the delimited records.
    Iam able to delimit all records in the Subtype but , Iam not able to create new records.
    My code for delimiting is as given below, in T588Z,
    9901     2          06     801     P     P9901-SUBTY='2'
    9901     2          06     802     P     PSYST-IOPER='MOD'
    9901     2          06     803     P     P9901-STATS='X'
    9901     2          06     804     P     P9901-PREAS='91'
    9901     2          06     805     F     DELIMIT_DTE(ZHSRAS_T588Z_9901)
    9901     2          06     806     W     P9901-ENDDA=RP50D-ZZDATE3
    9901     2          06     807     I     MOD,9901,3
    9901     3          06     808     P     SY-UCOMM='UPD'
    9901     3          06     809     F     DELIMIT_DTE(ZHSRAS_T588Z_9901)
    9901     3          06     810     W     P9901-ENDDA=RP50D-ZZDATE3
    The above code is working fine.
    My code for creating new record is as given below, even though the control is oing to the subroutine, INS statement is not working, and hence new record is not getting created.
    9901     3          06     811     P     SY-UCOMM='UPD'
    9901     3          06     812     P     PSAVE-ENDDA<>P9901-ENDDA
    9901     3          06     813     P     P9901-STATS<>'X'
    9901     3          06     814     I     INS,9901,3
    9901     3          06     815     F     BEGIN_DATE(ZHSRAS_T588Z_9901)
    9901     3          06     816     W     P9901-BEGDA=RP50D-ZZDATE3
    9901     3          06     817     W     P9901-ENDDA='99991231'
    Kindly help me on this.

    Hi shahana,
    1. I have not worked on this dynamic action.
    2. But instead of doing in 2 steps,
       it is usually done in 1 step only, manually.
    3. If we CREATE record from some date,
       then the OLD will AUTOMATICALLY get Delimited.
    (We don't have to do anything specially for delimiting
      the old record)
    regards,
    amit m.

  • Forgot security questions, how do i delete old ones and create new ones

    forgot security questions on, how do i delete old ones and create new ones

    The following has instructions: If you forgot the answers to your Apple ID security questions

  • TS2446 My child wants her own Apple ID for her new phone and mac book. Not sure of steps to disable and creat new account while transferring photos etc. thoughts ?

    My child wants her own Apple ID for her phone and mac book. Not sure of steps to disable and create new account while transferring photos etc. thoughts ?

    Welcome to the Apple Community.
    Unfortunately, if Apple simply allowed people to log into different accounts and download content, everyone would be using everyone could share everyone else's content and bypass the need to purchase anything. To protect against this, they limit you to logging into a new account to once every 90 days.
    If two or more of you, have different accounts and use only one computer, you should each have your own user account on the computer, to avoid the need to log in and out of iTunes.

  • Problem in Shrink my local disk C and create new partitions on it.

    I am trying to Shrink my local disk C (current boot volume) and create new partitions on it. But I am getting a Warning message that If I do so, I won't be able to boot from any volume excepet the the current boot Volume. 
    In case if I need to do the recovery for my computer what will happen. does it mean that I can't do the recovery from my hard disk?
    This question was solved.
    View Solution.

    Kaj_R wrote:
    I am trying to Shrink my local disk C (current boot volume) and create new partitions on it. But I am getting a Warning message that If I do so, I won't be able to boot from any volume excepet the the current boot Volume. 
    In case if I need to do the recovery for my computer what will happen. does it mean that I can't do the recovery from my hard disk?
    Hello Kaj_R.
    If you change the volumes it is quite likely that the recovery partition will not function.  I suggest you create a set of Recovery Media before messing with the partitions.
    This document can help you create the recovery media.
    Have a great day!
    Please click the white star under my name to give me Kudos as a way to say "Thanks!"
    Click the "Accept as Solution" button if I resolve your issue.

  • Id email address cancelled. how do I log in and create new password?

    id email address cancelled. how do I log in and create new password?

    This link tells you how to change your Adobe ID and password:
    http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    And if it doesn't, there's a "Still Need Help?" link which leads you to web chat where you can talk with a person.

  • Can I copy MATERIAL adapter object and create new business object in R3AC1

    Hi experts,
    I need to copy MATERIAL adapter object and create a new business object R3AC1.
    Please let me know whether this is feasible.
    Thanks & Regards,
    Keya

    Usually  when there is a need to change/create an adapter object, I suggest to change object class to CUSTOMIZING in R3AC1. Then save it and call transaction R3AC3. There do necessary changes and afterwards switch back to original object class. There is no copy functionality for adapter objects. Kindly use transaction R3AC3 to create a new adapter object and maintain all tabs according to your requirements. When you are finished, kindly change the object class "CUSTOMIZING" to the original class name you're copying and the new adapter object will be visible in R3AC1.
    Documentation can be found in
       https://service.sap.com/ce    -> Early Product Training         > SAP CRM 4.0 & mySAP CRM Edition 2004 .. on the learning map, please choose "Development Consultant" -> Open "Enhance CRM Scenarios"
    Here you can find a lot of guides and SAP tutors on how to create an adapter object, example coding, and so on.
    To enable Filter Fields for an Adapter object make requisite changes in table SMOFFILFLD and generate the Adapter Object using SMOGGEN. CHeck table CRMPAROLTP in ECC to enable Filtering

  • Create new Z-class type

    Hello,
    I will classify a completely new object (such as building construction, based on new Z-table) by using the SAP class system. For this I will create a <b>new class type</b> as well and <b>new classes</b> with <b>new attributes</b>; classes and can be created, but as for now I didn’t find any way to create an own class type.
    Is it possible to create a new class type (like Z01) to classify and evaluate the new object?
    Thanks for your hints.
    Regards,
    Kurt

    When I go in SPRO to Cross-Application Components>Classification System>Classes-->Maintain Object Types and Class types, I get an initial view at the object table level.  If I select a table and choose the Class types level, I get to a Change View "Class Types" Overview with a New Entries button.
    Andrew

Maybe you are looking for

  • Sync'ing multiple iPhoto libraries

    I have multiple Mac in the home and would like to have one Mac act as the master iPhoto library and Sync with the other Mac libraries. My primary objective is more one-way (i.e., from either my wife's or kids' Mac to the Master), but i could see a de

  • Best way to update subclasses of UILabel and UIImageView?

    Hello- I'm looking for some strategic suggestions before I dive into this. I have subclassed UILabel and UIImageView to get text and tint colors from a theme color stored in UserDefaults and it all works fine, but I'd like to reduce the code footprin

  • Graphs in ABAP

    Hello friends,                      There is a program in ABAP GRAPHICS_GUI_CE_DEMO in which we are getting graphs as output.We have set values in this program(hard coded).Can have an internal table passed in this program.We are using a class cl_gui_

  • Webservice so applications can request images (jpg) from BI datawarehouse

    Hello all, We would like to have an integrated XI-BI scenario. In BI we would like to store images in the Datawarehouse. We would like to make these images available through a webservice and use XI as middleware application to call the webservice and

  • How do I keep EHDs spinning?

    I have a new Imac and use 2 G-Tech 0RAID EHDs. I have no complaints at all except that all my image data is now on one of these drives and they go to sleep very quickly. When they are awake, accessing and recording to them is very quick (my main driv