Open a frame via a Button?

Hey, i am creating a cinema booking system and i have a frame (seatFrame). using the code seatFrame.show() works fine but when i enclose it within a button, the frame does not open? any help appreciated as Im fairly new to this.
public void actionPerformed(ActionEvent click)
     if (click.getSource()==bookSeat)
     {seatFrame.show();
}

Does the class that contains the actionPerformed method implement the ActionListener interface? And if so, have you added the action listener to the bookSeat button? For example:
bookSeat.addActionListener(this);By the way, using the show method is not your problem. While that method is deprecated the implementation of the setVisible method simply calls the deprecated show method. Having said that, you should be using the setVisible method.

Similar Messages

  • Opening an URL via a button in a new browser window?

    Hello,
    I'm integrating now Oracle Reports in my HTML DB application.
    Everything work well. I have create a launching page with paremeter items and a button that call a branching of type "Branch to Function Returning a URL". This branching construct the Oracle Report URL with parameters as entered in the parameter page.
    The only thing missing is the possibility to open Report output in a different browser window. I don't know how to do it via the Branching specification. Normally, in HTML, I would use target="_new" .
    Thank you
    Jean

    you might want to try having your page submit as normal, doing your parameter manipulation in an after_submit pl/sql process, and popping up the report page from your next htmldb application page. let's say, for example, that you have an update form on page 4 that branches back to a report page 2 in your application. you'd like to use the P4_JOB value submitted from page 4 to pop up a google search for that job and the string "oracle". you could do it like this...
    --create an app-level (or page level) item called POP_ON_LOAD
    --have page 4 submit as normal and branch back to page 2
    --add a pl/sql process that fires when page 4 is submitted.  have that proc set the value of POP_ON_LOAD like so...
    begin
    :POP_ON_LOAD := 'OnLoad="popupURL(''http://www.google.com/search?q=oracle+&P4_JOB.'');"';
    end;
    --enter &POP_ON_LOAD. into the "Page HTML Body Attribute" attribute of the "On Load JavaScript..." region on the page-level attributes page for page 2.
    this way, when POP_ON_LOAD is populated, htmldb will make the onLoad call to popupURL passing in whatever url you set from your after_submit process on page 4. and just remember to clear your POP_ON_LOAD item when you don't want page 2 to pop up those extra windows.
    hope this helps,
    raj

  • Opening a frame from a button

    Can some one help me figure out how to get a frame to open ferom a button with input. here is the source code where it would be used.
    // Programmer:     AISC AM Programming class
    // Jan. 22, 2004
    // DiseaseSim2 driver to test out People class
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class DiseaseSim2 extends JApplet implements ActionListener
    int i,r,numPeople=100,diameter=10;
    int mx,my;
    int lenghtOfIllness = 15;
    boolean sick;
    Person[] people = new Person[numPeople];
    Rng randn = new Rng();
    Locator datastore = new Locator();
    JButton pressButton = new JButton("Move Folks Around");
    public void init()
    Container con = getContentPane();
    con.setLayout (new FlowLayout());
    con.add(pressButton);
    pressButton.addActionListener(this);
    //CREATE PEOPLE OBJECTS AS AN ARRAY
         for(int i=0;i<numPeople;i++)
    people[i] = new Person(randn.getR(100,400),randn.getR(100,400));
    //SLOW DOWN PROCESS FOR RANDOM NUMBER SEED distinction
    pause(13);
    //MAKE ONE PERSON SICK INITIALLY
    r=randn.getR(1,numPeople);
    people[r].setSick(true);
    public void actionPerformed(ActionEvent e)
    Object source = e.getSource();
    if(source == pressButton)
    repaint();
    public void paint(Graphics gr)
    setBackground(Color.blue);
    pressButton.repaint();
         //ERASE PREVIOUS POSITIONS
    for(i=0;i<numPeople;i++)
    gr.clearRect(people.getx(),people[i].gety(),diameter,diameter);
    //Locator CALL
    datastore.setNumPeople(numPeople);
         datastore.contaminate(people);
    //MOVE PEOPLE
    for(i=0;i<numPeople;i++)
    mx = randn.getR(-100,100);
    my = randn.getR(-100,100);
              people[i].move(mx,my);
              //Make red or green
         sick = people[i].getSick();
         if(sick)
              gr.setColor(Color.red);
    //INCREMENT DAYS SICK
    people[i].countDaySick();
         else
              gr.setColor(Color.green);
         gr.fillOval(people[i].getx(),people[i].gety(),diameter,diameter);
              //MAKE PEOPLE WELL (NOT SICK)
              if(sick && people[i].getDaySick() > lenghtOfIllness)
              people[i].setSick(false);
    people[i].setDaySick(0);
    //REQUIRED METHOD FOR PAUSE
    void pause(int time)
    try{ Thread.sleep(time);}
    catch(InterruptedException e) { }

    &#91;code&#93;public void actionPerformed(ActionEvent e)
        Object source = e.getSource();
        if(source == pressButton)
            JFrame jf = new JFrame("My New Frame!!!");
            jf.setBounds(200,200,200,200);
            jf.setVisible(true);
    }&#91;/code&#93;
    Isn't code easier to read with &#91;code&#93;&#91;/code&#93; blocks around it?

  • How can I link two frames via a button on one of the frame?help Plz

    Ok,here is the problem. I got two fully working java frames,each has different funcion. On one of the frames(my home Frame" Frame 1" ) i got a button called "Add User", when i press it i should then get my other frame(Frame2) to popup/run. in Frame1 i got this code as action for the add user button.Note: each Frame have thier own Main class.
    public void actionPerformed (ActionEvent e)
    if (e.getSource()==jbtnAddUser)
    // new Frame2(this,"hshsh",jb);
    ////////////// The commented line is where i am not sure what to put in there, Frame1 is the name of my Frame 2 class......
    Please could anyone tell me how do i link Frame 2 to Frame 1....i appreciate it....Max

    You can create both together on pgm startup (instaniation of the class).
    Next for frame1 - I'll call it - you can setBounds(int, int, int, int) and setVisible(true); When you press the button on frame1 to get frame2, you can then do frame1.hide(), followed by frame2 setBounds and setVisible. Finally, when you are done with frame2 you can do frame2.dispose() and frame1.show(). try that.

  • Is there a way to open another pdf via a button in my (pdf embedded) flash movie?

    My Acrobat 9 pro pdf, contains an ActionScript 2.0 swf, added via the Flash tool, on the multimedia toolbar.
    The Flash file contains an animation introducing a collection of linked pdf files.
    At the end of the intro a button appears, which when clicked, should replace the current pdf with one of the linked ones.
    Is it possible to do this inside actobat?
    Regards Maxwell

    Thank you.  That’s all I need to know.

  • Open a PDF via a button/script in a projector

    I am going to burn a projector to a CD with a folder
    containing some pdf files. I would like to ask how to open a pdf
    file(if it's even possible) from a button in director. I don't need
    it to open inside the projector, just click on the button then it
    will open an Acrobat Reader.
    I hope you get the idea of what I'm trying to do.
    Thanks

    "rafa@mediatech" wrote:
    > Also, if your files are inside a folder, remember to put
    the path of the folder before the name of the PDF.
    > example:
    > baOpenFile( the moviepath&"FOLDER/NAME.pdf",
    "normal" )
    The above posts have given the best way to open a PDF. It
    uses the Buddy API Xtra to open a file with the
    program to which its associated. Buddy API Xtra can be used
    free if you use limited functions. So, you can use
    the baOpenFile without needing to buy the full version of the
    Xtra. The Xtra is available from:
    http://www.mods.com.au/budapi/
    Other ways to use PDFs with Director are described here:
    http://www.deansdirectortutorials.com/FAQ/pdf.htm
    regards
    Dean
    Director Lecturer / Consultant / Director Enthusiast
    http://www.deansdirectortutorials.com/
    http://www.multimediacreative.com.au
    email: [email protected]

  • Howto open weblink/url via html button in new browser window

    Hallo Apex People!
    I have built a form containing a html button linking to a webpage. Is it possible to open it in a new browser window?
    Tnak you a lot
    Johann

    Johann,
    Try this...
    In the 'Optional URL Redirect' properties of the button, change:
    Target is a: URL
    URL Target: javascript:popupURL('[your webpage');
    (Note: This uses one of the built-in javascript functions, that loads a new window without toolbars.)
    Any good?
    Ant.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Question on Opening URL's via Click Button

    HELLO,
    Would appreciate if anyone here has either encountered this,
    or can advise me if a solution exists. I have a SWF movie where, at
    the end, I invite viewers to vist another web page. Presently, if I
    provide a "Click" button, with the destination URL incorporated
    into it, when the viewer clicks the button, they are re-directed to
    the new web page from the same browser window where they viewer the
    movie. Is it possible to arrange the operation so that on clicking
    the button, a new browser window or tab launches with the
    destination web page?
    Thanks in advance for any assistance.
    Regards,
    WAYNE
    Text
    HELLO

    Hi WAYNE and welcome to our community
    Take a look at the Button properties. To the right of where
    you type the URL is a button with a down arrow on it. Click this
    drop-down and you should see an option labeled "New". That's the
    option you are looking for.
    Note that if you click the button a second time, you may also
    wish to DE-select the option labeled "Continue playing project...".
    Cheers... Rick

  • Opening a web overlay frame via button press (and closing it again)

    Hi all
    Is the following possible:
    Push a button
    A web content overlay window opens, displaying the web-based content within the frame (in this case, a URL pasted in from a google mobile search result). This window is smaller than the normal page size, so around 200 x 550px
    Push the same button to close it, returning the page to the original state
    The web content overlay launches automatically, but there's no 'hidden until triggered' option, as per the button panel.
    I don't want the reader to have to 'leave' the app and go to the relevant full page browser via the folio (or Safari).
    Many thanks
    Martyn

    So there is no way to restrict the readerd access to the 'second' page, so it's only accessible via the button tha triggers the web overlay? Do the other apps you mention have the same issue - that the user can reach the duplicate page just by navigating as normal.
    Anyway, I'm using the button method as suggested, made two pages etc. I've created the button, and made it jump to the other duplicate page, only problem is that the new page 'swipes' in, very quickly, which kind of negates the pop-up effect of using a web overlay window. Is there any way to make the duplicate page appear instantly over the old page (without pushing in from the bottom)?
    Thanks
    M

  • PLEAS help opening a frame when clicking a button

    i have a applet and when i click on a button it opens a frame. i have atried a couple of things but the frame does not open. Can anybody Please help
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class mainscreen1 extends Applet implements ItemListener, ActionListener
    private Image layout1;
    private int frame;
    private int xpos,ypos,xdir,ydir;
    public TextField tn, tt1, tt2, total;
    public int value, ticketnum, sum;
    public Label title, seat, need, payable;
    public Button b1, b2;
    Mydialog1 d;
    public void init()
         setBackground(Color.pink);
    setSize (600, 460);
    setLayout(null);
         xpos = getSize().width/-1400;
         ypos = getSize().height/12;
         layout1 = getImage(getDocumentBase(),"layout1.gif");
    title=new Label("Almeida Theater booking system");
         title.setBounds(150,0,185,30);
         add(title);
    seat=new Label("Please choose a seating location:");
         seat.setBounds(300,40,190,25);
         add(seat);
    payable=new Label("Total Payable:�");
         payable.setBounds(300,390,100,30);
         add(payable);
         need=new Label("Please enter the number of seats needed:");
         need.setBounds(300,180,245,30);
         add(need);
         CheckboxGroup radio = new CheckboxGroup();
         Checkbox Stalls = new Checkbox("Stalls", true, radio);
         Stalls.setBounds(490,40,60,25);
         add(Stalls);
         Stalls.addItemListener(this);
         Checkbox Balcony = new Checkbox("Balcony", false, radio);
         Balcony.setBounds(490,65,65,25);
         add(Balcony);
         Balcony.addItemListener(this);
         Checkbox Concessions = new Checkbox("Concessions", false, radio);
         Concessions.setBounds(490,90,94,25);
         add(Concessions);
         Concessions.addItemListener(this);
    Button b1=new Button("Quote");
         b1.setBounds(20,395,80,30);
         add(b1);
         b1.addActionListener( this );
         Button b2=new Button("Confirm booking");
         b2.setBounds(110,395,100,30);
         add(b2);
         b2.addActionListener( this );
         tt1=new TextField(60);
         tt1.setBounds(300,250,270,30);
    add(tt1);
         tt1.addActionListener(this);
         tt2=new TextField(60);
         tt2.setBounds(300,300,150,30);
         add(tt2);
         tt2.addActionListener(this);
         tn=new TextField(3);
         tn.setBounds(545,180,30,30);
         add(tn);
         tn.addActionListener(this);
         total=new TextField(5);
         total.setBounds(400,390,45,30);
         add(total);
         total.addActionListener(this);
    public void itemStateChanged(ItemEvent e)
         String c1 = (String) e.getItem();
         if (c1 == "Stalls")
              value = 20;
         else if (c1 == "Balcony")
              value = 15;
         else
              value = 10;
         tt1.setText("You have chosen to sit in the " + c1 + " area");
         tt2.setText("Each seat will cost: �" + value);
         repaint();
    public void actionPerformed ( ActionEvent e )
    if( e.getActionCommand() == "Quote" )
         //String sum = (String) e.getItem();
    //sum = value*ticketnum;
         //Ssumtotal
         //total.setText(sum);
    else if( e.getActionCommand() == "Confirm booking")
    d = new Mydialog1(new Frame());
              ticketnum = Integer.parseInt(tn.getText());
              repaint();
         public void paint(Graphics g)
              g.setColor(Color.black);
              g.drawString ("You have chosen:" + ticketnum +" seats", 300, 365);
              g.drawImage(layout1,xpos,ypos,null);
    Above is the 1st screen and when i click
    confirm booking it don't open the frame, which is below:
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Mydialog1 extends Frame implements ActionListener
    public Label title;
    public Button b1, b2;
    public void init()
         setBackground(Color.pink);
    setSize (600, 460);
    setLayout(null);
         setLocation(320,140);
         setVisible(true);
         Mydialog1(Frame f);
    title=new Label("Almeida Theater booking system");
         title.setBounds(150,0,185,30);
         add(title);
         Button b1=new Button("Close");
         b1.setBounds(20,395,80,30);
         add(b1);
         b1.addActionListener( this );
         Button b2=new Button("Proced with booking");
         b2.setBounds(110,395,100,30);
         add(b2);
         b2.addActionListener( this );
    public void actionPerformed( ActionEvent e )
    if( e.getActionCommand() == "Close" )
    this.dispose();
    else if( e.getActionCommand() == "Proced with booking")
    setBackground(Color.blue);
    Can anyone help also can anyone explain how i do calcualtions on the mainscreen.calss. the bit that says Quote. it has // cos i canot get it to work
    PLEASE PLEASE

    no, you dont have to create a new class.
    here is your own code. This time we pass the parameters to another method, and
    not the constructor.
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class mainscreen1 extends Applet implements ItemListener, ActionListener
    private Image layout1;
    private int frame;
    private int xpos,ypos,xdir,ydir;
    public TextField tn, tt1, tt2, total;
    public int value, ticketnum, sum;
    public Label title, seat, need, payable;
    public Button b1, b2;
    Mydialog1 d;
    String c1;                   // obs
    public void init()
    setBackground(Color.pink);
    setSize (600, 460);
    setLayout(null);
    xpos = getSize().width/-1400;
    ypos = getSize().height/12;
    layout1 = getImage(getDocumentBase(),"layout1.gif");
    title=new Label("Almeida Theater booking system");
    title.setBounds(150,0,185,30);
    add(title);
    seat=new Label("Please choose a seating location:");
    seat.setBounds(300,40,190,25);
    add(seat);
    payable=new Label("Total Payable:�");
    payable.setBounds(300,390,100,30);
    add(payable);
    need=new Label("Please enter the number of seats needed:");
    need.setBounds(300,180,245,30);
    add(need);
    CheckboxGroup radio = new CheckboxGroup();
    Checkbox Stalls = new Checkbox("Stalls", true, radio);
    Stalls.setBounds(490,40,60,25);
    add(Stalls);
    Stalls.addItemListener(this);
    Checkbox Balcony = new Checkbox("Balcony", false, radio);
    Balcony.setBounds(490,65,65,25);
    add(Balcony);
    Balcony.addItemListener(this);
    Checkbox Concessions = new Checkbox("Concessions", false, radio);
    Concessions.setBounds(490,90,94,25);
    add(Concessions);
    Concessions.addItemListener(this);
    Button b1=new Button("Quote");
    b1.setBounds(20,395,80,30);
    add(b1);
    b1.addActionListener( this );
    Button b2=new Button("Confirm booking");
    b2.setBounds(110,395,100,30);
    add(b2);
    b2.addActionListener( this );
    tt1=new TextField(60);
    tt1.setBounds(300,250,270,30);
    add(tt1);
    tt1.addActionListener(this);
    tt2=new TextField(60);
    tt2.setBounds(300,300,150,30);
    add(tt2);
    tt2.addActionListener(this);
    tn=new TextField(3);
    tn.setBounds(545,180,30,30);
    add(tn);
    tn.addActionListener(this);
    total=new TextField(5);
    total.setBounds(400,390,45,30);
    add(total);
    total.addActionListener(this);
    public void itemStateChanged(ItemEvent e)
    c1 = (String) e.getItem();
    if (c1 == "Stalls")
    value = 20;
    else if (c1 == "Balcony")
    value = 15;
    else
    value = 10;
    tt1.setText("You have chosen to sit in the " + c1 + " area");
    tt2.setText("Each seat will cost: �" + value);
    repaint();
    public void actionPerformed ( ActionEvent e )
      if( e.getActionCommand() == "Quote" )
        //String sum = (String) e.getItem();
        //sum = value*ticketnum;
        //Ssumtotal
        //total.setText(sum);
      else if( e.getActionCommand() == "Confirm booking")
        int nr_seats = Integer.parseInt(tn.getText());
        total.setText("" +nr_seats*value);
        d = new Mydialog1();
        d.set_text(c1, nr_seats); // pass the c1 and the nr_seats vriables to the
                                  //  set_text method in the Mydialog1 class.
      ticketnum = Integer.parseInt(tn.getText());
      repaint();
    public void paint(Graphics g)
    g.setColor(Color.black);
    g.drawString ("You have chosen:" + ticketnum +" seats", 300, 365);
    g.drawImage(layout1,xpos,ypos,null);
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Mydialog1 extends Frame implements ActionListener
      public Label title;
      public Button b1, b2;
      TextField tf; ///***/
      public Mydialog1()
        setBackground(Color.pink);
        setSize (600, 460);
        setLayout(null);
        setLocation(320,140);
        //Mydialog1(Frame f);
        title=new Label("Almeida Theater booking system");
        title.setBounds(150,0,185,30);
        add(title);
        Button b1=new Button("Close");
        b1.setBounds(20,395,80,30);
        add(b1);
        b1.addActionListener( this );
        Button b2=new Button("Proced with booking");
        b2.setBounds(110,395,100,30);
        add(b2);
        b2.addActionListener( this );
        tf = new TextField();                    //new
        tf.setBounds(230, 395, 100,30);   //new
        add(tf);                                       //new
        setVisible(true);
      public void actionPerformed( ActionEvent e )
        if( e.getActionCommand() == "Close" )
          this.dispose();
        else if( e.getActionCommand() == "Proced with booking")
          setBackground(Color.blue);
       *  Folowing method can take two parameters. One string and one int.
      public void set_text ( String seat_type, int nr_seats ) 
        tf.setText (seat_type +". "  +nr_seats);
    }

  • Open BW webreport via button on form in (new) popup window possible ?

    Hi,
    We need to give the opportunity to the end-users to launch a BW webreport to make a detailed analysis. I know how to do this via a button and a html iview but then the result is displayed in the same window overwriting the current content of the VC application.
    I thought to solve this by using a popup iview but I have just learned that this is not supported ?
    Can anyone give me a hint how to achieve this ? I searched for a "add hyperlink" function but didn't find that neither.

    Hi Double U,
    Ok i see, what do you mean. I thought I did a workaround and use a nested iView with a html view in a popup iView.
    Best Regards,
    Marcel
    Message was edited by:
            Marcel Salein
    A colleague told me that this is with this workaround not possible.

  • Open Webi reports via xcelsius

    Hi Gurus,
    I want to open webi report using URL BUTTON via xcelsius dashboard.
    I genereted webi report url. and I tested it on borwser(explorer and firefox). ther was no problem, I can see webi report.
    But When I used url button on xcelsius dashboard;  first  came bobje login page, After I İnput my logon info.  ooops
    seem below eror message.
    An error has occurred: An error occured while trying to view the document
    What is the problem?  Anybody can help me, please.
    Best Regards
    Bulgur

    Hi Bulgur,
    what kind of link are you using? Did you try using the openDocument functionality?:
    http://www.businessobjectstips.com/tips/infoview/opendocument-an-introduction-to-a-powerful-tool/
    Regards
    Victor

  • The main part of the safari page is grey and won't respond/can't type in any commands.  I can move back through the previous pages, and even open new ones via the URL, but can't get onto the main part of the page and I can't get onto the 9 page option. !?

    The main part of the safari page is grey and won't respond/can't type in any commands.  I can move back through the previous pages, and even open new ones via the URL, but can't get onto the main part of the page and I can't get onto the 9 page option. !?
    Help, please.

    Try clearing Safari's cache : Settings > Safari > Clear Cache (and Clear History)
    If that doesn't work then try closing Safari completely and then re-open it : from the home screen (i.e. not with Safari 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Safari app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    A third option is a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • Open a transaction via url, passing a parameter/value and SEND THE OK CODE

    Hello Guys,
    I'm trying to open a transaction via a hyperlink (System Action). That works so far, but my problem is that there is no button on the dynpro which triggers the going on. I have to press ENTER or the green hook in the corner of the gui. The transaction I'm opening is IE02 with an equipmentno. The value is in the destination field and the only thing what has to happen know is to trigger the next step (namely opening the "change equipment" dialog). Is there a standard OK-Code for the ENTER-Key or green hook ?
    Greetings,
    Jochen

    hi...
    I can't find that parameter in my Visual Composer environment. I tried to put it in my calling URL but it didn't work either. My URL looks like this:
    '/irj/servlet/prt/portal/prtroot/com.sap.portal.appintegrator.sap.bwc.Transaction?System=' & STORE@systemalias & '&TCode=ie02&GuiType=' & STORE@guitype & '&DynamicParameter=RM63E-EQUNR%3D' & @EQUIPMENT & '&PROCESS_FIRST_SCREEN%3D' & 'YES'
    Instead of the last parameter "PROCESS_FIRST_SCREEN" i could use a ok-code, but in transaction ie02 there is no ok-code to commit the screen, because there is no button...
    Any ideas?
    Greets,
    Jochen

  • Opening new frame in new thread

    I am having huge problems with an app. The main frame has a button on it. when the button is selected a second frame opens. I would like this frame to open in a new thread and the main thread to wait until it is closed again, but nothing I do seems to work! Does anyone have any ideas?
    I have the following code, but the problem is that it prints HAVE FINISHED before the Settings frame is closed:
    isRunning = true ;
    Thread settingsThread = new Thread()
         public void run()
              Settings sett = new Settings() ;
              isRunning = false ;
              System.out.println("stopped") ;
    settingsThread.start() ;
    while(isRunning)
    try
              System.out.println("sleeping") ;
              Thread.sleep(0) ;
         catch (InterruptedException ie)
              System.out.println("PROBLEM") ;
         } // end while
    System.out.println("HAVE FINISHED") ;

    Hi,
    it sounds like you are looking for a model dialog. If "Setting" inherits from JDialog you can use the constructor "JDialog(this, true)" in your frame of the main app. The problem in your code is, that event handling always has its own thread. You can't permit "running" the window in the background, but you can permit getting the focus with modal dialogs.
    bye
    Steffen

Maybe you are looking for