Creating a pop up text window from a button within an Applet

I want to create an applet with two clickable buttons in it (this I know how to do). When a visitor to the site clicks on one of the buttons, I want a separate window to pop up and display a few lines of text. A different text message will be displayed depending upon which button was clicked.
I can't figure out how to create a pop up window when the button is clicked. In fact I'm not even sure that this is possible as the user must have the facility to close the window after they have read the text, and from my limited knowledge of Java and applets this would involve system exit() ??? and this is not allowed.
I am new to Java and would appreciate any help that anyone can offer.
Thanks
Jim

Write the popup frame as if you were writing an application, but don't set the close operation. From the applet just setVisible(true) and again, don't worry about the close issue.
Visit my website, any of the samples except button, to see windows popping from applets.

Similar Messages

  • How do I Re enabled the Buttons in MainMovie.swf from a Button within SecondMovie.swf???

    I have the following situation
    MainMove.swf is doing a loadmovie of SecondMovie.swf
    The Button that loads SecondMovie.swf also disables other buttons in MainMovie.swf
    on (release) {
        _root.intro_btn.enabled = false;
        loadMovieNum("SecondMovie.swf", 2);
    How do I Re enabled the Buttons in MainMovie.swf from a Button within SecondMovie.swf???
    Using AS2 is this current project
    Thanks

    lol Sorry bout that I'm brand new here and was looking for the option to remove the post from the other location.

  • Create a new folder in windows from SAP

    Hi,
    I can execute progrmas from sapusing the WS_EXECUTE function, but how can I crete a new folder in windows from SAP?.
    Thnaks

    Hi,
    I have a idea about this problem.
    Firstly, I made a batch file. The file is a text file, so you can create easily the file from the WS_DOWNLOAD function. The file include a command - md (folder name).
    Secondarily, I executed the batch file by the function 'WS_EXECUTE'.
    Finally, I deleted the temporary file by the WS_FILE_DELETE function.
    It's easy.
    If do you need the source, you should send a mail to me.
    The source is given you.
    Best regards,
    Don

  • How do I create a series of text frames from a list of files?

    And I'm back again.
    This time, I'm wondering how I can use JavaScript to place a series of text frames from a list of files, preferably with the ability to specify criteria before running the script.
    Here's the details: I work for a newspaper and I lay out stories for the pages (in addition to the other part of my job, laying out ad spaces, as detailed in a previous thread, for which I requested another script, thanks Andreas and Jongware ). The file names for the stories are labeled for the section they go in, like L- for Life, C- for Comment, S- for Sports, etc.
    I'd like to create a script that asks for a criteria in a text box (where I can type L-, C-, S- or whatever else I need) and then places all of the stories, in a specified directory, whose file names match what was typed in the box, one text frame for each.
    I can't rightly tell if this is a simpler or more difficult script to write out, but I plan on putting research into it as usual so I can develop it myself. However, I figured it would be more efficient to ask first, then research, so that while I'm researching, I can refer to the opinions of my fellow forumites, and/or the mods.
    Thanks again for any assistance offered.

    And I'm back again.
    This time, I'm wondering how I can use JavaScript to place a series of text frames from a list of files, preferably with the ability to specify criteria before running the script.
    Here's the details: I work for a newspaper and I lay out stories for the pages (in addition to the other part of my job, laying out ad spaces, as detailed in a previous thread, for which I requested another script, thanks Andreas and Jongware ). The file names for the stories are labeled for the section they go in, like L- for Life, C- for Comment, S- for Sports, etc.
    I'd like to create a script that asks for a criteria in a text box (where I can type L-, C-, S- or whatever else I need) and then places all of the stories, in a specified directory, whose file names match what was typed in the box, one text frame for each.
    I can't rightly tell if this is a simpler or more difficult script to write out, but I plan on putting research into it as usual so I can develop it myself. However, I figured it would be more efficient to ask first, then research, so that while I'm researching, I can refer to the opinions of my fellow forumites, and/or the mods.
    Thanks again for any assistance offered.

  • How to open a new window from submit button &dialog page in current window?

    We have a requirement, wherein we have a OAF search page for PO lines with search criteria, Go button to search ,result region (table layout) and a submit button(Create new expedite).
    1. Now user can select some lines from result region and click on Submit button.
    2. On click of submit button we need to pop up a window or may be a dialog page asking that " Do you want open supplier web link portal or not?".
    3. If user clicks yes(in Dialog page) then first fetch the URL from a look up maintained in Oracle EBS on the basis of supplier of the lines selected and then open that URL in a new window and side by side we need to open a dialog page in search page asking "whether user has updated the expedite info in supplier portal or not?". On basis of this we need to updated some count in custom tables.
    So in step 3 i am facing problem, that how to open an URL in a new window through a submit button and side by side want to open a dialog page in the current window also.
    Hope a quick response from you all.
    Note:- To open a custom page we can have a link or button(button of type button and not submit button) on base page with destination url property as following javascript:
    javascript:var a = window.open('OA.jsp?page=/XXX/oracle/apps/xxx/......&retainAM=Y', 'a','height=500,width=900,status=yes,toolbar=no,menubar=no,location=no'); a.focus();
    So the question is how to do the same for submit button on OAF page???

    Antriksh,
    You just need to attach a submit action in button bean and not submit button bean, based on the output of confirm type of alert in javascript.
    Here is code u need to put in destination url of the button:
    //replace <confirm message> by message you want to show.
    javascript:input=confirm('<confirm message>');if(input==true){submitForm('DefaultFormName',0,{XXX:' abc'});}" Now in the process request of the base page CO, u can get parametre 'XXX' from the pagecontext....so
    if((("abc").equals(pageContext.getParameter("XXX"))))
    {/// custom LOGIC }
    The same i have replied in your mail. I hope this resolves the issue.
    --Mukul

  • Automation server can't create object when calling a jsp from a button

    Hello,
    I have created the following jsp that allow me to execute an external program that is located on the client side:
    <script language="JavaScript" type="text/javascript">
    <!--
    function execAppli(app)
    var wshShell = new ActiveXObject("WScript.Shell");
    wshShell.Run(app+".exe", 1, true);
    -->
    </script>
    If I call this jsp in a simple html page is works correctly when i call it from a button in apex (3.0) I got the error message Automation server can't create object.
    Any idea ?
    Thanks,
    Claude-Alain

    Hi Claude,
    Just be sure that you really (like really) trust your endusers, because I can see some huge opportunities for exploiting that JavaScript routine you've shown. If you're not taking steps to prevent cross site scripting (search this forum or Google for details on what that is), then it's not beyond the bounds of possibility for someone to do something 'nasty' which would do horrible things to your end users if your executing a program on their client machines without any warning or validation of what that program actually does.
    Sometimes it's best to work backwards from the point of view of....what if you walk into work one morning and find that 400 end users machines have had their hard-drives wiped because the script arbitrarily executes whatever command you pass to it? Then you can perhaps see that what sometimes looks like a good idea might not be such a good idea after all ;)

  • Opening an applet window from a button in a frame.

    hi,
    i designed a frame,in that i took coordinates from the user in the Jtextfields and a button.i need that when user clicks that button,a new applet window should get opened and the line should be drawn(g.drawLine in the paint method) according to the coordinates passed.
    please help me.

    Yes, It works on firefox. It is only an issue with Internet Explorer.
    However our web based application has to use IE and therefore when it calls apex it is in an IE browser.
    I am really just producing a csv file, and opening it in excel. If this was fixed (or customisable in some way in IE that would help)

  • Calling from java buttons in an applet

    ok i made this program here and now i'am tryin to call certain certain classes from each button. i can't figure out how to do that.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class JDemoGridLayout extends JApplet
    JLabel greeting = new JLabel("SAMPLE", JLabel.CENTER);
    Font HeadlineFont = new Font("Helvetica",Font.BOLD, 24);
    private JButton b1 = new JButton ("Button 1");
    private JButton b2 = new JButton ("Button 2");
    private JButton b3 = new JButton ("Button 3");
    private JButton b4 = new JButton ("Button 4");
    private GridLayout layout = new GridLayout(6,6,6,6);
    JLabel personalGreeting = new JLabel("");
    Container con = getContentPane();
    public void init()
      greeting.setFont(HeadlineFont);
    personalGreeting.setFont(HeadlineFont);
    con.add(greeting);
    con.setLayout(new FlowLayout());
    setLayout(layout);
    add(b1);
    add(b2);
    add(b3);
    add(b4);
    }Edited by: javastudent101 on Mar 4, 2009 7:12 AM

    javastudent101 wrote:
    ok i made this program here and now i'am tryin to call certain certain classes from each button. i can't figure out how to do that.You don't call classes from buttons. What you can do is add a java.awt.event.ActionListener to each button. This ActionListener's actionPerformed() method will get called whenever the button is clicked. An example:
    MyActionListener listener = new MyActionListener();
    JButton button = new JButton("Do My Taxes");
    button.setActionCommand("DoTaxes");
    button.addActionListener(listener);
    JButton button2 = new JButton("Take a Shower");
    button2.setActionCommand("TakeShower");
    button2.addActionListener(listener);
    private class MyActionListener implements ActionListener {
       public void actionPerformed(ActionEvent e) {
          String command = e.getActionCommand();
          if ("DoTaxes".equals(command)) {
             // Whatever processing is necessary to do taxes
          else if ("TakeShower".equals(command)) {
             // Whatever it takes to take a shower.
    }See [How to use Buttons|http://java.sun.com/docs/books/tutorial/uiswing/components/button.html] for more information.
    Alternatively, you could use an Action specific to each JButton. Once you understand ActionListeners, it's pretty easy to understand Actions.

  • Open Explorer (windows) from CRM button

    Hi,
    how can i open windows explorer for a specific directory from a CRM button in the Web UI ?
    The CALL_BROWSER function (which works fine in the SAP GUI) will result in a
    500 SAP Internal Server Error
    ERROR: Exception condition "FRONTEND_ERROR"  raised. (termination: RABAX_STATE).
    How to solve my problem ?
    Any suggestions ?
    gr
    Hans

    kelvin_nitk wrote:
    Hi i have a java application running on a unix machine.What does this have to do with the rest of the question?
    On a jsp i need to provide a hyperlink which should open a new window but not the internet explorer window but the windows explorer window of some remote windows machine. How can this be done. Can anybody suggest?You want to execute the Windows Explorer program on somebody's computer from within the browser? Running executables from the browser is a security hazard that the browser tries very hard to prevent. You can't do it without getting the user to install some software into their browser where they agree, in advance, that they will let your site do insecure things.
    In this case most likely an ActiveX component would be the best bet.

  • Opening a URL from a button within a Web Template

    Hi All,
    I have a requirement to provide report specific help from within a standard web template. Assuming that I had a list of help URLs for each report and an intermediary way to redirect to those URL based upon a unique id such as the reports technical name, is it possible to create a generic button from within a web template that would dynamically create a URL based on the reports technical name? I.e., http://www.example.com/page.html?ZGTRPTNME
    To date I have only used the Action "Command via Command Wizard" from within the parameters of the button Web Item. However, I did notice that a Script Function was provided. Has any used this functionality and is it possible to create a URL with the technical name of the report?

    Rekesh,
    I had a look at the document you linked however what I need to find out is how I can place the technical name (dynamically) within the web template URL (i.e., this needs to work for multiple projects over many reports that all use the same global web template).
    It's actually very easy opening a new window via javascript however finding the varible for the report technical name remains unclear. At present I am looking at command URL's. The only other option is that I use a java script substring command to pull the report technical name from the URL (although this not as clean as using command URL's).
    EDIT: Found this document: http://help.sap.com/saphelp_nw70ehp1/helpdata/en/43/ef9a6c13f2025be10000000a1553f7/content.htm
    Appears that the command: sapbi_page.GetMainTemplateName(); will give me the technical name of the webtemplate although I'm finding it hard to find the command for getting the technical name of the current report.
    Edited by: Paul Thomson on Feb 18, 2010 4:00 PM

  • Play a Movie Clip on a frame In Main SWF from a button, within 2 MovieClips

    I’m using AS2, Flash 8
    I have a frame on my main Timeline Called “Gallery” within this frame I have 2 movie clips, which I need to work together:
    One is called:
    Gall_Lge_1
    Which contains 37 frames.
    Each frame has a different movie – basically 37 different photos which pop up on each frame.
    (MC’s named Lge_1, Lge_2, Lge_3 etc)
    The second Movie Clip I have on here is called:
    gall_strip_mc
    Which contains a movie clip called strip1 , (which is set to scroll its contents controlled by buttons on ”Gallery”- which works) inside that is a movie clip called strip_all , and contains one frame with 37 buttons/photo thumbnails, (Buttons named btn1, btn2, btn3 etc which I require to link each individual button to the corresponding photo/frame in Gall_Lge_1  …
    So,
    btn1 will go to and play Lge_1(Frame 1 of Gall_Lge_1)
    btn2 will go to and play Lge_2(Frame 2 of Gall_Lge_1)
    I’m stuck and can’t get it to work..
    Here is the site – under ‘Gallery’ so you can see what I’m trying to achieve
    http://www.blueshelldesign.com.au/draft/
    (I’ve placed in Back and Next buttons next to ‘Gall_Lge_1’ so you can see how its suppose to look when the thumbnails from ‘gall_strip_mc’ are clicked)

    First, you do not use quotes when you are specifying a frame number, so try changing that first.  The only time you use quotes for that argument is for frame label strings.
    If it still won't play, are you sure that the button is coded properly and executes the function when clicked?  You should put a trace in the function to make sure.  Also, you could try using _root instead of _level0... I forget the difference, if any, but _root will definitely get you to the main timeline.
    btn2.onRelease = function() {
         trace("btn2 clicked");
        _root.Gall_Lge_1.gotoAndPlay(2);

  • Controlling and object state from a button within an object state

    I have a MSO with a set of fridge images, to show the different colourways, but I also want to be able to show open and closed versions of the images.
    My idea was to have two MSO, one with the colour varients and one with the open varients and have a button inside the colour varient MSO so each colour shows its own button, but it looks like that button can only control the MSO that it is part of, is there anyway for it to trigger the second MSO?

    Ok well this is a screenshot from the laundry page, but its the same as fridge freezers.
    There is a MSO called colour change, and the red box is the button which has a go to next state action.
    I was going to have a second MSO with the open versions of the products that would be triggered by a button in each state of the first MSO, but this isn't possible.
    I don't want to put all the images in one MSO because that button is specifically to change the colour of the product.
    I guess one option could be to make each image in a scrollable frame so you swipe up/down to open/close.
    Any other possibilities?

  • Creating a popup browser window from an applet

    Hi, in a java applet that I am developing i use AppletContext.showDocument to load a web-page. The thing is i want this window to be a popup, devoid of toolbar and statusbar, etc. do you have any idea on how i could accomplish this?
    I tried to do it with javascript, but i could only create new pop-up child windows of the html file that contained the method for opening pop-ups, i could not change the parent window itself to become a popup.
    If you have any idea on how to either create a pop-up type window from an applet, or make the current window into a popup i would be grateful to hear it.

    The only way I can think of is to use JSObject to call JavaScript on the current page & have JavaScript do a window.open
    http://forum.java.sun.com/thread.jsp?forum=31&thread=295808

  • Creating a pop up window on button click?

    Hi
    How would I create a pop up modal window when a user clicks on a print button within an interactive report. This window would then display a message with a confirm or cancel button. If they click on confirm the page prints out and if they click cancel it takes the user back to the report
    Is this possible? if so how is this achieved?
    Many Thanks

    The confirm dialog is a native dialog in the browser. It will display a message and it has an ok and cancel button. Running it in javascript will prompt the user with the dialog, and the return value will be true or false depending on the button clicked.
    You don't need any extra page whatsoever.
    var r=confirm("Press a button");
    if (r==true)
    x="You pressed OK!";
    else
    x="You pressed Cancel!";
    }This would prompt you with a small dialog, asking "Press a button.". Clicking Ok or Cancel will return true or false to variable r, which in this code is then tested.
    You could shorten it up to
    if(confirm("Do you want to print?")){
       //execute print code
    };Alternatively, if you are on version 4.0 or higher you can use a dynamic action for this. Set the action to fire on the click of a button, and as a true action you can choose the confirm action, which then lets you display a text.

  • How do I create a window from an applet?

    I am trying to create a window application from an applet. The window that I need should meet the following criteria:
    1. The window application will be created when I click on one of the buttons in the applet.
    2. If I close the applet from the browser, the window application should not be affected.
    3. I should be able to close the window by clicking the X icon on the upper right corner.
    4. The window application works by itself. It does not need to interact with the applet any more.
    Is there any example similar to what I am looking for available?

    1. Easy.
    Button myButton = new Button( "a button" ) ;
    myButton.addActionListener( new ActionListener()
    public void actionPerformed( ActionEvent e )
    Frame myFrame = new Frame( "a frame" ) ;
    myFrame.show() ;
    add( myButton ) ;2. Short answer, can't be done. Long answer, I think it can be done with something called "Java WebReady", but I don't how. (needs JDK 1.4, I think)
    3. Easy. You just have to add a window listener to the frame.
    class closeWindowListener extends WindowAdapter
         private Frame myFrame ;
         closeWindowListener( Frame myFrame )
              this.myFrame = myFrame ;
         public void windowClosing( WindowEvent e )
              myFrame.dispose() ;
    myFrame.addWindowListener( new closeWindowListener( myFrame ) ) ;
    myFrame.show() ;4. Fine with me, but keep in mind the difficulty of #2.

Maybe you are looking for