How to add to viewPlatformBehavior an Action Event - a button press

And the main problem I have is to by pressing buttons to change the Viewing Platform?
I made same transformation to object, which reacts to key pressin:
public class LewoPrawo extends Behavior{
    private TransformGroup targetLP;
    private Transform3D wysuwanie = new Transform3D();
    private float krok2 = (float) 0.0;
     // create LewoPrawo
    LewoPrawo(TransformGroup targetLP){
    this.targetLP = targetLP;
     public void initialize(){           
            this. wakeupOn(new WakeupOnAWTEvent(AWTEvent.KEY_EVENT_MASK));
    public void processStimulus(Enumeration enumeration){
        this.wakeupOn(new WakeupOnAWTEvent(AWTEvent.KEY_EVENT_MASK));
            KeyEvent event = (KeyEvent) ((WakeupOnAWTEvent) enumeration.nextElement()).getAWTEvent()[0];
           if (event.getKeyCode() == KeyEvent.VK_Q) {
               krok2 += 0.01;
           if (event.getKeyCode() == KeyEvent.VK_W) {
               krok2 -= 0.01;
           wysuwanie.set(new Vector3f(krok2, 0.0f, 0.0f));
           wysuwanie.mul(przewrocenie);
           targetLP.setTransform(wysuwanie);
    }And this is the one that I made up to move the viewing platform, but it doesn't work!!!
public class Perspektywa extends ViewPlatformBehavior{
private TransformGroup targetVP;
private Transform3D obrot_obserwatora = new Transform3D();
private double kat=0.0;
//create Perspektywa
     Perspektywa(){
     public void initialize(){
     this.wakeupOn(new WakeupOnAWTEvent(AWTEvent.ACTION_EVENT_MASK));
     public void processStimulus(Enumeration enumeration){
     this.wakeupOn(new WakeupOnAWTEvent(AWTEvent.ACTION_EVENT_MASK));
ActionEvent event = (ActionEvent) ((WakeupOnAWTEvent) enumeration.nextElement()).getAWTEvent()[0];
     if (event.getSource()== przyciski[0])  {
           kat += 0.1;
       if (event.getSource() == przyciski[3]) {
           kat -= 0.1;
        obrot_obserwatora.rotY(kat);
        TransformGroup targetVP =
            simpleU.getViewingPlatform().getViewPlatformTransform();
        targetVP.getTransform( obrot_obserwatora);
}And what's worse, action events doesnt even work when i replace key events with them, but i don;t know why ;(

The section from the Swing tutorial on "General Rules for Using Text Components" has a sample program that does this:
http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html
Or, you can create a new Action using DefaultEditorKit.CopyAction

Similar Messages

  • How to add fingerprint to 5s? I can`t press add a fingerpint please HELP ios 8,0,2

    How to add fingerprint to 5s? I can`t press add a fingerpint please HELP ios 8,0,2

    Hi, SillDeividas.  
    Thank you for visiting Apple Support Communities. 
    Here is an article that I would recommend taking a look at for this issue.  
    Get help with Touch ID
    Make sure that you're using the latest version of iOS.
    Make sure that your fingers and the Home button are clean and dry.*
    Cover the Home button completely. Don't tap too quickly, don't press down hard, and don't move your finger while Touch ID is scanning. Make sure that your finger touches the metal ring around the Home button.
    If you're using a case or screen protector, make sure it doesn't cover the Home button or the surrounding ring. If it does, remove the case or screen protector and try again.
    Tap Settings > Touch ID & Passcode and make sure that iPhone Unlock or iTunes & App Store is on. Also make sure that you've enrolled one or more fingerprints.
    Try enrolling a different finger.
    If you can't enroll any of your fingers, take your device to an Apple Retail Store, Apple Authorized Service Provider, or contact AppleCare for help.
    * Moisture, lotions, sweat, oils, cuts, or dry skin might affect fingerprint recognition. Certain activities can also temporarily affect fingerprint recognition, including exercising, showering, swimming, cooking, or other conditions or changes that affect your fingerprint.
    iPhone 5s: Using Touch ID
    http://support.apple.com/kb/HT5883
    Cheers,
    Jason H.

  • How do you kick-off an action/event before a JSF Portlet is rendered?

    Hi,
    I am creating JSR-168 Portlets using Sun RI 1.1 and need the ability to call an action (ie. method) of the JSF Portlet before it is rendered. Any ideas how to do this?
    Scenario To Resolve
    If a customer is on the Check-Out Portal Page, the check-out portlet will initially display the shopping cart information.
    The customer will then click buy and the portlet will display a confirmation page.
    Now, if the customer decides to do additional shopping (ie. place a second order).
    The customer will navigate to a different Portal Page to browse items.
    Once the customer is done shopping, the customer will click Check-Out and the Portal will display the Check-Out Portal Page. Currently, when the check-out portlet is rendered, the portlet is automatically rendering the confirmation page (ie. the last state of the check-out portlet).
    Question
    How can I control the state of the portlet so that the initial state of the portlet is rendered (ie. the shopping cart information)?
    - Is there something built into the JSR-168 Spec? Or, Sun's JSF RI 1.1 that will enable me to kick-off an action/event before a JSF Portlet is rendered?
    - If this functionality is not built in, has anyone faced this challenge? If so, how did you extend the framework to resolve it?

    Hi,
    I am creating JSR-168 Portlets using Sun RI 1.1 and need the ability to call an action (ie. method) of the JSF Portlet before it is rendered. Any ideas how to do this?
    Scenario To Resolve
    If a customer is on the Check-Out Portal Page, the check-out portlet will initially display the shopping cart information.
    The customer will then click buy and the portlet will display a confirmation page.
    Now, if the customer decides to do additional shopping (ie. place a second order).
    The customer will navigate to a different Portal Page to browse items.
    Once the customer is done shopping, the customer will click Check-Out and the Portal will display the Check-Out Portal Page. Currently, when the check-out portlet is rendered, the portlet is automatically rendering the confirmation page (ie. the last state of the check-out portlet).
    Question
    How can I control the state of the portlet so that the initial state of the portlet is rendered (ie. the shopping cart information)?
    - Is there something built into the JSR-168 Spec? Or, Sun's JSF RI 1.1 that will enable me to kick-off an action/event before a JSF Portlet is rendered?
    - If this functionality is not built in, has anyone faced this challenge? If so, how did you extend the framework to resolve it?

  • How to add parametes in the action calss

    hello friends
    Iwant to add parametes in the action cladd
    <action
    path="/QuickSearch"
    type="app.struts.QuickSearchAction"
    name="quickSearchForm"
    scope="request"
    input="quickSearch.jsp"
    validate="true">
    <forward name="success" path="/jsp/appController.jsp"/>
    I need url like that "appController.jsp?name=namevalue&old=oldvalue"
    public class QuickSearchAction extends Action
        public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
            return mapping.findForward("success");
    }thanks
    </action>

    I try with
    public class QuickSearchAction extends Action
        public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
                ActionForward Myorward = mapping.findForward("success")
                Myorward.setPath("/jsp/appController.jsp?name=namevalue&old=oldvalue");
            return Myforward;
    }but it work not !!!!!!! please help me
    thanks

  • How to add screen elements at run time on button click in Web Dynpro abap?

    Hello All,
    I have a requirement wherein the user wants to add the textbox dynamically at runtime on button click action. My questions is, Is it feasible to dynamically add screen elements at runtime? If yes, how?
    Please help.
    Thanks

    Hi Ajinkya,
    This is absolutely possible! Adding view elements at runtime is called "dynamic programming". There are a lot of good resources and tutorials on SCN if you do a search. To start you off, here is an excellent series by Thomas Szücs:
    Dynamic Programming in Web Dynpro ABAP - Introduction and Part I: Understanding UI Elements
    Dynamic Programming in Web Dynpro ABAP - Part II: Handling ViewElements
    Dynamic Programming in Web Dynpro ABAP - Part III: Aggregations and DDIC-Binding of ViewElements
    Another option that avoids dynamic programming is to create the view element at design time but bind its visible property to a context attribute of type WDUI_VISIBILITY. You could initially set its visibility to "none" until the user clicks the button, then you could change its visibility to "visible".
    Cheers,
    Amy

  • How to add a minimize to system tray icon button?

    how can i add a minimize to system tray icon button near the others common buttons usually found on the upper right window bar? (i mean near the _ [] X)
    _ for minimize to taskbar
    [] for maximizing
    X for closing
    i'd like to add a fourth button to the left of the _ button for minimizing to system tray
    like in many programs the fourth button is a dot shaped one that minimizes the program to system tray
    i'd like to add one to my program as well, but i didnt find anything about this kind of buttons neither on google nor on java books
    can anyone help me?
    thank you!

    You can't (easily). The window decorations are controled by the operating system. Your best bet is to change the functionality of the minimize-to-taskbar button and make it into a minimize-to-tray button. In fact, all the programs that minimize to the tray on my computer - about 6 of them - do it this way.
    like in many programs the fourth button is a dot shaped one that minimizes the program to system trayI've never seen this?

  • Event when-button-pressed

    Hi,
    I am working on a form(10g) and I have a button on which I have a trigger when-button-pressed.
    I need to know if there's any function that I can use to capture the event of pressing the button. (I have a function in which I want to do : if the button was pressed do..., else do ....)
    Any ideeas on how to get the event?
    thaanks.

    in wnfi trigger use
    default_value('0','global.ur_variable');
    --this code puts a value of 0 if the variable is not assigned any value, yet                                                                                                                                                                                                                                                                                       

  • How to add web template in actions

    i want to add a website in my app using action i tried to do that with Http but website open in browser after using http option. i want  that website to be open inside the app like webtemplate

    hey there,
    you can't do it in the web, but you can make a diferent page in source code with a webview and navigate to it...

  • How to add bullet on every enter event in text field

    Hello, Can someone please point me in the right direction. I am trying to add a bullet every time someone presses enter on the keyboard. this is within a textfield.
    Thank you,
    Howard

    Hi
    I would solve it by a script that checks your multiline field for newlines by ENTER key and insert "* " in the beginning of each line.
    1) create a multiline field in your form
    2) insert the script below in exit event... and enjoy the magic ;)
    just 7 lines of code without comments. The split function is very powerful, I really use it alot now!
    ===== script start =====
    //value of the field to insert "* " in each line
    var sFldValue = this.rawValue;
    //you split text in field for each '\r' = newLines made with enter
    var tmpFldArray = sFldValue.split("\r");
    //tmp string you concat your out text in
    var sOutStr = "";
    //for each line of text insert '* ' in beginning
    for(var i = 0; i < tmpFldArray.length; i++){
    //need to add '\r' because split removed it
    sOutStr += "* " + tmpFldArray[i] + "\r";
    //return manipulated string to your field
    this.rawValue = sOutStr;
    ===== script end =====
    /Thomas Groenbaek
    Jyske Bank
    Denmark

  • In Custom Tag how to add h:commandbutton with action

    Hi, I created a custom tag in facelets (& Seam), below is the code snippet
    <tag>
    <tag-name>customdiv</tag-name>
    <component>
    <component-type>customtag.MyCustomTag</component-type>
    <component-class>com.mydomain.testing.customtag.MyCustomTag</component-class>
    </component>
    </tag>
    In this class I am using ResponseWriter to generate the content.
    I am trying to add a button and associate action to it but it doesn't provide me any option to associate action to the commandbutton
    "<h:commandButton action="#{childdiv.addChildDiv}" value="add div"></h:commandButton>"
    Also the XHTML doesn't even recognize the h:commandbutton tag
    "HtmlCommandButton htmlCommandButton = new HtmlCommandButton();
    writer.startElement("h:commandButton", htmlCommandButton);
    writer.writeAttribute("value", "add div", "");
    writer.endElement("h:commandButton");"
    Please suggest

    JSF<h:form>
        <h:dataTable value="#{myBean.dataList}" var="dataItem">
            <h:column>
                <h:selectManyListbox value="#{dataItem.selectedItems}">
                    <f:selectItems value="#{myBean.selectItems}" />
                    <%-- Or use value="#{dataItem.selectItems}" if it does depend per row. --%>
                </h:selectManyListbox>
            </h:column>
        </h:dataTable>
        <h:commandButton value="add" action="#{myBean.add}" />
        <h:commandButton value="save" action="#{myBean.save}" />
    </h:form>MyBean (session scoped)private List<DataItem> dataList; // +getter
    private List<SelectItem> selectItems; // +getter
    public MyBean() {
        dataList = new ArrayList<DataItem>();
        // Do your thing. It is just a stub example.
        selectItems = new ArrayList<SelectItem>();
        selectItems.add(new SelectItem("value1", "label1"));
        selectItems.add(new SelectItem("value2", "label2"));
        selectItems.add(new SelectItem("value3", "label3"));
    public void add() {
        dataList.add(new DataItem());
    public void save() {
        // Do your thing to save the dataList. All values are already set in there.
        // Just doing a sysout here to prove it.
        System.out.println("Saved: " + dataList);
    }DataItemprivate List<String> selectedItems; // +getter +setter
    // Just for convenience so that it is readable in the sysout.
    public String toString() {
        return "DataItem[" + selectedItems + "]";
    }For more about datatables you may find this article useful: [http://balusc.blogspot.com/2006/06/using-datatables.html].

  • How to add app to " complete action using "?

    I cant seem to find any setting to change apps in complete action using app list...I want to add another app while editing photos to the dialogue &quot;complete action using &quot;.... Plz help

    So you want to be asked to open a specific media file with other apps? Try settings-apps-all,tap on 3 dots(settings) and reset app preferences.
    All we have to decide is what to do with the time that is given to us - J.R.R. Tolkien

  • How to add acrobat command in action

    Hi All,
    Actually I am performing some common steps in every pdf file to get desired result. Is there an way to record steps in acrobat like we do in photoshop.
    Many thanks..

    OK, Thanks for that,
    I need to remove PDF/X setting, In document property initial view should be fit page, pdf open to first page.
    Is is ok to include this in action.
    again many thanks

  • AddChild(new button()) - How to add a name to this new created button

    Hello,
    Lost my old nickname, i was Pluda, now exPluda?.
    well, tring to use a loop to add some buttons to my work, but need to reference their names so I can have diferent x positions for each. How to do that?
    for ( var sm:uint = 0; sm < sub_menus.length; sm ++ ) {
            hsm.addChild(new bt_sub_menus());
            hsm.bt_sub_menus.x -= hsm.x-10;
            hsm.bt_sub_menus.y = hsm.bt_sub_menus.height+sm*15;
    this does not work, i just get one button placed where I want.
    Thanks!

    Hello,
    it works, but the first button doesn't places himself at hsm.x as he should.
    this is so far one of my greatest difficulties in AS3, controling events inside loops.
    in as2 we could use something like
    function whatever() {
         n = 0;
         for(n = 0; n<20; n++) {
              do stuff here, like per example fade in of movieclip
              n++
    in as3 I can't make this, I tried during this week to have some movieclips to place themselfs inside one sprite, using one timer to make each placement every 2 seconds. No results... they all are placed at same time.
    Its been dificult this as2 to as3 transition, (I just purchase flash cs 3 a couple of monts)
    Thanks

  • How to Add A Javascript Confirm() on an Apex button for a form?

    Hi, how can I add a Javascript confirm() to a button in Apex for a form? Thanks.

    Hello:
    You could do the following
    1)In the 'Option URL Redirect' section of the Edit Button page set 'Target is a ' to 'URL'
    2)For URL Target enter javascript:{if (confirm('Your Question here')) doSubmit('<button name>');}Varad
    Edited by: varad acharya on Jul 15, 2009 3:47 PM

  • How to Add a Captivate 6 project to a Word Press page?

    I am using Word Press as my website. I have some projects that need to be place in the website but I don't know how to do this. The main problem is that the project a big, around 4 GB in size and they been place in my FTP.
    I just finish converting the project into HTML5 and now I want to place it in the web with the capability of playing in flash and also HTML5.
    Is anyone know how to do this, or maybe had the code for it?
    Thanks for the help.
    Cristian

    Hello Christian,
    I have not tried this but i found some threads which might be helpful for you : http://forums.adobe.com/thread/967803
    http://forums.adobe.com/message/5632353
    Thanks and Regards
    Himanshu Satija

Maybe you are looking for

  • Latest version of Adobe Reader won't let me annotate

    I have been using the Adobe Reader 11 app to open PDFs and annotate them. The revised pdf is then uploaded to Dropbox and the reps in the field can download and continue annotating the same file. The field reps use iPads and/or iPhones but since the

  • Java.lang in parse method of javax.mail.internet.MimeMessage.addRecipients

    how to solve

  • JDBC Comm Channel not Polling data

    Hello, In a JDBC to IDoc scenario, we have a sender JDBC communication channel which was set to poll for data in every 60 sec. It was working fine for long and suddenly it has stopped polling data. It's status was green and the channel was active.We

  • Join retrieving duplicate records

    Can someone tell me why I am returning 10 records when there only should be one. I can put in a delete duplicates record after this but i would prefer to know what is wrong with the below. Tnks.   SELECT MARAMATNR MARAPRDHA          MAKTMAKTX T179TVT

  • Can iFrames be used...

    to display in chm page pdf content? I tried to put an iFrame in a topic and it works great in preview but when I generate the chm it starts  Acrobat and opens the file in a separate window. Is there a trick to this?