Closing a sub frame

Hey Folks
I posted a topic a few days ago concerned a problem i was having. The problem basically was that i was calling a frame from within a frame. All that i want to be able to do with this new frame is just for displaying a picture. I want to be able to close the sub frame without closing the main frame also, this is really the aim of tis post. I did up this small example of two sperate class. If any one can see the problem or can even fix it.
Thanking You
Ambrose
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class Main extends JPanel implements ActionListener
    private JButton b1;
    public Main() {
        //construct components
        b1 = new JButton ("Sub Form Button");
        //adjust size and set layout
        setPreferredSize (new Dimension (500, 500));
        setLayout (null);
        //add components
        add (b1);
        //set component bounds (only needed by Absolute Positioning)
        b1.setBounds (70, 85, 140, 20);
        b1.addActionListener(this);
     public void actionPerformed( ActionEvent e )
      Object Target = e.getSource();
     if ( Target ==b1)
     JFrame frame = new JFrame ("Sub");
        frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add (new Sub());
        frame.pack();
        frame.setVisible (true);
    public static void main (String[] args) {
        JFrame frame = new JFrame ("Main");
        frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add (new Main());
        frame.pack();
        frame.setVisible (true);
     class Sub extends JPanel implements ActionListener {
    private JButton b2;
    public Sub() {
        //construct components
        b2 = new JButton ("Main Form");
        //adjust size and set layout
        setPreferredSize (new Dimension (313, 230));
        setLayout (null);
        //add components
        add (b2);
        //set component bounds (only needed by Absolute Positioning)
        b2.setBounds (70, 85, 140, 20);
        b2.addActionListener(this);
     public void windowActivated(WindowEvent e)
     public void windowClosed(WindowEvent e)
     //Main.dispose();
     public void windowClosing(WindowEvent e)
          //new JFrame ("Main").dispose();
     public void windowDeactivated(WindowEvent e)
     public void windowDeiconified(WindowEvent e)
     public void windowIconified(WindowEvent e)
     public void windowOpened(WindowEvent e)
     public void actionPerformed( ActionEvent e )
      Object Target = e.getSource();
     if ( Target ==b2)
          System.out.println("Testing Method");
          JFrame frame = new JFrame ("Main");
        frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add (new Main());
        frame.pack();
        frame.setVisible (true);
}

Without looking at this code sample I can recommend you:
For example you have 4 classes:
loader : load app up
frame1 : self-explanatory
frame2 : self-explanatory
glue : class that has static references to both frames
So, thanx to glue, you can access both frames from whatever place in code.
-- Use jframe's setVisible (true/false) to hide/show frames whenever you want to.

Similar Messages

  • How to edit video to audio with a sub-frame precision?

    As all of my other posts I must begin by stating that this is not an RTFM issue. I have read the manuals and searched the web and this forum already.
    Also I beg you to read this question first before answering some nonsense. Ok, off the soapbox now.
    I am having issue synching video to audio.
    I am editing a music video at the moment at 23.976 fps. There is a master sound track (48/16) to which all of the video must be synched.
    I have not found a way of changing the position of a video clips in the timeline relative of the master audio track with a higher than a frame precision in order to obtain a perfect lip-sync.
    I am aware of the fact that one should enable "display audio units" in the timeline in order to shift an audio track relative the video with the sub frame precision, which is very useful when doing dialogue replacement to a video. For the video I am still not able to do so. Is it at all possible? Is there a workaround?
    How do they achieve a perfect lipsync when they make professional music videos?
    Thank you!

    Actually, you can set markers on the audio clip between frames.  I rember this from Jacob Robenbergs book Premiere Pro 2.0 Studio Techniques.
    You double click on the audio clip.  It opens in the Source monitor.  Then click on the fly-out menu and select SHOW AUDIO UNITS.
    Now in the source monitor you can place a marker (to be used for syncing) anyhere within the frame.  Set a numbered marker.
    Now you have a sync marker intraframe on the Audio.  You then sync this audio marker the Frame you need. Select both clips and choose syncronize.
    So it is not sub video frame, it is sub Audio frame to the correct video frame start.
    See below.  The audio sync marker is in the middle of the frame.  Hope this helps.

  • Is there a URL portlet that will display a site in a sub frame (iFrame) ?

    Applogies in advance if the terminology is wrong or I am in the wrong forum.
    Basically I want to set up a portlet on a page that will display the contents of another web site. So you define a URL and the website that you pointed at is displayed in a sub frame (iFrame) on a page in out web site.
    I know this has been done as I have seen it on oracles test portal site. Is this a standard function in portal or do I have to create a specific provider/portlet using the PDK.
    Any advise will be appreciated.

    Hi Dave,
    I have done something similar, I think that you have to create an HTML Portlet that contains the IFRAME.
    then you can set [IFRAME_name].location from Javascript.
    Regards Michael

  • Sub Frame Editing

    I'm editing a talking head. I need to add some words from a point earlier in the interview and rearrange some words that they said to help emphasis a point. Normally I cut the audio as close as possible in FCP add some b-roll and then take my OMF file to a sound editor who can do subframe editing to quickly make my edits sound natural. This time I do not have a budget to afford the magic of a sound person. So does Soundtrack do sub frame editing and can anyone recommend a good tutorial on line ideally one with video that I can follow to learn how to do this myself.
    I think sound people are magic. Thanks in advance.
    Mike Kroesen

    Yes, it can. As to where to go to learn it . . . I haven't come across anything. I would highly suggest duplicating your work before starting on it.

  • Sub frame slip audio

    Does anyone know if audio can be slipped by sub frame amounts in the time line. These are independent audio files. I found how to slip audio linked to video in the Viewer, but I'm trying to sync a non time code high res recording to the camera mic sound, not shift the sync of the audio attached to the video. Maybe it's in the manual, it usually is, but I don't seem to be able to find it.
    cheers

    It ISN'T in the manual... but here's how to do it in FCP:
    http://proappstuff.com/proapptipsvideotutorials/879F6B61-CFF9-4FD1-8D43-FDF89605 611A/BE5CA6A0-2D41-4F89-955C-16A05AC2A383.html
    CaptM

  • Flash Movie Closing - leaving "sub" movies running

    I'm not a Flash guy, but have an app to maintain which has a
    Flash front end.
    There is a main movie - background.swf and it loads a bunch
    of "sub" movies - mainly graphs and other panels of information.
    Something is sometimes causing the main movie -
    background.swf - to close, leaving just one of the graph movies
    still running. The graph movie then scales to take up 100% of the
    screen.
    Can anyone suggest where I might look to figure why this is
    happening?
    We're using Flash 6.0
    The app, at the time it fails, is invoking a backend servlet
    to get XML, and is maintaining a connection to Socket Server using
    an XMLSocket.
    We have 4 of these clients open (all opened from the same
    .swf) and only one of them is doing this.
    Is it possible for a movie to close itself?
    Thanks!

    Sounds like the issue is that the movie is being overwritten
    by something or the container of the movie is being overwritten.
    Not sure how it worked in Flash 6, but it sounds like the
    background.swf is being loaded to an empty movie clip or a
    container movie clip. Then when the servlet is invoked and
    information returned something is dynamically removing or
    overwriting the empty movie clip.
    Either that or there is an FSCOMMAND somewhere in the clip. I
    believe that can also close a movie.

  • Closing a sub jframe closes my application

    Hi,
    A beginner question. I have multiple jframe forms in my application. From my main windows i call sub jframes. The problem is that when the user closes a sub jframe my application terminates. How can overcome this problem.
    Thanks in advace.

    Don't set the default close operation to "exit on close."

  • Closing ADODB sub reference outs in VIs? (LV 8.5.1)

    I had a question about closing references to items I have not explicitly opened.
    e.g.
    I create an ADODB connection object.
    From that, I create an ADODB command object.
    One of the Command properties is the Parameters reference. I do a parameters.Refresh and using count, I loop through a For loop getting Item references. For each Item reference, I get a parameter object.
    One of the properties in the parameter object is a Properties reference.  I do a refresh on that and then go into another For loop. For each Item reference, I get a property node.
    OK, now that I've gone through getting/setting information, I need to start working my way out. The last property node had an item reference out from the properties node. Should I close that? The properties node itself had as a reference out, should that be closed? The Parameter node has a reference out, should that be closed? Finally, the Parameters node has a reference out, should I close that?
    The command and connection nodes I explicitly opened, so I know I need to close them. But these other references, should I be closing them, or do I only need to close the references I explicitly created?
    Thanks, Bob

    "intp56" <[email protected]> wrote in message
    news:[email protected]..
    > I download LabSQL, it looks pretty close to what I want.
    > &nbsp;
    I'd suggest to use it, and to send them your additional code in return if
    you're alowed to do that... Or suggest what you are missing to the project,
    so they can add it in later versions.
    > I'm looking for a VI that queries a stored procedure to determine what the
    parameters are, then creates a LabVIEW cluster with the correct datatypes.
    The idea is to call that first to create the Parameters object, then use it
    later, particularly for DML operations. (Say insert rows from a LV table.)
    I've tried using ADO recordsets to insert large datasets, and found it's
    performance to be lacking or unacceptable. I can insert several 1000 records
    per second with successive calls to a stored procedure where I specify ahead
    of time no result set.
    Not sure how ADO does this. I vaguely recall something about it. I think the
    values are send item by item, and I think there was a faster way to send the
    data by using a variant that directly accepts an array... It's been a while
    since I've messed around with that, and I might not have succeeded to get it
    working. Googling for "ADO large data sets" or something might give some
    clues.
    > If I really have lots of rows to insert, then I've found it better to
    prepare a file, move it to a place where the database can see it, and BULK
    INSERT it asynchronously and report the results back later.
    Can't imagine that this is the best way to do it, but it's a good
    workaround.
    > BTW, I liked the tip that any reference WIRE needs to be closed, that
    gives me a nice rule to know what I need to closed.
    But even if there is no wire comming out of a reference property, you still
    need to close it. So: every "green" read property should be closed.
    Regards,
    Wiebe.

  • Ending a sub frame

    hi there
    i want to close a frame in my app without exiting the main app
    what to write in the actionPerformed method to place on the button
    Thanks

    This is one way:
    subFrame.setVisible(false);
    subFrame.dispose();

  • Frame Frame Frame Frame Frame

    hello,
    I have a problem with frame.
    My application opens in a frame window.
    The main frame opens another or multiple frames.
    i added a windowlistener in main frame with System.exit(0) to exit the program.
    if i will add the same windowlistener to other subframes then the program will terminate
    on closing any subframe, which i do not want to do.
    --I want to close the specific frame with main frame and other sub frames to continue.
    using frame.setVisible(false) only hides the frame...
    how to do that??

    When you open multiple frames in another frame then close the main frame, and ewxirt the program, your are actually closing the entire program, not just that one frame, so just hiding it would probably work. I think you can use destroy and dispose methods to destroy the frames w/o closing the program

  • Sub-ledger other than vendor/customer/assets

    Hi
    Our client is having requirement to have sub-ledger (other than vendor/customer/assets) for outstandings and required a report with opening balances, debits, credits and closing balance sub-ledger wise.

    Hi,
    As per your requirement from what i have understood please correct me if I am wrong.
    You want to book your expense with reference to an Outstanding GL.
    Then pay off using the Outstanding GL.
    And you don't want to show the expense gl but should reflect in your Outstanding GL.
    If this is your requirement then please clarify that you don't want to show the expense in TB and also you want to show the amount in Outstanding GL which is a Balance Sheet account.
    At the time of payment what GL will you use and also if you are not showing the expense in the TB then where you want this expense to reflect.
    Edited by: lolu jo on Feb 14, 2012 12:34 PM

  • Can I retime the audio by a fraction of a frame?

    I recorded Audio separately on a digital voice recorder and after 11 minutes there is a sync drift of 1 - 2 frames.
    By using the Retime Editor I can drag the audio the necessary frame to get it almost spot on.
    I seem to recollect hearing that audio could be edited to a fraction of a frame, so can it also be retimed to around half a frame.
    I realise that nobody can tell there is a loss of sync but I would like to get it completely perfect  .  .  .  OCD !

    You can shift the audio in in sub frame levels but you can't retime in subframe incvrements. Nobody can see a sub frame sync discrepancy.

  • Sub Contracting Challan

    Hi All,
    In Subcontracting process first we are sending the raw material to sub contracting  vendor with Sub Contracting Challan. Now subcontrating Vendor return the raw material due to quality problem. So, please suggest what process we have to do in SAP ? Because we have to closed the sub contracting challan and stock of raw material should come under  unrestricted  use.
    Thanks in Advance.....
    Sanjay

    HI
    Take back material with MB1B mov type 542. Reconcile the challan wrt this 542 mov type document.
    And then complete the challan also.
    Your Subcon PO is still open and u can send fresh material to vendor with MB1B 541 and make a new challan and then complete ur process.
    Thank You

  • Editing video by half frames or less

    I'm and audio guy trying to edit video, so I'm not sure if I'm using the correct terms, but can you slide video in Final Cut Pro by less than a frame? e.g. a half frame or 1/4 frame, or even miliseconds?
    I know that in ProTools you can "nudge" audio around on many different "grids". Is is possible to view Final Cut Pro in a 1/2 or 1/4 frame 'grid'?
    The goal here is to edit 4 video segments (or video 'tracks') that must line up with my 'clap board' start. I can see my 'clap' in the audio wave form for all 4 video tracks, but they are just slightly off, by a 1/2 and 1/4 frame. Hence I need to slide them just a bit to have them line up.
    Thanks for your help, and I apologize if I'm not using the correct terms.
    glankrudolph
    Powerbook G4   Mac OS X (10.4.4)   Final Cut Pro HD 4.5

    Maybe this is just the difference between audio and video editing programs, not sure. Perhaps there are better video programs out there that can nudge video in smaller increments?
    In the audio program I am running, ProTools, you can nudge audio by 1/4 frame or a sub frame. You can also set the grid to view these increments, thus you are able to 'snap' audio (and one track of video) to a 1/4 frame or sub frame grid.
    Hence I could bring the video into ProTools and adjust it so that the very beginning of the video is where my 'clap' is, then import that into Final Cut Pro. However, this would add another step of processing the video and I may loose some quality. (ProTools converts the video during a 'bounce to video' step when exporting.)
    For the record, in the audio world a 1/4 frame can be very obvious. The video I am working on shows three percussionists playing very complex 32nd-note patterns at 120 bpm. If the audio is 1/4-frame off, it sounds like absolute mud.
    We tested two video tracks together, which were off by a 1/2 frame, and it actually looks ok. I was recording the audio simultaneously in ProTools so I'm using that audio anyway, so it will work out fine.
    I still feel that Final Cut Pro should have the ability to 'razor' at the exact point you want to cut, then snap to the frame.
    Thanks for the help.
    Note to Apple: talk to DigiDesign's ProTools programmers about showing a 1/4-frame or sub-frame grid in Final Cut Pro. Maybe they can help you.
    Powerbook G4   Mac OS X (10.4.4)  

  • Is there a way to slide a clip less than one frame?

    Hi, When syncing audio to video, or lining up two different sources of the same audio, I sometimes find that I want to slide a clip less than one frame in the timeline. Is there a way to do this?
    Thanks, Bob

    You can slip the audio in sub-frame increments, but you cannot slip video as the frame is the basic unit.
    To slip the audio in increments less than a frame, see:
    http://documentation.apple.com/en/finalcutpro/usermanual/index.html#chapter=43%2 6section=7%26tasks=true
    MtD

Maybe you are looking for

  • How to get the value from a database without submitting a jsp page

    I have a jsp which has a text box depending on the value entered I want to get the value from a database for other two fields with out submitting jsp page. I am using struts. Thanks For any assistance provided.

  • Replica of Accrual Reconciliation Report

    Hi Gurus, I have a requirement in which I have to make a query which will give an exact replica of what output will be obtained from "Accrual Reconciliation Report" without using temporary table po_accrual_reconcile_temp_all. At the end of the day it

  • Disable ICE (Interactive Connectivity Establishment) protocol in Lync 2013 via ClientPolicy

    Hi, is the DisableICE clientpolicy parameter still valid in Lync 2013, or it has been deprecated since Lync 2010? Lync 2010: its listed here: http://technet.microsoft.com/en-us/library/gg398300%28v=ocs.14%29.aspx Lync 2013: its missing from here: htt

  • Incorrect Web Display of Images

    Images I have uploaded do not display the same Photosop as viewed in a browser (viewed in Safari, or Firefox on Apple Cinema display OS10.4.11) . The web images appear de-saturated and a bit washed out. (I use Adobe RGB 1998) I'm a print imaging spec

  • Java HttpServlet Problem

    I made a project with a HttpServlet. So I use some import lines: import javax.servlet.*; import javax.servlet.http.*; But when I try to compile I get this error: Error(2,1): cannot access directory javax\servlet; verify that directory is reachable fr