HELP NEEDED :Button to link to form with passed key

Hi all,
I have a UIX view form that returns the result of the search.
I have an update button and a delete button that find the current record and navigate to the update screen or delete the record.
I want another button that navigates to a screen, passing the same key.
I hope I am making sense, here is a snippet of the page :
<header text="Results" >
<contents>
<form name="viewForm" method="POST" >
<contents>
<tableLayout>
<contents>
<bc4j:viewObjectScope name="ActivityPlanView1" >
<contents>
<bc4j:table name="viewTable" width="100%"
alternateText="No rows found"
proxied="true">
<tableSelection>
<!-- single selection for each row in the table -->
<singleSelection selectedIndex="0" shortDesc="Select Row">
<contents>
<!-- the update button causes the currently selected
row to be sent to the update page -->
<button text="Update"
onClick="return checkUpdate();"/>
<!--ctrl:event="update" /-->
<!-- the delete button causes the currently selected
row to be removed -->
<submitButton text="Delete"
ctrl:event="delete" />
</contents>
</singleSelection>
</tableSelection>
<!-- the key identifying the current row in the table -->
<bc4j:keyStamp>
<bc4j:rowKey name="key"/>
</bc4j:keyStamp>
<contents>
<formValue name="ActApp">
<boundAttribute name="value">
<bc4j:attrValue name="ActivityApproved"/>
</boundAttribute>
</formValue>
I thought, somehow combining this into the button will do it, but I don't know how :
<link>
<boundAttribute name="text">
<bc4j:attrValue/>
</boundAttribute>
<boundAttribute name="destination">
<ctrl:pageURL name="AssemblyActivityAssemblyType1_Create">
<ctrl:properties>
<ctrl:property key="key">
<boundAttribute name="value">
<bc4j:rowProperty name="key" />
</boundAttribute>
</ctrl:property>
</ctrl:properties>
</ctrl:pageURL>
</boundAttribute>
</link>
Thanks
Adeel

Somehow like this...
bye,
Viktor
<bc4j:table>
<bc4j:column...
<bc4j:column name="Muveletek" rendered="true">
<contents>
   <flowLayout><contents>
      <link text="Hír">
          <boundAttribute name="onClick">
            <concat>
             <fixed text="javascript:location.href= 'PhiPrtFkViewLink_View.uix"/>
             <fixed text="?bajaPage=key2="/>
             <dataObject select="key"/>
            <fixed text="&amp;event=keres'"/>
          </concat>
                                          </boundAttribute>
         </link>
     <link text=....                                     </link>
                                        </contents>
                                        </flowLayout>
                                      </contents>
                                    </bc4j:column>
                                  </contents>
                                </bc4j:table>

Similar Messages

  • How to link a form with MSC2N

    Hi,
    Somebody know how to link a form with MSC2N.
    I want to complete the characteristic in the classification and after I want to print them with MSC2N;
    Thanks a lot for your help.
    Best regards
    Kari

    I explain you my problem.
    I want to link a form with MSC2N in order to print all the characteristic, and  all the informations of the good issue.
    That's why I want to link a form with MSC2N.
    My customer ask me to ceate a form with these informations and I don't kow how to join the characteristics in MSC2N and the datas which come from MIGO.
    Somebody could help me?
    Thanks a lot
    Kari

  • Link a form with MSC2N

    Hi,
    Somebody know how to link a form with MSC2N.
    I want to complete the characteristic in the classification and after I want to print them with MSC2N;
    Thanks a lot for your help.
    Best regards
    Kari

    I explain you my problem.
    I want to link a form with MSC2N in order to print all the characteristic, and  all the informations of the good issue.
    That's why I want to link a form with MSC2N.
    My customer ask me to ceate a form with these informations and I don't kow how to join the characteristics in MSC2N and the datas which come from MIGO.
    Somebody could help me?
    Thanks a lot
    Kari

  • Submitting form with Enter key

    Hello,
    in standard html form, when you have form with submit button, the enter key when any form element is selected submits the form.
    This is very convenient for users, so I want this with UIX forms. I know it is possible (I have one form where it is working), but I can't get it working anywhere else.
    This code works:
    <uix:form method="post" name="newRoleForm">
    <uix:inlineMessage prompt="Role name">
    <uix:textInput name="newRoleName" />
    <uix:spacer width="15" />
    <uix:submitButton text="Create" formName="newRoleForm" />
    </uix:inlineMessage>
    <uix:formValue name="jboEvent" value="newRole" />
    </uix:form>
    When I copy this code to another page, it does not work...
    Can somebody help, please?

    I've studied the HTML generated by UIX and it has following bugs and misfeatures:
    1. Misfeature: Submitting with Enter works ONLY if there is exactly one text field in the form (no submit button is actually needed), as Brian Stoler wrote. I don't understand reason for this.
    2. Bug: UIX generates javascript function "_submitOnEnter" which is called as event handler for "onKeyPress" event. But this function is erroneously generated multiple times, once for each form in the page. Browsers (Mozilla and IE) use the latest implementation. This function is different for forms with one text field and for forms with more text field, but only the first one can do the job. As a consequence of this, Enter can submit the form only if the last form on a page has single text field (which is for example not the case of search form with single field above another form...)
    Tested with UIX 2.1.7 in JDeveloper 9.0.3.3, using UIX as JSP tag library.
    Workaround:
    1. Use Opera browser: it submits form with enter key even if there is no submit button (this does not work for the first text field in the form, because it has "onkeypress" event handler).
    2. Implement this feature by hand yourself, if you really need it (see below).
    3. Use accessKey: allows to submit form with Alt+<key> combination (followed by Enter with IE).
    Implementing Enter key submits with Javascript:
    1. Put the following function to the header (or to javascript library):
    function enter(e, frm) {
    var kc;
    if(window.event) kc=window.event.keyCode;
    else if(e) kc=e.which;
    else return true;
    if(kc==13) {
    submitForm(frm,1);
    return false;
    Function copied from UIX (C).
    2. Add this event handler to each input element:
    onKeyPress="return enter(event, 'formName');"
    It is obvious that this is error prone, but it works with all browsers...
    Will this be fixed in future versions?
    Why only form with one text field can be submitted?

  • Add button to SharePoint 2013 form with InfoPath and/or SharePoint designer

    Since I am new to working with Sharepoint 2013, I have the following questions to ask you about Infopath 2013 and possibly SharePoint Desinger 2013:
    1. Yesterday I created a custom list in my 'test area of SharePoint' and opened the list in Infopath 2013 to see what the form would look like. Now I have alot more columns and edits to add to the list. I am planning to add more columns to the list when
    I am in my 'test area' and then make cosmetic changes to the form using Infopath 2013. I am thinking that if I continue this way, I may lose some ediut changes I have made using Infopath 2013. Thus can you tell me the best way to add more columns to the list
    and/or modify the existing columns and not lose the edit changes that I made using Infopath 2013?
    2. The infopath 2013 form does not contain any buttons to click. I need a button to show up for every user to click so that a workflow can be started. Do I need some kind of a task list(action)? Thus can you tell me how to add this type of a button to the
    form?

    Wendy, Please go through this video from
    channel 9 (http://channel9.msdn.com/Blogs/NickDallett/InfoPath-2010-Customize-a-SharePoint-List-Form)  which will uilding froom explain similar form building from scratch.
    As per Peter's replay yes you can update form even after add columns in list and you can add extar control like button to your infopath form.
    Workflows are usually started when creating or updating an item inside a SharePoint document library. 
    Open the workflow in SharePoint Designer and under "Start Options' on the workflow's home page, remove the check from "Start workflow manually...". Be sure the check either "Start on create..." or "Start on change...". In
    your case I think you would use "Start on create...".
    Hope these inputs will help
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Best way to link user form with user table

    Hi all.
    What is the best way to link an user form with a user table (with all of the functions, add, update...)? I have created a simple form, and the question is next:
    depending the type object of the user table (document, master...) i have facilities to imlement the basic operations in the form?  if i create an UDO i have the functions but i want to use the form that i created with a screen painter.
    Thanks.

    Hi again i want add a new comment please.
    If i want do all functions (add,update...) of my form in my user table, and i want my user table is a <b>type document</b>? how can add new lines in my user table with objet <b>type document</b>? because when i make the instance i nedd to say what type of document is (item,order...) and when i do an add(), not add() in my user table. In what moment or how can assign that the add,update functions... affect in my table?
    Thanks again.

  • Please help me to link ADOBE forms with portal screen?

    Hey friends,
                 Im working lot with ADOBE forms for past few weeks.... with <b>sample</b> realtime test scenarios(Test) ,but im getting n.. no of doubts regarding creation of adobe forms and make it work in our portal screen...I have adobe lifecycle designer 7.1 installed in my machine...
    Ques is
    1)After creating adobe form in SAP SFP transaction ,how can i make it link with WEBportal(make it visible in portal screen)
    2)To make it interactive with workflows.....I have lot of documents,but still in confusion...
    Anyone please explain me briefly on this....thanks in advance
    Thanks
    Pavi

    In Editor Expert tab, go to Edit menu>Preferences>General, and check "Allow Floating Documents in full edit mode." This should allow you to tile or cascade.

  • Need Guidance to create a form with Upload,browser and clear button

    Task :1) Browse should open a dialog box window for user to select an excel file on his local machine. Once the name of file is on the ticket item file name, the upload button should load data of this file into a database stage table.
    2) Host being called from forms u .Once it reaches server it is easy to load in DB via forms
    3) File transfer should happen automatically when user presses the button on form the code in the button should make use of host command and fire command to move the file.
    version :-FORMS10g , OS - XP

    Have you tried searching the web?  There are numerous examples of how to read and Excel file into a Form.  Here is just one, for example: WebUtil: How to Read an Excel file into an Oracle Form .  This example can easily be modified to write the file to a table versus displaying it in the form.  Or...you could simply read the file into a base table block and use standard Forms Commit processing to save the data to your table.
    Craig...

  • Tabular Form with updateable keys??? Help!!

    I have been trying to set up a timesheet/scheduling package using my PT job as a real world framework from which to pull ideas. The job is at a concert venue.
    The idea is to be able to schedule an event, then add existing employees and add the appropriate employee to that event.
    I have the tables already setup: EVENTS which consists of 'event_name', event_time_and_date, unique_event_id(priKey), etc... Employees which is first,last,empnum(priKey),etc.... And most importantly a Schedule table which is empnum(priKey,foreign to employees), eventid(secKey,foreign(sp?) to unique_event_id), time in, time out, etc....
    Everything is great except that I cannot add an employee to an event using the Tabular Form as the empnum primary key needs to be defined by a dropdown LOV(my criterea) and the eventid needs to be defaulted to the passed in value. It seems the Form is not setup to operate that way. I have included a link to my mock-up on oracle's free HTMLDB space so that the lucky individual who decides to aide this lost soul can see what I'm on about. I have been able to do it via single drop downs, but that is one person at a time. The table is the best way visually to see who has, and has yet to be added to an event.
    http://htmldb.oracle.com/pls/otn/f?p=38803:1
    Click on schedule and choose 'Assign Employee' and click the event in January to get to the 'Add Employee' page.
    The number present on the page should be hidden but is visible for debugging purposes. It is the unique event ID that the SQL bind refers to filter the list to the event in question.
    Thank you very much,
    brux2dc

    From the trigger code I see a new PK being generated. Just so I am understanding what is going on, the new pk will in no way be used except to keep the tabular form in order.
    The data in the intersection table will look like this:
    EMPNUM(PK) | EVENTID(PK)
    1 | 1001
    1 | 1002
    1 | 1003
    2 | 1001
    2 | 1003
    3 | 1002
    The tabular form will enter data so that an already existing eventid will be associated with multiple empnums. The eventid is passed to a hidden textbox. This is where the fixed eventid comes form and the empnums become the only variable per new row.
    What should happen when I click on Add Row is that a new row appears with the eventid already set as PK1 and the LOV with EMPNUM as PK2. So before insert the screen would have:
    EMPNUM(PK) | EVENTID(PK)
    1 | 1001
    2 | 1001
    3 | 1001
    5 | 1001
    I just wanted to clarify further what my intent is. I appreciate all your help so far.
    brux2dc

  • Help needed to stop Flash stuffing up with firefox

    I am getting the "Shockwave flash may be busy or it may have stopped responding. You can stop the plugin now or you can continue to see if the plugin will complete. "
    It is a most frustrating error as neither the Continue or Stop options help at all.
    I have searched on the error and all I find is that lots of others have the same problem and it is driving them crazy too. Any suggested fixes seem to be either a technical work-around that may be more of a problem in the long-term or don't seem to work. I'm not a tech person but I've been able to sort out most similar problems in the past.
    I'm using Firefox 21.0 with Shockwave Flash 11.7.700.202 on Windows 7.
    I don't know where to turn to for help.

    Please take a look at this post for details on what we'll need to investigate:
    How do I report a Flash Player crash to Adobe?
    You can either create a bug or post back with the information in a forum reply.  In addition, please make sure you include your 5 most recent report ID links found when you visit the "about:crashes" page in Firefox's address bar.

  • Tcp/ip write help - need to send a motor command with parameters

    hello - i have one small, main labview 7.0 vi that i use to control a drill's two motors.
    right now i press a button on the front panel to move the motor, and when i do, a sub vi window pops up so the operator can set a couple of parameters and press an ok button.....the vi then sends the command with the parameters to the drill's motors.
    i am trying to change it so i can send the move command from another computer, in another room, while the main vi sits on the computer with the drill. i know i will use TCP listen, write, read, and close in both the main vi (the TCP server?) and the client which is on the remote computer.
    my problem is with setting the parameters for the subvi's that usually pops up. how do i set the parameters from the remote-client and have them be sent into the subvi on the main vi. if i can do this, i would have to also have a way to close the sub vi after it pops up in the main program too.
    OR should i use something else like and application reference or an invoke node function?????
    please help
    thanks!!!!
    sam

    Hi again,
    If the VI in the lab will be running continuously, then you will need
    to alter some things from the example I sent you or look at an
    alternate implementation. The example I sent you assumed that the VI in
    the lab was not running. This technique actually starts the VI and runs
    it somewhat like a subVI. It inputs values into the connector pane,
    runs it, and then returns values from the outputs on the connector pane
    after it finishes executing. It will not work to call a VI by reference
    if it is already continuously running.
    Instead I imagine you would want to have your VI in the lab have some
    sort of State Machine that polls a certain control value, such as an
    enum control, to determine which state to execute next. You could
    modify the technique I first sent to still open a reference to the VI
    in the lab, but it wouldn't try to run it. Instead you could use the VI
    method Set Control Value to set the value of a certain control or
    controls in the lab VI to certain values. The VI in the lab would then
    hopefully be in some Idle state where it polled one of those control
    values continuously to decide what to do next. That would allow the VI
    in the office to programmatically send commands to the other VI, as
    well as parameters for those commands. Simply set control values for
    the VI in the lab and let the VI in the lab go about its business. I've
    attached an example below.
    That's just one idea. Other options you have would be to use a
    DataSocket connection to send parameters and commands back and forth
    between computers. This is a pretty simple API to use. If you have
    LabVIEW 8, Shared Variables are an option. Or you might look into
    simply using Remote Front panels, which allows you to connect to a VIs
    Front Panel across the network. You could then have the whole VI in the
    Lab, but you could connect to it, view it, modify the controls and so
    on from your office. If you want to view and control a VI without
    having LabVIEW installed on the viewing computer, you can use the Web
    Publishing Tool to create a web interface for your front panel. Lots of
    options. Let me know what sounds interesting.
    Jarrod S.
    National Instruments
    Attachments:
    Lab_VI.vi ‏29 KB
    Office_VI.vi ‏51 KB

  • Help needed creating a linked list program

    I have been trying to create a linked list program that takes in a word and its definition and adds the word to a link list followed by the definition. i.e. java - a simple platform-independent object-oriented programming language.
    the thing is that of course words must be added and removed from the list. so i am going to use the compareTo method. Basically there a 2 problems
    1: some syntax problem which is causing my add and remove method not to be seen from the WordList class
    2: Do I HAVE to use the iterator class to go thru the list? I understand how the iterator works but i see no need for it.
    I just need to be pointed in the right direction im a little lost.................
    your help would be greatly appreciated i've been working on this over a week i dont like linked list..........
    Here are my 4 classes of code........
    * Dictionary.java
    * Created on November 4, 2007, 10:53 PM
    * A class Dictionary that implements the other classes.
    * @author Denis
    import javax.swing.JOptionPane;
    /* testWordList.java
    * Created on November 10, 2007, 11:50 AM
    * @author Denis
    public class Dictionary {
        /** Creates a new instance of testWordList */
        public Dictionary() {
            boolean done=false;
    String in="";
    while(done!=true)
    in = JOptionPane.showInputDialog("Type 1 to add to Dictionary, 2 to remove from Dictionary, 3 to Print Dictionary, and 4 to Quit");
    int num = Integer.parseInt(in);
    switch (num){
    case 1:
    String toAdd = JOptionPane.showInputDialog("Please Key in the Word a dash and the definition.");
    add(toAdd);
    break;
    case 2:
    String toDelete = JOptionPane.showInputDialog("What would you like to remove?");
    remove(toDelete);
    break;
    case 3:
    for(Word e: list)
    System.out.println(e);
    break;
    case 4:
    System.out.println("Transaction complete.");
    done = true;
    break;
    default:
    done = true;
    break;
       }//end switch
      }//end while
    }//end Dictionary
    }//end main
    import java.util.Iterator;
    /* WordList.java
    * Created on November 4, 2007, 10:40 PM
    *A class WordList that creates and maintains a linked list of words and their meanings in lexicographical order.
    * @author Denis*/
    public class WordList{
        WordNode list;
        //Iterator<WordList> i = list.iterator();
        /*public void main(String [] args)
        while(i.hasNext())
        WordNode w = i.next();
        String s = w.word.getWord();
        void WordList() {
          list = null;
        void add(Word b)
            WordNode temp = new WordNode(b);
            WordNode current,previous = null;
            boolean found = false;
            try{
            if(list == null)
                list=temp;
            else{
                current = list;
                while(current != null && !found)
                    if(temp.object.getWord().compareTo(current.object.getWord())<0)
                        found = true;
                    else{
                    previous=current;
                    current=current.next;
                temp.next=current;
                if(previous==null)
                    list=temp;
                else
                    previous.next=temp;
                }//end else
            }//end try
            catch (NullPointerException e)
                System.out.println("Catch at line 46");
        }//end add
    /*WordNode.java
    * Created on November 4, 2007, 10:40 PM
    *A class WordNode that contains a Word object of information and a link field that will contain the address of the next WordNode.
    * @author Denis
    public class WordNode {
        Word object;//Word object of information
        WordNode next;//link field that will contain the address of the next WordNode.
        WordNode object2;
        public WordNode (WordNode wrd)
             object2 = wrd;
             next = null;
        WordNode(Word x)
            object = x;
            next = null;
        WordNode list = null;
        //WordNode list = new WordNode("z");
        Word getWord()
            return object;
        WordNode getNode()
            return next;
    import javax.swing.JOptionPane;
    /* Word.java
    * Created on November 4, 2007, 10:39 PM
    * A class Word that holds the name of a word and its meaning.
    * @author Denis
    public class Word {
        private String word = " ";
        /** Creates a new instance of Word with the definition*/
        public Word(String w) {
            word = w;
        String getWord(){
            return word;
    }

    zoemayne wrote:
    java:26: cannot find symbol
    symbol  : method add(java.lang.String)
    location: class Dictionary
    add(toAdd);this is in the dictionary class
    generic messageThat's because there is no add(...) method in your Dictionary class: the add(...) method is in your WordList class.
    To answer your next question "+how do I add things to my list then?+": Well, you need to create an instance of your WordList class and call the add(...) method on that instance.
    Here's an example of instantiating an object and invoking a method on that instance:
    Integer i = new Integer(6); // create an instance of Integer
    System.out.println(i.toString()); // call it's toString() method and display it on the "stdout"

  • Code troubleshooting help needed - buttons spawning 2 apps

    Hi,
    I'm trying to do a question out of my Java text book and I'm a little confused why its not working correctly. There's 2 buttons on a frame that when clicked start the app behind them... one is a basic calculator, the other is a little applet to compute a mortgage. The second button is not reacting like the first does AND the Mortgage applet behind that button does not start-up properly... the box opens but nothing in the frame is visible.
    The first thing I need to be explained is that in the Mortgage section why I can't change it into an application from an applet without receiving an error. On my separate Mortgage applet (standalone) I switched it from applet to application by adding the following:
      public static void main(String[] args) {
         //create a frame
         JFrame frame = new JFrame (
              "Running a program as applet and frame");
         //create an instance of MortgageApplet
         MortgageApplet applet = new MortgageApplet();
         //add the applet instance to the frame
         frame.getContentPane().add(applet, BorderLayout.CENTER);
         //invoke init and start
         applet.init();
         applet.start();
         //display the frame
         frame.setSize(300, 300);     
         frame.setVisible(true);
         }But when I add that code to this exercise with the 2 buttons kicking the 2 sub apps off I get the following error...
    Exercise12_17.java:130: cannot resolve symbol
    symbol  : method start ()
    location: class MortgageApplet
            applet.start();So because of that I have that section of the code commented out below.... I copied that straight from my book and[b] it works when its standalone but not within this bigger app I'll paste below.
    The second thing I need explained is why does the second button not behave like the first button...
    If you click the first button it starts the calculator and then shows a "hide calculator" button to hide the calculator application. And if you click that hide button you return to the original menu with the 2 buttons (Calc & Mortgage) to choose from. But if you click the Mortgage button it brings up the Mortgage app (which currently is not working correctly in here) BUT does not show me the "Hide Mortgage" button... it jumps to the "Simple Calculator" button.
    My assumption is it has something to do with the If-Else if actionPerformed argument I have in the code below but I'm not entirely sure.
    Does anyone have answers to me 2 questions??...
    (1) do I need to change the mortgage applet to application & why am I getting that error when trying to do so? ...... and ......
    (2) why does my 2nd button on the main menu not get the "hide mortgage" button after starting the mortgage app & how would I correct it? (I assume that if I solve problem #1 it'll spawn the app correctly in part 2 when it starts).
    Any help would be greatly appreciated... thank you. :-)
    Rob
    -------------------------entire app below--------------------
    // Exercise12_17.java: Create multiple windows - Simple Calc & MortgageApplet
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.TitledBorder;
    public class Exercise12_17 extends JFrame implements ActionListener {
      // Declare and create a frame: an instance of MenuDemo
      MenuDemo calcFrame = new MenuDemo();
      // Declare and create a frame: an instance of MortgageApplet
      MortgageApplet mortgageAppletFrame = new MortgageApplet();
      // Declare two buttons for displaying frames
      private JButton jbtCalc;
      private JButton jbtMortgage;
      public static void main(String[] args) {
        Exercise12_17 frame = new Exercise12_17();
        frame.pack();
        frame.setTitle("Exercise 12.17: Multiple Windows Demo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
      public Exercise12_17() {
        // Add buttons to the main frame
        getContentPane().setLayout(new FlowLayout());
        getContentPane().add(jbtCalc = new JButton("Simple Calculator"));
        getContentPane().add(jbtMortgage = new JButton("Mortgage"));
        // Register the main frame as listener for the buttons
        jbtCalc.addActionListener(this);
        jbtMortgage.addActionListener(this);
      public void actionPerformed(ActionEvent e) {
        String arg = e.getActionCommand();
        if (e.getSource() instanceof JButton)
          if ("Simple Calculator".equals(arg)) {
            //show the MenuDemo frame
            jbtCalc.setText("Hide Simple Calculator");
            calcFrame.pack();
            calcFrame.setVisible(true);
          else if ("Hide Simple Calculator".equals(arg)) {
            calcFrame.setVisible(false);
            jbtCalc.setText("Simple Calculator");
          else if ("Mortgage".equals(arg)) {
            //show the Mortgage frame
            mortgageAppletFrame.pack();
            jbtMortgage.setText("Hide Mortgage");
            mortgageAppletFrame.setVisible(true);
          else if ("Mortgage".equals(arg)) {
            mortgageAppletFrame.setVisible(false);
            jbtMortgage.setText("Mortgage");
      class MortgageApplet extends JFrame implements ActionListener {
      // Declare and create text fields for interest rate
      // year, loan amount, monthly payment, and total payment
      private JTextField jtfAnnualInterestRate = new JTextField();
      private JTextField jtfNumOfYears = new JTextField();
      private JTextField jtfLoanAmount = new JTextField();
      private JTextField jtfMonthlyPayment = new JTextField();
      private JTextField jtfTotalPayment = new JTextField();
      // Declare and create a Compute Mortgage button
      private JButton jbtComputeMortgage = new JButton("Compute Mortgage");
      /** Initialize user interface */
      public void init() {
        // Set properties on the text fields
        jtfMonthlyPayment.setEditable(false);
        jtfTotalPayment.setEditable(false);
        // Right align text fields
        jtfAnnualInterestRate.setHorizontalAlignment(JTextField.RIGHT);
        jtfNumOfYears.setHorizontalAlignment(JTextField.RIGHT);
        jtfLoanAmount.setHorizontalAlignment(JTextField.RIGHT);
        jtfMonthlyPayment.setHorizontalAlignment(JTextField.RIGHT);
        jtfTotalPayment.setHorizontalAlignment(JTextField.RIGHT);
        // Panel p1 to hold labels and text fields
        JPanel p1 = new JPanel();
        p1.setLayout(new GridLayout(5, 2));
        p1.add(new Label("Annual Interest Rate"));
        p1.add(jtfAnnualInterestRate);
        p1.add(new Label("Number of Years"));
        p1.add(jtfNumOfYears);
        p1.add(new Label("Loan Amount"));
        p1.add(jtfLoanAmount);
        p1.add(new Label("Monthly Payment"));
        p1.add(jtfMonthlyPayment);
        p1.add(new Label("Total Payment"));
        p1.add(jtfTotalPayment);
        p1.setBorder(new TitledBorder("Enter interest rate, year and loan amount"));
        // Panel p2 to hold the button
        JPanel p2 = new JPanel();
        p2.setLayout(new FlowLayout(FlowLayout.RIGHT));
        p2.add(jbtComputeMortgage);
        // Add the components to the applet
        getContentPane().add(p1, BorderLayout.CENTER);
        getContentPane().add(p2, BorderLayout.SOUTH);
        // Register listener
        jbtComputeMortgage.addActionListener(this);
      //*********ADDED THIS SECTION below TO MAKE APPLET AN APPLICATION***********
    //  public static void main(String[] args) {
         //create a frame
    //     JFrame frame = new JFrame (
    //          "Running a program as applet and frame");
         //create an instance of MortgageApplet
    //     MortgageApplet applet = new MortgageApplet();
         //add the applet instance to the frame
    //     frame.getContentPane().add(applet, BorderLayout.CENTER);
         //invoke init and start
    //     applet.init();
    //     applet.start();
         //display the frame
    //     frame.setSize(300, 300);     
    //     frame.setVisible(true);
      //*********ADDED THIS SECTION above TO MAKE APPLET AN APPLICATION***********
      /** Handle the "Compute Mortgage" button */
      public void actionPerformed(ActionEvent e) {
        if (e.getSource() == jbtComputeMortgage) {
          // Get values from text fields
          double interest = (Double.valueOf(
            jtfAnnualInterestRate.getText())).doubleValue();
          int year =
            (Integer.valueOf(jtfNumOfYears.getText())).intValue();
          double loan =
            (Double.valueOf(jtfLoanAmount.getText())).doubleValue();
          // Create a mortgage object
          Mortgage m = new Mortgage(interest, year, loan);
          // Display monthly payment and total payment
          jtfMonthlyPayment.setText(String.valueOf(m.monthlyPayment()));
          jtfTotalPayment.setText(String.valueOf(m.totalPayment()));
    class MenuDemo extends JFrame implements ActionListener {
      // Text fields for Number 1, Number 2, and Result
      private JTextField jtfNum1, jtfNum2, jtfResult;
      // Buttons "Add", "Subtract", "Multiply" and "Divide"
      private JButton jbtAdd, jbtSub, jbtMul, jbtDiv;
      // Menu items "Add", "Subtract", "Multiply","Divide" and "Close"
      private JMenuItem jmiAdd, jmiSub, jmiMul, jmiDiv, jmiClose;
      /** Main method */
      public void main(String[] args) {  //Change-was public static void main(String[] args)
        MenuDemo frame = new MenuDemo();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
      /** Default constructor */
      public MenuDemo() {
        setTitle("Menu Demo");
        // Create menu bar
        JMenuBar jmb = new JMenuBar();
        // Set menu bar to the frame
        setJMenuBar(jmb);
        // Add menu "Operation" to menu bar
        JMenu operationMenu = new JMenu("Operation");
        operationMenu.setMnemonic('O');
        jmb.add(operationMenu);
        // Add menu "Exit" in menu bar
        JMenu exitMenu = new JMenu("Exit");
        exitMenu.setMnemonic('E');
        jmb.add(exitMenu);
        // Add menu items with mnemonics to menu "Operation"
        operationMenu.add(jmiAdd= new JMenuItem("Add", 'A'));
        operationMenu.add(jmiSub = new JMenuItem("Subtract", 'S'));
        operationMenu.add(jmiMul = new JMenuItem("Multiply", 'M'));
        operationMenu.add(jmiDiv = new JMenuItem("Divide", 'D'));
        exitMenu.add(jmiClose = new JMenuItem("Close", 'C'));
        // Set keyboard accelerators
        jmiAdd.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.CTRL_MASK));
        jmiSub.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
        jmiMul.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_M, ActionEvent.CTRL_MASK));
        jmiDiv.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_D, ActionEvent.CTRL_MASK));
        // Panel p1 to hold text fields and labels
        JPanel p1 = new JPanel();
        p1.setLayout(new FlowLayout());
        p1.add(new JLabel("Number 1"));
        p1.add(jtfNum1 = new JTextField(3));
        p1.add(new JLabel("Number 2"));
        p1.add(jtfNum2 = new JTextField(3));
        p1.add(new JLabel("Result"));
        p1.add(jtfResult = new JTextField(4));
        jtfResult.setEditable(false);
        // Panel p2 to hold buttons
        JPanel p2 = new JPanel();
        p2.setLayout(new FlowLayout());
        p2.add(jbtAdd = new JButton("Add"));
        p2.add(jbtSub = new JButton("Subtract"));
        p2.add(jbtMul = new JButton("Multiply"));
        p2.add(jbtDiv = new JButton("Divide"));
        // Add panels to the frame
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(p1, BorderLayout.CENTER);
        getContentPane().add(p2, BorderLayout.SOUTH);
        // Register listeners
        jbtAdd.addActionListener(this);
        jbtSub.addActionListener(this);
        jbtMul.addActionListener(this);
        jbtDiv.addActionListener(this);
        jmiAdd.addActionListener(this);
        jmiSub.addActionListener(this);
        jmiMul.addActionListener(this);
        jmiDiv.addActionListener(this);
        jmiClose.addActionListener(this);
      /** Handle ActionEvent from buttons and menu items */
      public void actionPerformed(ActionEvent e) {
        String actionCommand = e.getActionCommand();
        // Handle button events
        if (e.getSource() instanceof JButton) {
          if ("Add".equals(actionCommand))
            calculate('+');
          else if ("Subtract".equals(actionCommand))
            calculate('-');
          else if ("Multiply".equals(actionCommand))
            calculate('*');
          else if ("Divide".equals(actionCommand))
            calculate('/');
        else if (e.getSource() instanceof JMenuItem) {
          // Handle menu item events
          if ("Add".equals(actionCommand))
            calculate('+');
          else if ("Subtract".equals(actionCommand))
            calculate('-');
          else if ("Multiply".equals(actionCommand))
            calculate('*');
          else if ("Divide".equals(actionCommand))
            calculate('/');
          else if ("Close".equals(actionCommand))
            System.exit(0);
      /** Calculate and show the result in jtfResult */
      private void calculate(char operator) {
        // Obtain Number 1 and Number 2
        int num1 = (Integer.parseInt(jtfNum1.getText().trim()));
        int num2 = (Integer.parseInt(jtfNum2.getText().trim()));
        int result = 0;
        // Perform selected operation
        switch (operator) {
          case '+': result = num1 + num2;
                    break;
          case '-': result = num1 - num2;
                    break;
          case '*': result = num1 * num2;
                    break;
          case '/': result = num1 / num2;
        // Set result in jtfResult
        jtfResult.setText(String.valueOf(result));
    }

    Okay here is the fixed code... I commented the changes...
    basically I changed public void init() to public MortgageApplet() so that the section is a contructor not a method. ( since this class no longer extends Applet, public void init() becomes a method called "init" which has no relation to Applets' init method...)
    Then I move most of the variable declarations in the contructor ( formally the init() method ) and declared them as class variables... then initialized them in the construtor "MortgageApplet()"
    And now the second button works and you can see the MortgageApplet with textfields and buttons...
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.TitledBorder;
    class MortgageApplet extends JFrame implements ActionListener {
       // Made all these class variable, originally they were under public void init()
       private JTextField jtfAnnualInterestRate;
       private JTextField jtfNumOfYears;
       private JTextField jtfLoanAmount;
       private JTextField jtfMonthlyPayment;
       private JTextField jtfTotalPayment;
       private JButton jbtComputeMortgage;
       JPanel p1,p2;
       // end variable declaration
       public MortgageApplet() {    // originally was public void init() so it thought is was a method
                                    // now it is a contructor...
          jtfAnnualInterestRate = new JTextField();
          jtfNumOfYears = new JTextField();
          jtfLoanAmount = new JTextField();
          jtfMonthlyPayment = new JTextField();
          jtfTotalPayment = new JTextField();
          jbtComputeMortgage = new JButton("Compute Mortgage");
          jtfMonthlyPayment.setEditable(false);
          jtfTotalPayment.setEditable(false);
          jtfAnnualInterestRate.setHorizontalAlignment(JTextField.RIGHT);
          jtfNumOfYears.setHorizontalAlignment(JTextField.RIGHT);
          jtfLoanAmount.setHorizontalAlignment(JTextField.RIGHT);
          jtfMonthlyPayment.setHorizontalAlignment(JTextField.RIGHT);
          jtfTotalPayment.setHorizontalAlignment(JTextField.RIGHT);
          // JPanel p1 and p2 declared as class variables
          p1 = new JPanel();
          p1.setLayout(new GridLayout(5, 2));
          p1.add(new Label("Annual Interest Rate"));
          p1.add(jtfAnnualInterestRate);
          p1.add(new Label("Number of Years"));
          p1.add(jtfNumOfYears);
          p1.add(new Label("Loan Amount"));
          p1.add(jtfLoanAmount);
          p1.add(new Label("Monthly Payment"));
          p1.add(jtfMonthlyPayment);
          p1.add(new Label("Total Payment"));
          p1.add(jtfTotalPayment);
          p1.setBorder(new TitledBorder("Enter interest rate, year and loan amount"));
          p2 = new JPanel();
          p2.setLayout(new FlowLayout(FlowLayout.RIGHT));
          p2.add(jbtComputeMortgage);
          getContentPane().add(p1, BorderLayout.CENTER);
          getContentPane().add(p2, BorderLayout.SOUTH);
          setVisible(true);  // added this also...
          /* the rest is the same - MaxxDmg...*/
          // Register listener
       jbtComputeMortgage.addActionListener(this);  }
       /** Handle the "Compute Mortgage" button */
       public void actionPerformed(ActionEvent e) {
          if (e.getSource() == jbtComputeMortgage) {
             // Get values from text fields
             double interest = (Double.valueOf(
             jtfAnnualInterestRate.getText())).doubleValue();
             int year =(Integer.valueOf(jtfNumOfYears.getText())).intValue();
             double loan =(Double.valueOf(jtfLoanAmount.getText())).doubleValue();
             // Create a mortgage object
             Mortgage m = new Mortgage(interest, year, loan);
             // Display monthly payment and total payment
             jtfMonthlyPayment.setText(String.valueOf(m.monthlyPayment()));
             jtfTotalPayment.setText(String.valueOf(m.totalPayment()));
    }Have fun...
    - MaxxDmg...
    - ' No Side '

  • Help needed for a new Mac user with his photo and video librarys

    after swopping my Ericson for an iphone a year ago. then taking delivery of an iPad on launch day. I have finally taken the plunge and swopped my windows pc for a lovely 27" iMac... what have I been doing all these years using windows? using the Mac is a joy.
    As I get more involved with their products I am constantly fascinated (and frustrated) by Apples way of doing things. this situation is no exception and I need Apple people with Apple experience to help me make a decision. 
    I am looking at software to organise my photos and videos. I have approximately 7000 photos residing on a windows home server. in addition to that there are some 200 or so HD videos taken with either my Sanyo Xacti camcorder or Sony DSC W300 camera. both cameras I think produce MPEG format
    my first experience was iPhoto. great for the `price' but not very flexible. single libraries, poor editing facilities. and because I have files referenced and not copied to my iPhoto library, if I deleted from the library its not deleted from the server (and vice versa). this leads to images being displayed in the library that don't exist etc.
    then I downloaded the Aperture 3 trial. great until I came across the `Unsupported file format' situation with the MPEG videos that strangely enough, iPhoto will recognise and play (the Apple way of doing things).
    1. should I put the photos on the Mac instead of the server?
    2. Is there a better way of managing the images for deletions etc
    3. should I stick with Aperture because of the editing
    4. is there a better software or way of managing the videos
    sorry for the ramble but its all new to me

    had a good session on all three of the recommended programs and now have a better understanding of the excellent advice I have been given.
    iPhoto
    great `free' program that is easy to use but somewhat limited on features. think I would always be looking to upgrade from here (feels a bit boring)
    Aperture
    really enjoyed using this but at £170! a hefty price tag considering its limited file support. fortunately its only my camera video clips (MPEG) that it wont view. my camcorder files (MP4) are fine so this is looking better as a one stop solution.
    Elements
    much more than just a image touch up. considering what it can do.. very good value at around £60. teamed with iPhoto it becomes even more attractive.
    My issue still remains with the masters file location.
    I would prefer to keep all my media on the external server to ensure I have a fail safe recovery option. its a 4TB 5 disk affair which contains all the family music, video images and DVD's etc (likely to change to a Mac server in the future!)
    one feature that I cant find, (even in Aperture which surprises me), is the ability to automatically manage deletions from referenced locations? i.e. delete a file from the server and when aperture opens up the thumbnails are updated. or, delete a referenced master in Aperture and an option comes up to delete the referenced file on the external drive.
    how would a professional photographer or studio using Aperture manage this process (or would they use something else?)
    forgot to mention that through our student facilities i can get a discounted copy of Photoshop CS5 for around £175 which is close to Aperture. is this a worthwhile option or overkill
    Message was edited by: buttons129

  • Help needed, various bugs in itunes and with my ipod

    Hello, I thought this would be the best board to post this since the problem is mainly associated with itunes. Simply, my itunes library has been erased completely including songs purchased from the itunes store. However, for those who think they may be able to help me, I will give some more details.
    I am sorry for the amount of text, however I feel it is better to give all details now than have to keep answering questions. Please bear with me, this problem has caused me a lot of inconvenience, and I would love to get it fixed.
    1 week ago I followed a link from youtube to purchase a song from the itunes store. I trust this link to be reliable in the sense it had no viruses or the like. However, upon doing this, the itunes configuration that appears when you first install itunes. I followed the prompts to agree to the terms and conditions for itunes (from my memory, I was not particularly concentrating at this time). Then the wizard closed and itunes popped up. My library was completely empty. I closed itunes and reopened it, library still empty. I restarted my computer, same again. I then spent a while trying to add my music back to itunes, however lots was not on my hard drive anymore.
    I then tried using a utility I found online to extract songs off my ipod to my computer, as my ipod had all the songs from my library that I wanted back. This worked partially, because of the effectiveness of the program.
    I then tried to use an old library file as advised to based on a basic google search. This restored lots of the files, all sorted, as they were not sorted when I got them off the ipod. However, lots of the files now come up with an exclamation mark next to the name, indicating the file cannot be found. I have searched for these files, and they are nowhere on my hard drive or recycle bin.
    Now, I was annoyed and inconvenienced by this greatly however I still had all my music on my ipod.
    Then my ipod (second gen. ipod touch) crashed. The music presumably became unreadable or corrupted because the ipod showed no music on it. I had to restore the factory settings on my ipod, and now I have lost a lot of my music. I have tried to restore from one of the backups itunes created, however this did not restore my music, in fact, I don't know what it did.
    So in summary, I have lost a lot of the music which I bought off the itunes store. This is greatly distrissing. Additionally, my ipod will not sync all the time now, with an error stating "the disc is unreadable" or words to that effect. I would really like to get my music back, and it would take a very long time to list all these songs in an email to apple asking for free redownload of these songs I already purchased. I would like to know if there is any way to get my songs back, explanation of what happened, how I can prevent this, any advice really. I understand I should have made a backup on another computer or external hard drive, however I believed that the 'backup' of the songs all on my ipod would be suffiencient. Please help if you can, I have already spent about 7 hours searching and working to fix this problem. It would be so very much appreciated.
    Message was edited by: alocus

    When I imported the files the first time I did type the new genre in the genre field of the info box. You can either choose a pre defined genre or type a new one. As soon as a new one was entered it is available in the drop down for any future imports.
    I have around 15000 songs assigned to the different genres. For only a couple of 100 I have the problem which I described.

Maybe you are looking for

  • No App Store icon on iOS7 so i can't install an app...

    Hi, on my iPhone 4S i have upgrade without problems to iOs7. Today, i have try to install Twitter via the Settings panel but nothings append except a "special grey icon" on desktop... i have try ton find the App Store icon but there is no App Store I

  • My iphoto library won't show when trying to select a photo for other programs?

    I am having a problem when I try to select a photo or itunes song in Imovie or other programs. I get a window with grey lettering that says: "Open Itunes to populate this list" or "Open iphoto to see photos from your iPhoto library in this list.  I h

  • Ipod not sync with PC

    Hi all... I hope someone can help me!  My ipod sync fine with my PC until a few days ago.  I have removed / reinstalled itunes, use diff cables, reset the ipod but with no success!  Thanks

  • OSB Proxy service HTTP kerberos authentication

    Is it possible to use kerberos authentification in OSB Proxy service? I need it in following scenarios. First scenario. We have Sharepoint Portal with Windows SSO. Our Sharepoint developers can invoke webservice on OSB (proxy service) with transferin

  • Dependent LOV in Tabular Form

    All, We are developing an application where we come across requirement to have two fields in tabular form and both are required to have LOV. But the issue is the second field LOV in the tabular form is dependent on first field value. ex: Assume first