How call a frame from a Servelt please

how call a frame from a Servelt please

hi, you can output a javascript that calls a frame as follows
PrintWriter out=response.getWriter();
out.print("<script>");
out.print("window.frames['frameName'].functionCall();");
out.print("</script>");
good luck

Similar Messages

  • This is how you extract frames from video

    right then, in answer to many posts about how to get the individual frames from video, here is my solution. it seems to work with mpg files but it doesnt seem to work with any of the avi files i tried. not sure why it doesnt work with those. i have modified javas frame access.
    nothing is displayed except it prints which frame it is doing.
    if anyone wants to improve it, please do. i still dont understand fully how it works so i probably wont be able to answer many questions about it. anyway here it is:
    * @(#)FrameAccess.java 1.5 01/03/13
    * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
    * Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
    * modify and redistribute this software in source and binary code form,
    * provided that i) this copyright notice and license appear on all copies of
    * the software; and ii) Licensee does not utilize the software in a manner
    * which is disparaging to Sun.
    * This software is provided "AS IS," without a warranty of any kind. ALL
    * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
    * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
    * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
    * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
    * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
    * LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
    * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
    * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
    * OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
    * POSSIBILITY OF SUCH DAMAGES.
    * This software is not designed or intended for use in on-line control of
    * aircraft, air traffic, aircraft navigation or aircraft communications; or in
    * the design, construction, operation or maintenance of any nuclear
    * facility. Licensee represents and warrants that it will not use or
    * redistribute the Software for such purposes.
    import java.awt.*;
    import javax.media.*;
    import javax.media.control.TrackControl;
    import javax.media.Format;
    import javax.media.format.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.imageio.stream.*;
    import java.awt.image.*;
    import java.util.*;
    import javax.media.util.*;
    * Sample program to access individual video frames by using a
    * "pass-thru" codec. The codec is inserted into the data flow
    * path. As data pass through this codec, a callback is invoked
    * for each frame of video data.
    public class FrameAccess implements ControllerListener {
         Processor p;
         Object waitSync = new Object();
         boolean stateTransitionOK = true;
         public boolean alreadyPrnt = false;
         * Given a media locator, create a processor and use that processor
         * as a player to playback the media.
         * During the processor's Configured state, two "pass-thru" codecs,
         * PreAccessCodec and PostAccessCodec, are set on the video track.
         * These codecs are used to get access to individual video frames
         * of the media.
         * Much of the code is just standard code to present media in JMF.
         public boolean open(MediaLocator ml) {
              try {
                   p = Manager.createProcessor(ml);
              } catch (Exception e) {
                   System.err.println(
                        "Failed to create a processor from the given url: " + e);
                   return false;
              p.addControllerListener(this);
              // Put the Processor into configured state.
              p.configure();
              if (!waitForState(Processor.Configured)) {
                   System.err.println("Failed to configure the processor.");
                   return false;
              // So I can use it as a player.
              p.setContentDescriptor(null);
              // Obtain the track controls.
              TrackControl tc[] = p.getTrackControls();
              if (tc == null) {
                   System.err.println(
                        "Failed to obtain track controls from the processor.");
                   return false;
              // Search for the track control for the video track.
              TrackControl videoTrack = null;
              for (int i = 0; i < tc.length; i++) {
                   if (tc.getFormat() instanceof VideoFormat) videoTrack = tc[i];
                   else     tc[i].setEnabled(false);
              if (videoTrack == null) {
                   System.err.println("The input media does not contain a video track.");
                   return false;
              String videoFormat = videoTrack.getFormat().toString();
              Dimension videoSize = parseVideoSize(videoFormat);
              System.err.println("Video format: " + videoFormat);
              // Instantiate and set the frame access codec to the data flow path.
              try {
                   Codec codec[] = { new PostAccessCodec(videoSize)};
                   videoTrack.setCodecChain(codec);
              } catch (UnsupportedPlugInException e) {
                   System.err.println("The process does not support effects.");
              // Realize the processor.
              p.prefetch();
              if (!waitForState(Processor.Prefetched)) {
                   System.err.println("Failed to realise the processor.");
                   return false;
              p.start();
              return true;
         /**parse the size of the video from the string videoformat*/
         public Dimension parseVideoSize(String videoSize){
              int x=300, y=200;
              StringTokenizer strtok = new StringTokenizer(videoSize, ", ");
              strtok.nextToken();
              String size = strtok.nextToken();
              StringTokenizer sizeStrtok = new StringTokenizer(size, "x");
              try{
                   x = Integer.parseInt(sizeStrtok.nextToken());
                   y = Integer.parseInt(sizeStrtok.nextToken());
              } catch (NumberFormatException e){
                   System.out.println("unable to find video size, assuming default of 300x200");
              System.out.println("Image width = " + String.valueOf(x) +"\nImage height = "+ String.valueOf(y));
              return new Dimension(x, y);
         * Block until the processor has transitioned to the given state.
         * Return false if the transition failed.
         boolean waitForState(int state) {
              synchronized (waitSync) {
                   try {
                        while (p.getState() != state && stateTransitionOK)
                             waitSync.wait();
                   } catch (Exception e) {
              return stateTransitionOK;
         * Controller Listener.
         public void controllerUpdate(ControllerEvent evt) {
              if (evt instanceof ConfigureCompleteEvent
                   || evt instanceof RealizeCompleteEvent
                   || evt instanceof PrefetchCompleteEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = true;
                        waitSync.notifyAll();
              } else if (evt instanceof ResourceUnavailableEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = false;
                        waitSync.notifyAll();
              } else if (evt instanceof EndOfMediaEvent) {
                   p.close();
                   System.exit(0);
         * Main program
         public static void main(String[] args) {
              if (args.length == 0) {
                   prUsage();
                   System.exit(0);
              String url = args[0];
              if (url.indexOf(":") < 0) {
                   prUsage();
                   System.exit(0);
              MediaLocator ml;
              if ((ml = new MediaLocator(url)) == null) {
                   System.err.println("Cannot build media locator from: " + url);
                   System.exit(0);
              FrameAccess fa = new FrameAccess();
              if (!fa.open(ml))
                   System.exit(0);
         static void prUsage() {
              System.err.println("Usage: java FrameAccess <url>");
         * Inner class.
         * A pass-through codec to access to individual frames.
         public class PreAccessCodec implements Codec {
              * Callback to access individual video frames.
              void accessFrame(Buffer frame) {
                   // For demo, we'll just print out the frame #, time &
                   // data length.
                   long t = (long) (frame.getTimeStamp() / 10000000f);
                   System.err.println(
                        "Pre: frame #: "
                             + frame.getSequenceNumber()
                             + ", time: "
                             + ((float) t) / 100f
                             + ", len: "
                             + frame.getLength());
              * The code for a pass through codec.
              // We'll advertize as supporting all video formats.
              protected Format supportedIns[] = new Format[] { new VideoFormat(null)};
              // We'll advertize as supporting all video formats.
              protected Format supportedOuts[] = new Format[] { new VideoFormat(null)};
              Format input = null, output = null;
              public String getName() {
                   return "Pre-Access Codec";
              //these dont do anything
              public void open() {}
              public void close() {}
              public void reset() {}
              public Format[] getSupportedInputFormats() {
                   return supportedIns;
              public Format[] getSupportedOutputFormats(Format in) {
                   if (in == null)
                        return supportedOuts;
                   else {
                        // If an input format is given, we use that input format
                        // as the output since we are not modifying the bit stream
                        // at all.
                        Format outs[] = new Format[1];
                        outs[0] = in;
                        return outs;
              public Format setInputFormat(Format format) {
                   input = format;
                   return input;
              public Format setOutputFormat(Format format) {
                   output = format;
                   return output;
              public int process(Buffer in, Buffer out) {
                   // This is the "Callback" to access individual frames.
                   accessFrame(in);
                   // Swap the data between the input & output.
                   Object data = in.getData();
                   in.setData(out.getData());
                   out.setData(data);
                   // Copy the input attributes to the output
                   out.setFlags(Buffer.FLAG_NO_SYNC);
                   out.setFormat(in.getFormat());
                   out.setLength(in.getLength());
                   out.setOffset(in.getOffset());
                   return BUFFER_PROCESSED_OK;
              public Object[] getControls() {
                   return new Object[0];
              public Object getControl(String type) {
                   return null;
         public class PostAccessCodec extends PreAccessCodec {
              // We'll advertize as supporting all video formats.
              public PostAccessCodec(Dimension size) {
                   supportedIns = new Format[] { new RGBFormat()};
                   this.size = size;
              * Callback to access individual video frames.
              void accessFrame(Buffer frame) {
                   // For demo, we'll just print out the frame #, time &
                   // data length.
                   if (!alreadyPrnt) {
                        BufferToImage stopBuffer = new BufferToImage((VideoFormat) frame.getFormat());
                        Image stopImage = stopBuffer.createImage(frame);
                        try {
                             BufferedImage outImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
                             Graphics og = outImage.getGraphics();
                             og.drawImage(stopImage, 0, 0, size.width, size.height, null);
                             //prepareImage(outImage,rheight,rheight, null);
                             Iterator writers = ImageIO.getImageWritersByFormatName("jpg");
                             ImageWriter writer = (ImageWriter) writers.next();
                             //Once an ImageWriter has been obtained, its destination must be set to an ImageOutputStream:
                             File f = new File(frame.getSequenceNumber() + ".jpg");
                             ImageOutputStream ios = ImageIO.createImageOutputStream(f);
                             writer.setOutput(ios);
                             //Finally, the image may be written to the output stream:
                             //BufferedImage bi;
                             //writer.write(imagebi);
                             writer.write(outImage);
                             ios.close();
                        } catch (IOException e) {
                             System.out.println("Error :" + e);
                   //alreadyPrnt = true;
                   long t = (long) (frame.getTimeStamp() / 10000000f);
                   System.err.println(
                        "Post: frame #: "
                             + frame.getSequenceNumber()
                             + ", time: "
                             + ((float) t) / 100f
                             + ", len: "
                             + frame.getLength());
              public String getName() {
                   return "Post-Access Codec";
              private Dimension size;

    The quality of the produced video from this example is very poor.
    It comes to huuuuge surprise the following fact.
    If you comment the line where you set the PostAccessCodec, the chain of the codecs is:
    MPEG-1 decoder -> YUV2RGB -> Direct Draw Renderer. ( The one used from the system to decode and render)
    If you run the example purely as is above you get the following sequence(as long with the poor quality):
    MPEG-1 decoder -> YUV2RGB -> Windows GDI Renderer.
    So you say lets set another Renderer. So
    you add the following line videoTracker.setRenderer( new DDRenderer() )
    What comes to a surprise is the following chain of codecs:
    MPEG-1 decoder -> YUV2RGB -> Post Codec -> Java RGB Converter - > DDRenderer
    The quality now may be perfect but video runs to slow. The surprising thing here is that even though we have set the outputFormat of the PostAccessFrame codec to RGBFormat the system converts it again to RGB through codec Java RGB Format.
    After searching a lot and reaching the conclusion that the deference between the 2 RGB's is their sizes I sudently was brought in front of a method called grabFrame(). Bels started ringing inside my head. Starts were comming up. Looking at the definition of the class com.sun.media.renderer.video.DDRenderer I descovered that this damn class implements the FrameGrabbingControl Interface. What the f.....? The problem that consumed 4 days of my life and multiplied with 10 to give hours has finally come to an and.
    Summing up the solution for grabbing frames is this!!!!!
    DDRenderer renderer = new DDRenderer();
    videoTrack.setRenderer( renderer );
    and in your actionPerformed implementation
    FrameGrabbingControl fr = (FrameGrabbingControl)renderer.getControl( "javax.media.control.FrameGrabbingControl");
    Buffer frame = fr.grabFrame();
    The following stuff ...are stated in FrameAccess
    --Sniper

  • How call Flash function from C++?

    Communication between C++ and ActiveX Flash object is
    adjusted. The ActiveX calls C++ functions. But how a call Flash
    functions from C++?
    I try so: v_flash is control variable of the ActiveX the
    container.
    A code: v_flash. CallFunction ("test");
    No effect
    How it to make?

    Hi David, Thanks for the response. I found this solution by
    following method:
    Flash code either in class or frame:
    ExternalInterface.addCallback("sendTextToFlash",
    getTextFromJavaScript);
    public function getTextFromJavaScript(user):void {
    trace(user);
    //Now whenever JavaScript function will be called from any
    HTML or back end language then it definetly call directly that
    flash function by following method
    //HTML Code
    function sendData(user){
    //alert("values coming "+user);
    SendDataToFlashMovie(user);
    function getFlashMovieObject(movieName){
    if (window.document[movieName]){
    return window.document[movieName];
    if (navigator.appName.indexOf("Microsoft Internet")==-1){
    if (document.embeds && document.embeds[movieName])
    return document.embeds[movieName];
    else {// if (navigator.appName.indexOf("Microsoft
    Internet")!=-1) {
    return document.getElementById(movieName);
    function SendDataToFlashMovie(user) {
    var flashMovie=getFlashMovieObject("myFLA");
    flashMovie.sendTextToFlash(user);
    Now HTML or back end language has just need to call
    sendData(
    value)
    I think its the right way, but if there is any other short
    method like just call the function name from HTML and that directly
    respond to Flash as per function name, then please let me
    know.

  • How to stop frame from closing?

    Hi,
    ramka.addWindowListener(new WindowAdapter()
                  public void windowClosing(WindowEvent e)
                      Object [] qqq = {"yes", "no"};
                      int answer = JOptionPane.showOptionDialog(
                                null,
                                 "want to close window?",
                                 JOptionPane.YES_NO_OPTION,
                                  JOptionPane.QUESTION_MESSAGE,
                                  null,
                                 qqq,
                                 qqq[1]);
                      if (answer == JOptionPane.YES_OPTION)
                           // WHAT TO DO TO STOP WINDOW FROM CLOSING?
                  });as you can see above i want to stop frame from closing.
    what should i do in the commented line?
    or maybe somewhere else?
    please help,
    thanks

    Hello friend,
    I've found a solution for your query. I think, you'll get a solution from my codings. I've given you below my codings,plz go through it.Verify it. Reply me about my codings.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JOptionPane;
    public class MyFrame extends JFrame{
         JButton jb=new JButton("My Details");
         public MyFrame(){
         JPanel jp=new JPanel();
         jp.add(jb,new FlowLayout(FlowLayout.CENTER));
         add(jp);
         jb.addActionListener(new ActionListener(){
         public void actionPerformed(ActionEvent ae){
                   if(ae.getSource()==jb){
                        String str[]={
                             "Name : Karthikeyan.K",
                             "Email-ID : [email protected]"
                        JOptionPane.showMessageDialog(null, str);
    WindowCloser wc=new WindowCloser();
    addWindowListener(wc);
         class WindowCloser extends WindowAdapter{
              public void windowClosing(WindowEvent we){
                   int res=JOptionPane.showConfirmDialog(null,"Do you want to exit from it?","Confirmation!!!",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE);
                   switch(res){
                        case JOptionPane.YES_OPTION:
                             dispose();
                             System.exit(0);
                             break;
                        case JOptionPane.NO_OPTION:
                             repaint();
                             doOpenFrame();
                             break;
                        case JOptionPane.CANCEL_OPTION:
                             repaint();
                             doOpenFrame();
                             break;
                        case JOptionPane.CLOSED_OPTION:
                             repaint();
                             doOpenFrame();
                             break;
         public static void doOpenFrame(){
              MyFrame mf=new MyFrame();
              mf.pack();
              mf.setSize(400,400);
              mf.setVisible(true);
         public static void main(String ar[]){
         doOpenFrame();
    }

  • How call a jsp from oracle10g forms.

    Hi,
    I am using oracle10g forms.can i call a jsp from oracle10g form? if it is possible how i call a jsp?how i call back form from jsp? thanks.
    Edited by: Arulselvan Dharmalingam on Apr 27, 2010 8:21 PM
    Edited by: Arulselvan Dharmalingam on Apr 27, 2010 8:22 PM

    What is _blank argument?how i pass this value?Its already the correct value _blank as secong arguments open a new browser window.
    where i place jsp(web page)?in the url
    how i maintain form session in jsp?you cannot. What you could do, is pass the username to the jsp.
    So a call to a jsp looks like this
    WEB.SHOW_DOCUMENT('http://server:port/path/the_name_of_the_jsp.jsp', '_blank');

  • How call session bean from Client side

    Hi
    calling session bean from client side it gives Lookup erroe, it gives JNDI error
    how we know session bean is working. in Admin tree bean statis is reb Flaf, and ID is "Down" how we activate it..
    null

    If you can make a connection using sess_sh, then you know that you have configured your database and listener properly. If it is not working, read the manuals that you can download from technet. They are pretty good, and if you follow the directions, you should see success.
    Good Luck!
    Brad

  • Help? How to dispose frame from JList Command

    To every one out there,
    i design an application with a menu using Jlist, when i selected a element from the list, it bring me to the next frame,however this frame with the JList that i want to dispose is still there.
    I have try this.dispose();
    this.show(false);
    this.hide();
    and it give a compliation error or unable to run or not function as i expected.
    i call the frame using
    Frame1 obj = new Frame();
    obj.show(true);

    Here is my codes
    String[] select={"Register new Disc","Delete disc","Edit disc",
    "Set Rental Price and duration","View and Print",
    "Rental Limit for members","Password"};
    jList1=new JList(select);
    MouseListener mouseListener = new MouseAdapter() {
    public void mouseClicked(MouseEvent e) {
    if (e.getClickCount() == 2) {
    int index = jList1.locationToIndex(e.getPoint());
    if(index==0){
    Frame2 obj = new Frame2();
    obj.setSize(600,600);
    obj.show(true);
    if(index==1){
    Delete obj=new Delete();
    obj.setSize(600,600);
    obj.show(true);
    if(index==5){
    Rental obj=new Rental();
    obj.setSize(600,600);
    obj.show(true);
    if(index==6){
    login obj=new login();
    obj.setSize(600,600);
    obj.show(true);
    jList1.addMouseListener(mouseListener);

  • Importing frames from video help please

    Why is photoshop elelments 9 not recognizing .wmv or .avi files when trying to import photos from videos. I have used this feature before without problems using .wmv videos, why did it quit working all of the sudden?

    When something goes awry, start by resetting the preferences. Quit the editor, then restart it from the button in the organizer or the button in the Welcome Screen, whilie holding down Ctrl+Alt+Shift (command+option+shift on a mac). Keep the keys down till you see a window asking if you want to delete the settings file. You do.
    However, having said that, are you sure these wmv files are the same as the ones you did before? Frame from video doesn't work with high-def videos, for example, and it's not great with long ones, either.

  • How to call a frame from another frame?

    Hi
    I have a frame with constructor
    public TestAudibleAlert(String args[])
         super(args,
                "Test",
                ProcessConstants.FORM_TEST_AUDIBLE_ALERT,
                true,
                MENU_BASIC,
                TOOL_BASIC);
           init();
    {code }
    I need to call the same constructor from some other file which is a Frame. I am not knowing how to do this. I am trying as :
    TestAudibleAlert = new TestAudibleAlert(args).
    I don't no how to iniialize args in the second file.
    Edited by: jackdoing on Nov 26, 2008 1:04 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    So you want to know how to declare and initialize a String[]?
    String[] args = {"One", "Two", "Three"};[http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html]

  • How to call main frame from showMessage OK button clicked?.

    hello,
    I create one project. there, I create one textfield and button. after clicking it, the input add into JList.
    when I click the list component and enter OK button ,it will go to another window.
    When the input is fault, it show error in dialog box. then, when i click the OK button, it must go to main window and processed from first.
    My problem is,
    When I click OK in show dialog box, it is not going to main frame.
    if((source==ConnectButton) != firstSel)
                String message="Not Able to Connect to the Specified IP !!!";
              int answer = JOptionPane.showConfirmDialog(MainFrame.emsMainFrame, message);
              if (answer == JOptionPane.YES_OPTION) {
                  initcomp();
                   MainFrame.setSize(750, 550);
                   // Image icon = Toolkit.getDefaultToolkit().getImage("Images.gif");
                    //emsMainFrame.setIconImage(icon);
                     emsMainFrame.setVisible(true);
                     emsMainFrame.setEnabled(true);
                      initSNMPlogin();
                    // BroIPSelect.setVisible(true);
                    // BroIPSelect.setEnabled(true);
            // workPanel.add();
            //   JPanel cp = new JPanel(new GridLayout(0,3));
              workPanel.setVisible(true);
            workPanel.add( new JLabel( "work" ) );
           // leftPanel.setVisible(true);
          else if (answer == JOptionPane.NO_OPTION) {
            // User clicked NO.
                  System.exit(0);
        }        To go to main frame and access , what can I do.
    thanks.

    Wow that's a mess.
    Normally when you want to go back to your main window, the only thing you have to do is hide your second window. Then the focus automatically returns to your main window.
    Hiding a frame is calling setVisible(false) on it.
    If you keep a reference somewhere to your hidden frame, you can easily show it up again without rebuilding it.
    But post some other code.
    What is "MainFrame"?
    Is it a class with static methods for accessing MainFrame.emsMainFrame?
    Note that objects/instances/variables/references should start with a lowercase letter, and classes should start with an uppercase letter.
    Why do you call initcomp()? If it is a function for initialising the GUI components, then make it run once at the start of your program.
    Why do you have this XOR:
    ((source==ConnectButton) != firstSel)

  • Call details frame from master frame in report 10g

    Hi
    I have i am using oracle 10g reports
    i have two frame one for State master(Main Frame Name : M_G_state_name,Repeatig Fram name : G_State)
    and other for city master(Main Frame Name : M_G_city_name,Repeatig Fram name : G_city)
    in state master frame two feild State code and State Name and in city Master Frame three feild as city_code,city_name,State_code
    i want that when i click on State_code of State master Frame then it show City details city master Frame of selected state.
    i have no idea how can do these.please help me
    thanx in advance

    Hello,
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwwhthow/whatare/reports/webrpt/fa_hyperhtml.htm
    Reports output in HTML format can include the following types of Web links:
    A link from an object to another object within the same report, or to another HTML or PDF document (a hyperlink).
    Regards

  • How to remove frames from a exporrted Crystal Report10 ms word file

    Dear All
    I am generating reports in MS Word Format from Crystal Report 10 Export. The problem is that I have to change the formatting of the report, once it is exported to word file but the exported word file containing so may frames and due to these frames, I am unable to format the word file, copy/paste like MS word can.
    Please give me some solution to remove frmaes from word file or tell me some settings in the crystal report at the design time to generate report without frames.
    Thank you.
    Sachiko

    Mohamed,
    I am using Crystal Report 10 and no "Microsoft Word - Editable (RTF)" in the list
    I tried "MS Word" and "Rich Text Format", but both were same. Frames each text fields
    and can not copy/paste/edit
    Thank you.
    Sachiko

  • How to stop frame from closing in windowClosing event ?

    I have an application which will download some files from the web.
    If the user attempts to close the applicaiton and if some files donwload action is in progress then i need to warn the user and prevent the window from closing. This is what i have done. But what happens is message box is displayed and my window is getting closed. How to get rid of this ? need your help...
    frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent we) {
                        if(DownloaderGUI.tableModel.isSomeThingDownloading()) {
                             JOptionPane.showMessageDialog(null,"cannot close when something is downloading");
                             return;
                        System.out.print("closing..");
                        backEndThread.setCanQuit(true);
                        cleanUp();
                        System.exit(0);
              });

    I have also done a similar things but still window is getting closed.
    public void actionPerformed(...)
    if(!canquit) {
          return;
    } else {
          System.exit(0);
    }Message was edited by:
    chaos_begins_here

  • How call a method from another class

    i make three class.class A,class B and class C.
    class A have One button.
    Class B have a action listener of that button.
    class c have a metod like
    public void test(){     }
    how can i call a method in class b from class c;
    is it necessary to pass the class a or b through the constructor of class c or another way to call the method.

    public class Foo
        public static void main(String[] args)
            Bar.staticFn();
            Bar b = new Bar();
            b.memberFn();
    class Bar
        public void memberFn()
            System.out.println("memberFn");
        public static void staticFn()
            System.out.println("staticFn");
      }

  • I have an iPad3. I would like to know how to delete pictures from photos. Please advise.

    How do I delete photos from iPad3?

    Synced photos cannot be deleted on the iPad. Only photos taken with the iPad and transferred with the Camera Connection Kit can be deleted.
    You need to delete the photos in iTunes and sync again.

Maybe you are looking for

  • InDesign CS4 and Yosemite

    After upgrading to Yosemite, my thumbnail previews no longer show in InDesign CS4. Any ideas?

  • Quey return one line by parent column

    Hi, my table or view is: SQL > select * from myTable; Parent Children parent1 chil1 parent1 chil2 parent1 chil3 parent2 chil4 parent2 chil5 parent3 chil6 how write my query to have result like: parent1 child1, child2, child3 parent2 child4, child5 pa

  • Can anyone clear me about XATransactionTimeout and JTA timeout ?

    I set JTA timeout seconds to 180 from WLS Admin Conosle. If I set XASetTransactionTimeout="false" what transaction timeout value that used at this option ? And if I set XASetTransactionTimeout="true" and set XATransactionTimeout="0" to JDBC XA pool w

  • Amend the rules in BCM

    Hi  All, How can i  amend the rules in BCM  (Bank Communication Management) to accept payments from USD  0  onwards asap. As we need the capability to make payments under USD 1 for all entities. Thanks & Regards vishwaas

  • Proxy-XI-JDBC

    Hi All, I want to Do Proxy-JDBC Asysnchronous Scenario. I have One BAPI With Request & Response Messages in R/3. <u><b>ABAP Work</b></u> ABAPer created One Report to Execute this BAPI in R/3,,,by Providing Request & Based on that request he will get