Adding array item when button clicked

When a button is clicked I want to take text from 4 different text fields and add them to the end of their respective arrays. I declared the array's as class arrays in a different JFrame, is it possible to take the text from this new JFrame's Textfields and add it to the arrays. Here's the code
  NewJFrame.AirlineName.add(jTextField1.getText());NewJFrame is the original frame, then it pops up a new frame when a button is clicked. They add text to the textfields and click add. It will then take the text and add it to the arrays.

rhino17 wrote:
That might be the problem. I'm creating a whole new Jframe, not a dialog box. Using a dialog will probably make the GUI work more smoothly and will allow you to display and retrieve information modally, but won't change basic object to object communication.
I'm new to this whole Java Business ( HS student, learning w/o an actual teacher) . I'll do reasearch on a dialog box, or if u have a quick link to a tut that would be great. [How to Make Dialogs|http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html]
And i did not understand BDLH's original message, he sounded like he was trying to be a ... you get the point.If you stay around this board for long, you'll see that BDLH is one of the nicer posters around. He'll kid at times but almost always in a gentle fashion. I however can be a flaming asshole at times.
Is there a way to retrieve more than one input value?Absolutely. For instance if you used a JOptionPane, you could place a JPanel within it that has several JTextFields, and easily extract this information. But note that there are always messy quick and dirty ways of doing this that don't scale well as your project grows or changes. What BDLH was suggesting was to keep your logic and your GUI separate and your class coupling loose so as to avoid these pitfalls. Also know this. If you see him disagreeing with something someone here says (including or especially me), I'd go with his interpretation over mine any day as he's a pro.

Similar Messages

  • Download the PDF Form as a attachment when button click in BSP application

    Hi All,
    I have scenario, when button click in the BSP application PDF Form want to download in the IE (like one window open with Open,Save and cancel button).
    I have written this code:
    data: pdf type fpformoutput-pdf.
    < Logic for populate value to pdf field ....
    .>
    response->set_header_field(
                         name  = 'cache-control'
                         value = 'max-age=0' ).
      response->set_header_field(
                         name  = 'content-disposition'
                         value = 'attachment; filename=webforms.pdf' ).
      response->set_data( data   = pdf ).
    Once button is clicked pop up is opened and closed automatically because of browser or adobe reader issue.
    How can I resolve this problem ?
    In the IE i need to change any settings ?
    IE version = 7.0
    Adobe reader = 9.0
    I have tried in the same code with IE = 6.0 and adobe reader 8.1.2 its getting download the pdf form working fine.
    The same think i want in IE 7.0 and adobe reader 9.0, what needs to be done ?
    Regards,
    Boopathi M

    Hello Ravi,
    Best would be to bind the dataSource of the InteractiveForm ui element to the parent node containing the table's data. Then specify a name of a template to be created in the templateSource and hit <enter>. Some popups later, the system will have created a template from the structure of the context. All you need to do now is to drag&drop the data structure inside the template designer to the template itself. This will result in a table. Save, activate and return the Web Dynpro view. Don't forget to unbind the pdfSource and enjoy.
    Best regards,
    Thomas

  • How to add a new line item when i click on UPDATE in orderpage B2B webshop?

    Hi Gurus,
    I need to add a new line item based on some condition when i click on update in the order page in b2b web shop. Is there any way to pass some parameters to the BADI crm_isa_basket_items and create a new line item when i update? If so can you please tell the parameters that i need to pass to the badi.
    Any help will be highly appreciated!!!!!
    Thanks in advance,
    Lakshman.

    You can put condition when you call java script function while clicking on "update" button.
    On order.jsp  update button call "submit_refresh()" java script function. You can check your condition over here.
    You can find this function in "orderTools.js" file.
    And when you enter item in last line on order page and click on the update button it will automatically add new empty lines on your order page as per your selected new line items from drop down box.
    Or may be you can call your custome action class when you click on update to check particular condition.
    I hope it will help you.
    Thanks and Regards.
    eCommerce Developer

  • GO-ITEM  - WHEN-BUTTON-PRESSED - SQLAP-10048 - You have not selected a record.

    Hi,
    I need to use go-item -> execute-trigger(when-button-pressed) personalization in oracle EBS Payables module. However i face certain problem.
    When i do 'go-item' to particular 'button', row selection disappear(its a multi row block). In the result i receive an error - 10048 - you have not selected a record.
    Manually you just click a button with row selected, and everything goes fine. There must be some kind of a context parameter which is passed from a block/record/row to a button. However how to achieve this through personalization?
    Many thanks for every help.
    Best regards,
    Martin

    write a procedure in forms that disables all your items in that record and call this on When-New-Record-Instance and When-Button-Pressed.
    PROCEDURE disable_item IS
    BEGIN
    IF :<block>.indicator = 'X'
    THEN
    SET_ITEM_INSTANCE_PROPERTY('<block>.<item>, CURRENT_RECORD, INSERT_ALLOWED, PROPERTY_FALSE);
    SET_ITEM_INSTANCE_PROPERTY('<block>.<item>, CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_FALSE);
    .. (repeate this t2o Statemnts for every item,
    more elegantliy you may write a loop using built-in NEXT_ITEM to get all items and set insert and update off) ...
    END IF;
    END;
    On When-Button-Pressed set the value of :block.indicator to 'X' before calling the disable_item procedure.
    Attemtion: This solution assumes that the button is part of your MR block (cited bove as <block>).
    ... and code is just written down, not tested.

  • Stopping audio and starting another audio when button clicked

    Hello,
    I have a multiple slide document, and I want sound to stop
    when they click the "Next" button, and another audio clip to start.
    Here is what I have so far:
    //audio
    x = new Sound();
    x.attachSound("Slide1");
    x.start(0, 0);
    musicplay = true;
    forward_btn.onRelease = function() {
    gotoAndStop("2");
    numbering eq numbering++;
    So I just want it to play audio clip "Slide2" when they click
    forward_btn, and I want "Slide1" to stop.
    Thanks!

    Attach your second sound file to the frame that will play the
    second sound. Then try adding stopAllSounds() before the
    gotoAndStop("2"); to get the first sound to stop playing and then
    play the second sound.

  • Some affect on buttons when button click

    Dear All,
    I have 6 buttons in windows phone application page with Custom Control Template. I have also capture "Pressed" VisualState and change the button color which working fine.
    However when any button click then I want to hide a all other buttons for 2 seconds and keep this Pressed button (in Pressed visual state) visible only. Is there any way to achieve this goal in "Pressed" VisualState?
    I capture "Click" event of button and in this click, tried following codes
    btnNearest.Opacity = 0;
    btnInstructions.Opacity = 0;
    btnFavorities.Opacity = 0;
    btnServices.Opacity = 0;
    btnInformationi.Opacity = 0;
    Thread.Sleep(2180);
    this.NavigationService.Navigate(new Uri(sUrl, UriKind.Relative));
    However all buttons does not hide, but it looks when it navigate to new page then button hides but not during "Thread.Sleep".
    Is there any way to hide all buttons for just 2 seconds and keep Pressed button visible (in Pressed state)?
    Thanks in advance.
    M. Irfan

    Dear Vineet24,
    Thank you for your message. It was good work-around but I am afraid, it does not work for me. Actually I am using Custom Template of button so only changing Button color will not help in this case. Following is the custom template which I used
    on all buttons
    <phone:PhoneApplicationPage
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    ........>
    <phone:PhoneApplicationPage.Resources>
    <ResourceDictionary>
    <Style x:Key="CircleButtonTextOnlyStyle" TargetType="Button">
    <Setter Property="HorizontalAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="FontFamily" Value="/Fonts/DroidKufi-Regular.ttf#Droid Arabic Kufi" />
    <Setter Property="Foreground" Value="White" />
    <Setter Property="FontSize" Value="18" />
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="Button">
    <Grid RenderTransformOrigin="0.5,0.5">
    <Grid.RenderTransform>
    <CompositeTransform Rotation="-5.75"/>
    </Grid.RenderTransform>
    <vsm:VisualStateManager.VisualStateGroups>
    <vsm:VisualStateGroup x:Name="CommonStates">
    <vsm:VisualState x:Name="Normal"/>
    <vsm:VisualState x:Name="MouseOver">
    <Storyboard>
    <ColorAnimation Duration="0" Storyboard.TargetName="buttonPath" Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)" To="#a9873c"/>
    <ColorAnimation Duration="0" Storyboard.TargetName="buttonPath" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#a9873c"/>
    </Storyboard>
    </vsm:VisualState>
    <vsm:VisualState x:Name="Pressed">
    <Storyboard>
    <ColorAnimation Duration="0:10:59.9" Storyboard.TargetName="buttonPath" Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)" To="#a9873c"/>
    <ColorAnimation Duration="0:10:59.9" Storyboard.TargetName="buttonPath" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#a9873c"/>
    </Storyboard>
    </vsm:VisualState>
    </vsm:VisualStateGroup>
    </vsm:VisualStateManager.VisualStateGroups>
    <!--Data="M 10 20 L 70 17, 145 20, 110 130 70 128 50 130 Z"-->
    <Path x:Name="buttonPath"
    Data="M 5 20 L 80 23, 50 95 25 95 Z"
    StrokeThickness="40"
    StrokeLineJoin="Round"
    Stroke="#464646"
    Fill="#464646" />
    <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
    HorizontalAlignment="{TemplateBinding HorizontalAlignment}"/>
    </Grid>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    </ResourceDictionary>
    </phone:PhoneApplicationPage.Resources>
    Thank you once again.
    M. Irfan

  • Encountered error og-00609 when button click to display chart

    hi
    this application uses forms 6i client server environment, graph control is being used with og.interept libray,
    passing parameters run times thru forms to charts.
    issue is that, system is doing uncertain behavior sometimes it shows graph smoothly but when constantly click at button it shows "OG-00609: internal pl/sql execution error"
    when i close graph server and run form again, and click at button to shows charts it works properly untill shows above error again.
    below is the code is being used to run charts.
    begin
    declare
    pl_id ParamList;
    query0 varchar2(256);
    begin
    query0 := 'select deptno, sum(sal) from emp where deptno in( '||:dept1||','||:dept2||') group by deptno;';
    pl_id := Get_Parameter_List('tmpdata');
    IF NOT Id_Null(pl_id) THEN
    Destroy_Parameter_List(pl_id);
    END IF;
    pl_id := Create_Parameter_List('tmpdata');
    Add_Parameter(pl_id,'dept1',text_PARAMETER,:dept1);
    Add_Parameter(pl_id,'dept2',text_PARAMETER,:dept2);
    if :ch_type = 'pie' then
    og.interpret('e:\mas\emp2.ogd','g1',query0,true,pl_id);
    og.close('e:\mas\emp2.ogd','g1');
    elsif :ch_type = 'bar' then
    og.interpret('e:\mas\emp3.ogd','g1',query0,true,pl_id);
    og.close('e:\mas\emp3.ogd','g1');
    end if;
    END;
    end;
    thanks
    i'd be appreciated on early reply.
    ali

    Metalink Note: 1078734.6
    Problem Description:
    ====================
    You are integrating forms and graphics. You are using the og.interpret which comes with the og.pll, to update a chart.
    You are using:
    OG.INTERPRET('graph.ogd', 'chart', 'DO_UPDATE;', TRUE, pl_id);
    You get the following error during runtime.
    OG-00609 INTERNAL PL/SQL EXECUTION ERROR
    Problem Explanation:
    ====================
    1.The procedure(Do_Update) that you are referencing does not exist in the graph(.ogd file).
    2. There is a bug if you are trying to specify .ogr as extension in
    your graph name or no extension.
    Solution Description:
    =====================
    1. Make sure that the name of the procedure that you are using in the
    OG.INTERPRET, exists in the graph file. DO_UPDATE is not a
    built-in procedure.
    2. The name of the graph should have the .ogd extension only. If you
    give a .ogr extension or no extension, it would give you an error.
    .

  • Make an object invisible when button clicked

    For my newspaper i am creating each page has a next button and a previous button. I have assigned the previous button on one page to attach the movie of the page previous to it and then tested my movie. However when i click the previous button the movieclip does load but loads behind the starting moveiclip. So what i want to do is when the previous button is cliked, that page (movieclip) with the previous button on its dissappears and the previous page loads.
    Thanks for any help.

    Hi,
    You obviously didn't read my post at all...
    Nagikun wrote:
    i no i made a mistake in that code as i pasted the wrong one it should have been:
    s_prev.addEventListener(MouseEvent.CLICK, attachMovieclip);
    s_prev.addEventListener(MouseEvent.CLICK, hidePage);
    function hidePage(event:MouseEvent):void {
    Page1.visible = false;
    function attachMovieclip(event:MouseEvent):void {
    var addPage0:Page0 = new Page0();
    addPage0.x= 0   
    addPage0.y= 0
    addChild(addPage0);
    were Page0 is the main page and Page1 is the page that needs to be invisible when the previous button is clicked
    function hidePage(event:MouseEvent):void {
    Page1.visible = false;
    Where are you declaring the Page1 variable here?????  You must include a statement such as:
    var myVar:Page1 = new Page1();
    and then you must add Page1 to the stage.
    Message was edited by: markerline

  • When button clicked help

    I have buttons for help, back, next, finish, cancel.
    initially I have the back and finish buttons setEnable(false)
    but when I click on Next button I want the Back button to be setEnable(true)
    I wrote the following
    //ActionListener for jButton_Next Of NavigationButtons Panel
    newNavigationButtonsClass.jButton_Next.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    newNavigationButtonsClass.jButton_Back.setEnabled(true);
    When I click on the jButton_Next the jButton_Back is not enabled. May I know what I can change in this to get this working. Thanks.

    Is the code where you initially disable the button
    getting called again somehow? I'd check to make
    sure this code isn't getting called again after you
    enable the button within actionPerformed.

  • Display rows when button clicked

    Hi
    I have a few text fields in the jsp .
    After them, i have search button .
    When i click it, list of rows should be displayed
    underneath the search button in the same jsp/page .
    Any idea how can i do it?
    thanks
    chandra

    Sure, it can be done.
    Just have one file with your form and the jsp code to display results. Put the jsp code in a conditional loop (if submit == null). What this would do is that if submit is null, only the form will be displayed, else the form will be displayed and the results of the search will be displayed.
    Hope it helps.

  • Why won't my mac highlight items when I click and drag?

    Has anyone had their mac suddenly stop highlighting?  When I click and drag it does not highlight.

    Take the case off... does the screen turn off like it is designed to do when the device is near your face? 
    If it does, the case is the problem.
    If it does not, then the sensor may be faulty, restore the device as new and try again.

  • Problem setting a hidden item value when button clicked with dynamic action or pl/sql process

    Apex 4.1
    Oracle 11g
    I have a page that consists of a main region and several sub regions.  I have a pl/sql process in After Header SET_DISPLAY(:P400_DISPLAY :='MAIN';)
    Three subregions have a contional display where P400_DISPLAY = STORE.  This works in hiding the sub regions.
    Now I want to change the P400_DISPLAY value to STORE to show the subregions when I hit a button.
    I tried creating a dynamic action for on click of the add button but get the following error:
    The selected button uses a 'Button Template' that does not contain the #BUTTON_ID# substitution string
    I went to the templates and found:
    Substitution Strings
    Substitution strings are used within sub templates to reference component values. This report details substitution string usage for this template.
    Substitution String
    Referenced
    From
    Description
    #LINK#
    Yes
    Template
    To be used in an "href" attribute
    #JAVASCRIPT#
    No
    To be used in an "onclick" attribute
    #LABEL#
    Yes
    Template
    Button Label
    #BUTTON_ATTRIBUTES#
    No
    Button Attributes
    #BUTTON_ID#
    No
    Generated button ID will be either the button's Static ID if defined, or if not will be an internally generated ID in the format 'B' || [Internal Button ID]
    I then tried creating a page process, pl/sql, :P400_DISPLAY :='STORE'; when the appropriate button is pressed.  The button action is submit page. However, it does not change the P400_DISPLAY value and the subregions stay hidden.
    Suggestions please on how to fix the template or change the P400_DISPLAY value?

    The root issue is that, although you change the value of your page item, it isn't visible to other areas of the page until it is in the session. So, any other action based on the value of your page item; the visibility of a control, a report based on the item's value, etc. will all be unaffected by changing the value of the page item until it has been changed in the session. Even after this the items are stored in the session, you must thereafter do something to cause the value to be reevaluated. To see the effect of this, observe that your page loads and evaluates the value of your page item, it sees that is "MAIN" and hides the regions. However, it doesn't reevaluate them after this.
    So; your choices to get this value set in the session are to either Submit the page, or use JavaScript to set the value in the session. If you use the latter of these, you'll have to do some further work to cause the visibility tests to be re-run, So, let's stick with with the submit method.
    What you've done above sounds correct for this but, there are a lot of decisions you could have made that might have caused things not to happen in the correct sequence.
    Firstly, let's confirm that what I describe above is your problem. From the development environment, load the page, click the button to change the value and submit. Now, click the link labelled Session. Is it still set to MAIN? If so; this is your issue.
    Let's start with the your After Header computation. Did you set it to *only* run if the current value of your page item is NULL??? If not, that's your problem.
    Load Page -> Item set to 'Main' by Computation -> Click Button -> Item set to STORE -> Submit -> Load Page -> Item set to 'Main' by Computation
    See the problem?
    Assuming this isn't the issue, you created a Branch to the same page, right? What is your process point for the Branch? Is it *After* Validation, Computation etc? Because if not, you aren't changing the value before the submit happens.
    I bet it is the first issue but, take a look at these.
    Cheers,
    -Joe

  • Adding a textfield when user click a button

    Hi,
    I have a scenior where i am trying to allow users to enter different types of contact details (phone number, office number etc)and wanted a user to click on a button (add more contact details) then a drop down box and textfeild would show up to allow them to enter those details.
    How can this be done?? are there any alternative way of doing it??
    Thanks
    Venus

    There are several way to do this:
    http://htmldb.oracle.com/pls/otn/f?p=11933:5
    This page is showing a lot of javascript functions you may use to do what you want. However, the most simple way is to make the items hidden by default and to show them conditionally after pressing a button - the button would set a value of an item to whatever you want, submit the page and the the items would show up, allowing your user to enter additional data.
    Denes Kubicek

  • Using an array to record button click order

    I am working on a demo of a UI for a handheld device. I am
    trying to make a back button that can track the users actions back
    several steps.
    I started by putting this line of code in my frame 1 actions
    layer:
    var wherefrom:Array = new Array();
    then i placed this follwing code on several different
    buttons:
    on(release){
    wherefrom.push("frame_name1");
    gotoAndStop("frame_name2");
    then on the back button i added this following code:
    on(release){
    gotoAndStop(wherefrom.pop());
    it doesnt seem to be working. I was wondering if this type of
    action is possible using AS2.0? any suggestions would be greatly
    appreciated.

    I believe scene names (and also scenes) only exist at
    authoring time and are converted to frame numbers when the swf is
    compiled (I may be wrong because I don't use them). You might have
    more success if you tried using frame numbers.
    Try using
    wherefrom.push(_currentframe);

  • How can I remove the list of 20 recently saved items when you click on the arrow on the far right side of the File Name screen for images, web pages, ect?

    When I right click and go save image/page/ect as the file save popup screen appears and on the right side of the File Name bar there is an arrow. If you click the arrow it shows the last 20? items that have been saved and their save location. Is there anyway to not have the list of recent items there or at the very least a way to clear them? I'm running Firefox 17 on Windows 7.
    Also when you save items as you were typing in the name you want to save them as it used to show filenames with the same name as you type that are saved in that directory so instead of typing the whole filename or copy/pasting you could start typing a filename and then hit the up or down arrow, backspace and just change the end of the filename without having to retype the entire filename.
    Hopefully you understand what I mean and can help me fix it, thanks.

    It's in the proper directory. I can scroll down the window on the right and see the files but if I start typing the file name of one of them the autocomplete drop down thing that shows matching file names does not appear. In the back of my mind I'm starting to think a setting got changed and then the list of matching file names stopped appearing but I can't recall what setting may have been changed, if it was a firefox or microsoft change or for certain if anything got changed at all. Yeah I know I'm not helping my own cause but what can you do.

Maybe you are looking for