How set ctrl +a event for Jbutton and esc event for closing jinternal frame

i am doing desktop project in that i need set ctrl event for button ,i am strucking in that area pls anybody help me to overcome this problem ,and also i need button in table when i press button it has to fill value in the next field ,its urgent please

Read the section from the Swing tutorial on [How to Use Key Bindings|http://java.sun.com/docs/books/tutorial/uiswing/TOC.html]

Similar Messages

  • How do I set a fixed size for a window (frame) :P

    hello!
    Was wondering if I can set fix dimensions (size) for a window(frame) in Java.
    Background: I have a menu and when I click on one of the options a window opens but I hate the fact that I can enlarge it...wish it would be fixed sized and have scroll instead... :P
    any ideas?
    many thanks!
    Cristina

    sorry for not using the swing forum but i considered java programming forum as more or less enclosing all problems Do you understand how to use forums? First you should be searching the forums to see if you questions has been asked and answered before. (Very few questions posted in the forums are original). It makes sense to search the forum where the questions should have been posted in the first place.
    For example, if you had searched the Swing forum using "fixed size jframe" you would have found this posting at the top of the search results:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=712407
    So you would have had your question answered in less than a minute and we wouldn't have wasted time answering a question that has already been answered.
    A win-win situtation for everybody.

  • How set maximum of characters for the columns

    Hello I use a JTable and I want to set maximum of characters for the columns.
    For example column 1 max 10 characters, column 2 max 20 characters, etc..
    How can I do this?

    The principle is as follows: a table uses certain input components for editing a cell value, e.g. a JCheckBox for Boolean-type values or a JTextField for textual/numerical values. By default, a JTextField doesn't have any size limit, so you can enter as many chars as you want. In order to change this behaviour, you'll have to
    1.) create a JTextField that does have a size limit and
    2.) set a CellEditor on the JTable which uses this manipulated JTextField.
    An easy way for 1.) is to create a custom Document (the internal data representation for text components, the M-part of the MVC -- see javax.swing.text.Document) that doesn't accept any text beyond a given limit, e.g.:
    public class LimitedDocument extends PlainDocument {
      private int max = 0;
      public LimitedDocument(int max) {
        this.max = max;
      public void insertString(int offset, String str, AttributeSet a) throws BadLocationException {
        // too long for the limit; get current contents, insert, and cut off trailing chars
        if ((getLength() + str.length()) > max) {
          StringBuffer buf = new StringBuffer(getText(0,getLength()));
          buf.insert(offset,str);
          remove(0,len); // remove current text contents
          super.insert(0,buf.toString().substring(0,max),a); // insert whole text
        // no problem, will fit
        else {
          super.insertString(offset,str,a);
    }Then, in order to set the cell editor -- for example for the first column --, you can do as follows:
    myTable.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(new JTextField(new LimitedDocument(5),"",5)));This will create a new DefaultCellEditor (see javax.swing.table) and initialize it with a given text field which will be responsible for any edition in this column. As the text field itself is created using a limit of 5, it should accept no text insertion beyond 5 chars.

  • How do I optimize "Waiting for the next frame"

    When running my swf file in release build, the first time I start the browser after cleaning the browser cache, the .swf will appear in less than a second.  If I attach scout, I can see it is around .7 seconds to finish.
    However, after this run all subsequent times I load the page, it takes ~3 seconds.
    When I look at scout, I see almost identical CPU and memory use , but it is spending ~2.3 seconds "Waiting for the next frame".  (almost an extra 700ms per frame).
    There is no requirement for animation, all of the content is very static.   I'd just like to render it as fast as possible.
    I know it's not related to caching the .swf file because I have tried turning off the caching (by adding a random parameter) and verified using Httplogger that it is always downloading a new .swf file.  (I turned back on caching).  So I'm kind of not sure what to do next...
    What things can I try to optimize this?  Are there places I can read about this issue?
    (P.S.  >>  I notice it spends a lot more time "Waiting for the next frame" when I build a debug version.  Don't know if that's relevant...)
    Thanks!

    There's nothing you can do about "Waiting for next frame" - this is simply the time when Flash Player has finished doing everything it needs to do for the frame, and waiting for the OS to wake it up again. This depends on the framerate you set in your swf - roughly speaking, the waiting time is the budget (1/framerate), minus the time Flash Player spends doing actual work.
    You can find more information here, about understanding how the data you see in Scout relates to how Flash Player works:
    http://www.adobe.com/devnet/scout/articles/understanding-flashplayer-with-scout.html
    btw, you shouldn't look at performance in a debug swf - you'll get wildly misleading results.

  • How set auto growth file for 500 GB Database

    Hi
    We have 500 GB database every day its grow by 18 GB.
    can you please advice me how Can I set auto growth file in MB or percentages?
    Thanks in advance.

    How to set it - Check this link -
    https://www.simple-talk.com/sql/database-administration/sql-server-database-growth-and-autogrowth-settings/
    First - Never rely on Autogrowth for growing the file sizes. This has to be a manual process where you increase the size depending on the growth before hand. Autogrowth should only be relied on for last case/unfortunate scenarios
    Second - Dont set Autogrowth in Percentages . Always set it in MB's.
    You cant start with say 500 MB and monitor. You need to set this in such a way that increasing this amount does not take up too much time and cause slowness.
    Check if you have Instant File Initialization enabled - This will reduce the time taken for initializing DATA files considerably. Check this link -
    http://blogs.msdn.com/b/sql_pfe_blog/archive/2009/12/23/how-and-why-to-enable-instant-file-initialization.aspx
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • How to create an array of JButtons and How to implment it ...

    This is what i want to do - I want to create an array of JButtons that has 8 rows of 8 buttons, could someone help me with this (im creating a checkers board) all i need is the array of buttons and them in 8 rows of 8 buttons .... im pretty confident in the way of making them do what i want but need help getting it up and running .... please note it is to be done in the swing environment and not in a applet or anything - ie in a JPanel and a JFrame .... any help would be GREATLY appreciated.

    U can try this
            JButton b[][] = new Button[8][8];
         setLayout(new YourLayout());
         for(int i =0; i<8; i++)
              for(int j =0; j<8; j++)
                   b[i][j] = new Button("Test");
                   b[i][j].addActionListener(new YourAction());
                   add(b[i][j]);
         }               

  • How set up visualization attributes for Hierarchy nodes?

    I have a hierarchy for 0ACCOUNT and i see in the report the hierarchy totally expanded but in the Query Designer i can
    set the values for 0ACCOUNT to show the ID only for every account but the hierarchy have more nodes (text nodes in addition to accounts) i need that ONLY TEXT NODES show the Description of Text Nodes instead of Technical Node ID........in query designer you could set for accounts that show Text, ID or both but in for text nodes there´s no way to do this.......in Query execution you could set up this with extended menu....and you could set up that only shows Text for Hierechy nodes.....I hope somebody could help me with this...
    Regards

    You are right, the only way to do that is save the query as workbook, then setup the description, text, etc in the workbook , and finally save the workbook in the way you want to view.
    Regards

  • How set auto freeze area for liquify filter

    I saw a "killer tip" for photoshop in which a circular marque selection was made of a layer and then the liquify filter command selected and the entire layer could be seen in the liquify dialog box, but everything but the selection was "frozen", that is, masked in red so that liquify tools don't effect this area.
    I can't make this work on CS5 on imac. The liquify tool otherwise works perfectly for me
    Help?
    Thanks,
    vince

    You could use a retangular selection if you inverse the selection
    before going to the liquify filter and use the freeze or thaw tools to modify.
    You can also use a layer mask or channel to define the protected areas and then
    use the mask options in the liquify filter to set to the channel or mask.
    You can define protected areas without using a selection, mask or channel with
    the freeze and thaw tools in the liquify filter.
    more about the liquify filter:
    http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-75faa.h tml
    MTSTUNER

  • How set up Address Book for efficient iPhone use?

    Situation: I live in the U.S. Calls to Europe are made from my address book by tapping a number which is stored for example (Germany) as
    "+49" + telephonenumber.
    When in Germany I would omit the country code and instead dial
    0 + telephonenumber.
    Do I have to set up a second telephone entry in the second form above to avoid having to manually dial the number while in country? Surely there is something more efficient and automatic than either of these alternatives.

    Calls do not go from Germany to the US and then back to Germany. If you are in Germany on a US SIM the call will stay in Germany. What happens is the German network will charge your US for a roaming call. This should be a lot less than calling a number in the US from your US SIM phone while in Germany.
    The only time it would go to the US is when someone calls you on your US number. Since the person is calling the US they will be charged an international call. You will then be charged for the call from the US to Germany.

  • How set a custam vRam for HD 3000

    I have a mac mini mid 2011 and would like to set the size of video memory only to a fixed size, do not use programs that require use of the video card, and would like to improve my performance, lowering consumption of memory.
    Sumary Hardware
    Mac Mini Mid 2011, Intel HD3000, 4 GB RAM.

    The HD3000 uses system RAM memory.  The only way
    to improve things is to get more RAM.

  • How set an initial state for Slide effects

    Hi everyone, I would like to use the slide effect like the
    collapsable panels, with an initial state "closed".
    I used Spry Pre-Release 1.5 Preview
    In my first attempt
    <a
    onclick="Spry.Effect.Slide('MoreOptionSlide',{duration:1000,from:'0%',
    to:'100%',toggle:true})" >More Options</a>
    The DIV is always "open" and after click it closes and
    performes the slide animation.
    Also i tried to change some style attributes of the DIV and
    restore or change them in the "setup" function of the
    spy.Effect.Slide constructor, I thought this function is executed
    before animation, but it is executed even without be triggered the
    animation.
    Thanks,
    Richard

    Hello Richard,
    After you design the page and adjust the element dimensions
    as if the element would be in page without the animation to show it
    you'll have to set the 'display:none' CSS property on that element.
    In this situation the element will remain in page but will simply
    be invisible. Something like this:
    <div id="MoreOptionSlide" style="width: 300px; height:
    200px; border: 1px solid black; overflow: auto;display:none;">
    </div>
    Now using Spry 1.5 effects you can make this element appear
    after the More Options link is clicked:
    <a href="#" onclick="effect.start(); return false;"
    >More Options</a>
    <script type="text/javascript">
    var effect = new
    Spry.Effect.Slide('MoreOptionSlide',{duration:1000,from:'0%',
    to:'100%',toggle:true});
    </script>
    Regards,
    Cristian MARIN

  • How to define alt text for an anchored frame in FrameMaker 11?

    What is the procedure in FrameMaker 11 to include alt text for anchored frames? We need to produce tagged PDF output that is accessibility compliant; this output must include alt text for each image in the document that a screen reader can read out.
    In previous FrameMaker versions, it was possible to define alt text as follows:
    Select the frame and choose Graphics > Object Properties.
    Click Object Attributes.
    In the Text Attributes section, add your alt text and actual text, and then click Set.
    The FrameMaker online help still describes this same procedure, at http://help.adobe.com/en_US/framemaker/using/WSd817046a44e105e21e63e3d11ab7f7960b-7f0f.htm l. However, I see that in FrameMaker 11, what you get on choosing Graphics > Object Properties has completely changed from previous versions, and I cannot see Object Attributes.
    Where is the alt text defined for an object in FrameMaker 11?

    In the Anchored Frame panel, click on the Object Attributes button.

  • How to create own button for closed captioning

    Hi,
    I have created my own buttons for play, pause, exit etc. But I do not know how to create button to show closed captioning.  I tried few hours but I give up. What I need to do?:
    First clik - closed captioning will appear
    Second clik - closed captioning will disapear.
    And so on appear/disapear/appear/disapear
    Help please!
    Poul

    Have a look at: Toggle Shape buttons - Captivate 6 - Captivate blog
    Replace the system variable cpCmndMute by cpCmndCC and you'll have the choice between different scenarios.

  • How to get any event occurs inside inline frame .

    Hi All,
    I have configured some url in af:inlineFrame component .
    This url is pointing to a webapplication which is hosted on different server .
    If i want to know all the activity what is happening insde inlineframe component which event i need to handle .
    I show all metadata of af:inlineframe component i dint find it handle any event .
    Please let me know how could it possible .
    Thanks ,
    Arun.

    Hi Sireesha,
    I have configured http://google.com as a source of inline frame component .
    Now google.com is rendered inside the inlineframe component .
    Whenever i will do some serach or click on the link appearing after searing something in google or someother activity .
    i want to intercept all the actions in my bean .
    Please let me know if above explanation is not clear .
    Thanks,
    Arun.

  • How to remove an event listener of Enter Frame

    basically, i doing a three level game. 1st level is dodging the stone from sky, Secondly, samsh the wolf head. However, when i enter leve1 2 game, it show me an error.
    TypeError: Error #2007: Parameter hitTestObject must be non-null.as:113  Cant access to null object or reference.as.83
    I think due to when i enter level 2, the object is not available anymore, so happen this errors,izzit? how i gonna fix this?
    package
              import flash.display.MovieClip;
              import flash.events.KeyboardEvent;
              import flash.ui.Keyboard;
              import flash.events.Event;
              import flash.events.MouseEvent;
              import flash.ui.Mouse;
              import flash.utils.Timer;
              import flash.events.TimerEvent;
              import flash.events.Event;
              public class level1 extends MovieClip
                        var vx:int;
                        var vy:int;
                        var collisionHasOccurred:Boolean;
                        var score:uint;
                        public function level1()
                                  init();
                        function init():void
                                  //Initialize variable
                                  vx=0;
                                  vy=0;
                                  collisionHasOccurred=false;
                                  stone.stop();
                                  score=0;
                                  optionPage.visible=false;
                        //Add event listeners
                        stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
                        stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
                        addEventListener(Event.ENTER_FRAME, onEnterFrame);
                        wolf2.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
                        function onKeyDown(event:KeyboardEvent):void
                                  if(event.keyCode==Keyboard.LEFT)
                                            vx=-5;
                                  else if (event.keyCode==Keyboard.RIGHT)
                                            vx=5;
                                  else if (event.keyCode==Keyboard.UP)
                                            vy=-5;
                                  else if (event.keyCode==Keyboard.DOWN)
                                            vy=5;
                        function onKeyUp(event:KeyboardEvent):void
                                  if (event.keyCode==Keyboard.LEFT || event.keyCode==Keyboard.RIGHT)
                                            vx=0;
                                  else if (event.keyCode==Keyboard.DOWN || event.keyCode==Keyboard.UP)
                                  vy=0;
                        function onEnterFrame(event:Event):void
                                  trace(player);
                                  trace(cursor);
                                  trace(aaa);
                                  trace(wolf2);
                                  trace(wolf);
                                  //Move the player
                                  player.x+=vx;  <-------------------------------------------------------------this is line 83
                                  player.y+=vy;
                                  //collision detection
                                  if (stone.hitTestObject(player))
                                  player.gotoAndStop(3);
                                  health.meter.width-=2;
                                  if (! collisionHasOccurred)
                                            score++;
                                            messageDisplay.text=String(score);
                                            collisionHasOccurred=true;
                        else
                                  player.gotoAndStop(1);
                                  collisionHasOccurred=false;
                        if (health.meter.width <=1)
                                  New.text="Game Over!";
                                  stop();
                                  fl_CountDownTimerInstance_3.stop();
                        if (player.hitTestObject(wall))   <-------------------------------------------------this is line 113
                                  player.x-=vx;
                                  player.y-=vy;
                        if (player.hitTestObject(wallA))
                                  player.x-=vx;
                                  player.y-=vy;
                        if (player.hitTestObject(wallB))
                                  player.x-=vx;
                                  player.y-=vy;
                        if (player.hitTestObject(wallC))
                                  player.x-=vx;
                                  player.y-=vy;
                        if (player.hitTestObject(wallD))
                                  player.x-=vx;
                                  player.y-=vy;
                        if (player.hitTestObject(wallE))
                                  player.x-=vx;
                                  player.y-=vy;
                        if (player.hitTestObject(wallF))
                                  player.x-=vx;
                                  player.y-=vy;
                        if (player.hitTestObject(wallG))
                                  player.x-=vx;
                                  player.y-=vy;
                        if (player.hitTestObject(wallH))
                                  player.x-=vx;
                                  player.y-=vy;
                        function fl_MouseClickHandler(event:MouseEvent):void
                        score++;
                        aaa.text=String(score);
                        trace("Mouse clicked");

    instead of:
    if (player.hitTestObject(wall))
    use:
    if(player&&wall){
    if (player.hitTestObject(wall))

Maybe you are looking for

  • Syncing emails sent from ipad in Hotmail with the server

    When I send emails through Hotmail from my ipad, they are delivered ok to the other party, but there is no record when I check Hotmail "sent items" on my PC. How can I get "sent" to sync with the Hotmail server so I can see emails I have sent from my

  • Nokia 6210 Problems with using Edge (Internet Conn...

    I have a Nokia 6210 phone bought from an authorized Nokia Care Center in Delhi, India two weeks ago.  The software version on the phone is 3.08 dated 11-June 2008. It also mentions custom version as 03.08.c00.01 I am an Airtel Prepaid customer in New

  • Using diagnostic mode on 27 inch iMac

    I was trying to get my 27 inch core i7 iMac to boot into diagnostic mode this morning by holding down the 'D' key during bootup. It just wouldn't work and kept booting up normally. Then it occurred to me that maybe this is due to the fact that this i

  • Adobe Content Viewer missing

    Hi When i try to preview my folio with the preview option located in the folio builder pane in Indesign Cs 5.5 it says it cant find the adobe content viewer. Can anyone help

  • Update CC to CC (2014) version

    In our institution we installed the Creative Cloud desktop app without the Creative Cloud. Is there a way to upgrade to version 2014 through RUM (Remote Update Manager)? For test purposes, it does not update with the RUM tool!