Need help on closing frame

I have a new frame that opens from a menu and I want to be able to push a button and have that frame (the frame the button is in) to close, kind of like a cancel button so you push cancel and nothing happens except the frame closes.
Here is my code for this frame:
public class Logout extends JFrame
    JPanel contentPane;
    BorderLayout borderLayout1 = new BorderLayout();
    GridBagLayout logoutGridBag = new GridBagLayout();
    JButton buttonLogout = new JButton();
    JButton buttonCancel = new JButton();
    public Logout()
        try
            jbInit();
        catch (Exception exception)
            exception.printStackTrace();
    private void jbInit() throws Exception
        contentPane = (JPanel) getContentPane();
        contentPane.setLayout(logoutGridBag);
        buttonLogout.setText("Logout");
        buttonCancel.setText("Cancel");
        //Cancel Logout, return to main menu
        buttonCancel.addActionListener(new ActionListener()
            public void actionPerformed(ActionEvent evt)
        contentPane.add(buttonCancel,
                        new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0
                                               , GridBagConstraints.SOUTHEAST,
                                               GridBagConstraints.NONE,
                                               new Insets(9, 10, 7, 3), 4, 51));
        contentPane.add(buttonLogout,
                        new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
                                               , GridBagConstraints.NORTH,
                                               GridBagConstraints.NONE,
                                               new Insets(8, 16, 4, 17), 2, 52));
}Thanks
Scott

Well not sure what else I can try to get this frame to close.As I said you should be using a JDialog not a JFrame
Problem is that the whole application closes and not just the frame I have up.So create a [url http://www.physci.org/codes/sscce.jsp]Simple Executable Demo Program that shows this behaviour. That way we don't have to guess what you are doing. You should be able to do this in about 15-20 lines of code and you will learn alot:
a) create a JFrame with a JButton on it.
b) add code to the button to create a display a JDialog
c) on the JDialog add a JButton to close the dialog
Read the [url http://java.sun.com/docs/books/tutorial/uiswing/TOC.html]Swing Tutorial if you need help with any of these basic steps to GUI building.

Similar Messages

  • Need help with inserting frame with scrolling images

    Hi,
        Im a beginner and need help putting a single box/frame with scrolling images in the middle of my layout, so that when viewed in browser, the header and footer remain in place, while the images and info in the frame in the centre of the page can be scrolled down/up?

    You can use an iframe element <iframe src="" width="" height="" scrolling="yes"> though if you're concerned with crawlers you should avoid frames as much as possible. 

  • Need Help Pasting Key Frames from one still image to others, and Changing the duration of multiple still images.

    I'm working on a stop motion project, and I have at least a thousand still images to work with.
    I have adjusted several Key Frame settings on the 1st still image in my project, such as
    Brightness
    Cropping
    Scale
    Position
    I now want to apply these exact settings to hundreds of still images at a time that make up one scene in the project (but not all still images in the entire project).. Is there a way to paste or easily transfer them?
    Also, there are scenes I'm working on in which I want to change the image duration of hundreds of photos at once, but not change to duration of all images in the project, is this possible?
    I've looked at several different web-links, but none of them have what I'm looking for. If you can please help me, I'd be willing to send you $10 through paypal. Knowledge is power; the solution to these problems would save me hours of time. If you don't fully understand my questions I can send you a pictures or a video, pointing out my needs.

    Stan,
    Thanks again for your input.
    When the project is created, I don't recall seeing the preference settings until after the project opens the first time.  In that case if certain media was imported into the project panel but not in the sequence, after the duration was changed, it would be necessary to remove the media from the project panel then re-import again.  If there is a workaround to this please let me know.  It also doesn't appear that creating a new sequence would prevent the re-importing.  Could you confirm?
    Thanks for the link on automating to sequence--I remember that from CS4.
    The application of identical effects to media on the timeline in a sequence was something I had learned back in CS3 or maybe earlier CS4 where the effected, in this case a transition between images was applied then copied then using the paste or (Control V) command, applied to all other stills.  That worked fine but with lots of images, it ends up being a lot of "point and clicks" since the CTI must be moved to each transition insertion point before the paste is applied. 
    I actually thought that I had seen someone select the remainder of the images in the sequence then apply the paste command but I was never able to make that work.  Have you heard of such a short-cut?
    Much thanks again!!

  • I need help with closing a running program. It seems like it does not count as a program. Tried to turn of the computer and closing all programs. Please help!?

    I have a problem with a grey text box. It writes and says all i do. For example: When i now write it says all the letters one for one. If i open a new rogram it says so. If i click on something it gives me information about it. I can click the box and drag it, but dont close it. I have restarted the computer and closing all windows and programs. It just popped out when i was pressing some buttons on the mac. I think it is a easy way to fix it, but i cant find out what it is named and search for it. I think it is made for help and i did not download anything to get it. If i change user on the mac it does go away when I am on the other user, but i really want to keep the one i have because off all the settings and programs i have.
    Please reply if you know anything about this.
    This is a printscreen of the box, the language is Norwegian if someone wonder...
    It is really annoying, I hope someone can help me out.

    Oh thanks alot! Really happy that people take the time to answer my `noob`questions! Would not find that out by my own.
    Thanks!

  • Need help working with frames. Nothing opens in target frame...always new window :(

    Guess I should reach out and ask for help before I get so frustrated, as my name implies.
    I am new to frames. I have my frameset page done. I have a top section from my logo. I have
    a side section for my navigation and a main section (body) that is my target for the navigation links.
    It all looks great on the main frameset page. But whenever I click on a link on the side of the page,
    that should be a navigational link that feeds into my main section (body) area it always opens a
    new page. I can't ever get those pages to show up in that 'body' frame.
    I have tried using the <base target>
    I have tried doing each line individually, leaving the <base target> in and taking it out.
    I have tried writing the code myself.
    I have tired using the GoLive Action thing and doing a link and using ForceFrame.
    I have tried everything I can think of and wonder if anyone has any ideas.
    This is what I have, using the forceframe:
    <head>
      <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
      <meta name="generator" content="Adobe GoLive 6">
      <title>Welcome to Adobe GoLive 6</title>
      <csactions>
       <csaction name="5F8BE850" class="FrameMaker" type="onevent" val0="clearance1.html" val1="Body" urlparams="1"></csaction>
       <csaction name="609B1923" class="FrameMaker" type="onevent" val0="clearance1.html" val1="Body" urlparams="1"></csaction>
       <csaction name="606FEA72" class="FrameMaker" type="onevent" val0="clearance1.html" val1="Body" urlparams="1"></csaction>
       <csaction name="71581815" class="FrameMaker" type="onevent" val0="clearance1.html" val1="Body" urlparams="1"></csaction>
       <csaction name="716388D6" class="FrameMaker" type="onevent" val0="clearance1.html" val1="Body" urlparams="1"></csaction>
      </csactions>
      <csscriptdict import>
       <script type="text/javascript" src="GeneratedItems/CSScriptLib.js"></script>
      </csscriptdict>
      <csactiondict>
       <script type="text/javascript"><!--
    CSAct[/*CMP*/ '5F8BE850'] = new Array(frameP,/*URL*/ 'clearance1.html','Body');
    CSAct[/*CMP*/ '609B1923'] = new Array(frameP,/*URL*/ 'clearance1.html','Body');
    CSAct[/*CMP*/ '606FEA72'] = new Array(frameP,/*URL*/ 'clearance1.html','Body');
    CSAct[/*CMP*/ '71581815'] = new Array(frameP,/*URL*/ 'clearance1.html','Body');
    CSAct[/*CMP*/ '716388D6'] = new Array(frameP,/*URL*/ 'clearance1.html','Body');
    // --></script>
      </csactiondict>
    </head>
    <body background="Images/bgd.gif" bgproperties="fixed" link="#7b00ff" vlink="#7b00ff" alink="#7b00ff">
                          <table width="232" border="2" cellspacing="2" cellpadding="0">
       <td width="200" height="24">
        <div align="left">
         <b><a title="accessories-f.html" onclick="CSAction(new Array(/*CMP*/'609B1923'));return CSClickReturn();" href="accessories-f.html" target="Body" csclick="609B1923">Accessories</a></div>
       </td>
       <td width="5" height="24">  4  </td>
       </tr>
       <tr><td width="200" height="24">
        <div align="left">
         <b><a title="audio-consoles.html" onclick="CSAction(new Array(/*CMP*/'5F8BE850'));return CSClickReturn();" href="audio-consoles.html" target="Body" csclick="5F8BE850">Audio Consoles</a></div>
       </td>
        <td width="5" height="24">  3  </td>
       </tr>
       <tr><td width="200" height="24">
        <div align="left">
         <b><a title="cases.html" onclick="CSAction(new Array(/*CMP*/'606FEA72'));return CSClickReturn();" href="cases.html" target="Body" csclick="606FEA72">Cases</a></div>
       </td>
        <td width="5" height="24">  2  </td>
       </tr>
    This is what I have for the framset page that is called clearance1.html  :
    </head>
    <frameset border="0" frameborder="no" framespacing="0" rows="201,*">
      <frame name="ClearanceT" noresize src="clearance-top.html">
      <frameset border="0" cols="275,*" frameborder="no" framespacing="0">
       <frame name="ClearanceS" noresize scrolling="no" src="clearance-side.html">
       <frame name="Body" noresize src="clearance-main.html">
      <noframes><body><center>This website uses frames. Your current browser does not display frames <br>or frame viewing has been turned off.
      To view these pages please <a href="clearance.html">Click here</a></center>
                  </body>
      </noframes>
    </frameset>
    If someone could please help I would be so appreciative!!!!! Thanks!

    Hi,
    I appreciate the help but I tried that and it still doesn't work. I had done what you said already, other than changing the name of the frame, so this time I tried that. Still didn't work.
    Here is my current code....I changed the frame to "Baby" and only tried the one item, Accessories:
      <csactions>
       <csaction name="5F8BE850" class="FrameMaker" type="onevent" val0="audio-consoles.html" val1="Body" urlparams="1"></csaction>
       <csaction name="609B1923" class="FrameMaker" type="onevent" val0="accessories-f.html" val1="Baby" urlparams="1"></csaction>
       <csaction name="606FEA72" class="FrameMaker" type="onevent" val0="cases.html" val1="Body" urlparams="1"></csaction>
       <csaction name="71581815" class="FrameMaker" type="onevent" val0="/clearance1.html" val1="Body" urlparams="1"></csaction>
       <csaction name="716388D6" class="FrameMaker" type="onevent" val0="clearance1.html" val1="Body" urlparams="1"></csaction>
      </csactions>
      <csscriptdict import>
       <script type="text/javascript" src="GeneratedItems/CSScriptLib.js"></script>
      </csscriptdict>
      <csactiondict>
       <script type="text/javascript"><!--
    CSAct[/*CMP*/ '5F8BE850'] = new Array(frameP,/*URL*/ 'audio-consoles.html','Body');
    CSAct[/*CMP*/ '609B1923'] = new Array(frameP,/*URL*/ 'accessories-f.html','Baby');
    CSAct[/*CMP*/ '606FEA72'] = new Array(frameP,/*URL*/ 'cases.html','Body');
    CSAct[/*CMP*/ '71581815'] = new Array(frameP,/*URL*/ '/clearance1.html','Body');
    CSAct[/*CMP*/ '716388D6'] = new Array(frameP,/*URL*/ 'clearance1.html','Body');
    // --></script>
      </csactiondict>
    </head>
    <body background="Images/bgd.gif" bgproperties="fixed" link="#7b00ff" vlink="#7b00ff" alink="#7b00ff">
                          <table width="232" border="2" cellspacing="2" cellpadding="0">
       <td width="200" height="24">
        <div align="left">
         <b><a title="accessories-f.html" onclick="CSAction(new Array(/*CMP*/'609B1923'));return CSClickReturn();" href="accessories-f.html" target="Baby" csclick="609B1923">Accessories</a></div>
       </td>
       <td width="5" height="24">  4  </td>
       </tr>
       <tr><td width="200" height="24">
        <div align="left">
         <b><a title="audio-consoles.html" onclick="CSAction(new Array(/*CMP*/'5F8BE850'));return CSClickReturn();" href="audio-consoles.html" target="Body" csclick="5F8BE850">Audio Consoles</a></div>
       </td>
        <td width="5" height="24">  3  </td>
       </tr>
       <tr><td width="200" height="24">
        <div align="left">
         <b><a title="cases.html" onclick="CSAction(new Array(/*CMP*/'606FEA72'));return CSClickReturn();" href="cases.html" target="Body" csclick="606FEA72">Cases</a></div>
       </td>
        <td width="5" height="24">  2  </td>
       </tr>
    It appears that I should be able to just use the 'target' tag to get this to work right. It didn't. So I tried the action menu item with the ForceFrame
    and that didn't work either. I don't get why something that looks so simple doesn't work

  • Need help with photo frame

    Below is a quick frame I made to re-use on my photos, which I overlayed onto an image.  I set the Blending Mode to Screen for the Frame Layer.
    The problem I am having is that when I try to reverse the colors on the frame, so that the border is Black, I get a pile of garbage.  The only part of the image that is visible is the area that should be hidden by the border, and the center of the image is white.  If I make the frame within the context of the image, it works, but not if I make it from scratch.
    What am I doing wrong?

    If you followed the steps, just fill Layer 1 with black or any color that you want the frame.
    Edit>Fill

  • I need help on my frames per second

    i got this new imac g5 intel and i play Unreal Tournament 2004 online and it only gets 16 Frames per second, but i also have another imac G5 without intel and it gets 70 frames per second. My new one has 256 graphics and my old one has 128mb. If you have any information plz help

    Hello EvilOne and Welcome to Apple Discussions. 
    Just to add to the excellent advice you've already rxed and clarify the reason behind it:
    Your iMacs either have a PowerPC G5 processor or an Intel Core Duo / Core 2 Duo.
    UT2004 was written for the PowerPC family of processors (i.e. your old G5 iMac) and although Apple has built-in emulation (using Rosetta) into the new Intel iMacs; it's not as fast as using software designed natively for Intel processors.
    You should look out for "Universal" versions of all the software you use for the best performance on the new Intel iMac.
    You can find updates for your software at MacUpdate.
    Merry Christmas
    mrtotes

  • Help! Senior citizen needs help in closing out a program?

    I am woefully ignorant about some things on my computer.  Trying to look at photos from a disc.  Ran it through virus program and it is clean.
      Clicked on first photo which opened yesterday..but today it is not opening.  All I am seeing is that little revolving disc in colors.  Cannot close
    program or eject disc or anything.  What should I do?  Shut down and restart?  Is there any other way to shut that particular program only?
    Thanks!

    to force close a non responsive program,Press Command-Option-Esc, then select the unresponsive app from the Force Quit window that appears, and click Force Quit
    http://support.apple.com/kb/ht3411

  • 30p with a Canon XA10 - need help with Final Cut 7 "FIELD DOMINANCE" setting and an explanation of "drop frames". Thank you!!

    I shot footage using a Canon XA10 and there are issues with the HD quality not looking as crisp as it should.  I am trying to make sure the settings in Final Cut are right.  Need help confirming what should be in "Field Dominance" --- have seen discussions about making sure it's set to "none" but I'm confused as to what to do. 
    Also someone suggested I use "drop frames" to change from 30p to 24p within Final Cut.  He couldn't explain how to do it so any input appreciated as well as any thoughts on whether this is a good option to try.

    If you're shooting 30p, field dominance should be set to none.   Since you need to use log and transfer to bring this material in to fcp, I would assume it would be set correctly automatically.  Are you sure you've set the camera properly?
    Drop frames will not change 30 p to 24p.   Dropframe timecode simply refers to the number assigned to each frame which drops an occasional number (not any frames) so the timecode duration is the actual duration, since 30p videoi is actually 29.97 frames per second which each frame assigned a timecode number. 
    This is very basic video stuff and requires some basic knowledge of video.  Wikipedia is a pretty good resource for much of this stuff plus there are lots of great resources on the web.  Look up interlaced and progressive video, 24p and 30p. 
    And as far as judging quality, you can only get an accurate view of the quality in fcp when you have a video card attached to a video monitor.  The viewer and canvas are only an approximation of what the quality is.  Minimally, set the canvas or viewer to 100% to get a better approximation of the quality. 

  • FB app closing by itself, I need help

    So its been about 3 weeks since I updated my FB app on my Iphone4, and for some reason it keeps closing by itself, I am getting annoyed by the fact that every time I want to use the app it just closes. I already tried deleting the app, downloading it again, and I do not what else to do. Please I need help!!

    Can I do this "fix" myself, or at least buy the part somewhere so that someone else who is good with computers can do it for me?
    This is the solution other people with this problem had. 
    Computer repair sent one user this message "Tested without touch panel, hdd, ram, keyboard light. Ordered new motherboard, however discovered that the computer started fine without touchpanel, seems like on/off switch is oversensitive.
    Power membrane switch is replaced, and everything is checked and OK."
    So- power membrane was to blame, and I guess this is just the "underneath" section of the panel of the external power, volume buttons at the top of my key board right?
    "Yes my issue was resolved. They replaced the power button strip above the keyboard which has eliminated the random shutdowns. Funny thing is that they had it less than 24 hours and seems like the "failure analysis engineer" immediately knew what the problem was. I feel sorry for the uneducated who fork over money for unneeded repairs."
    So, since Toshiba seems to try to make you pay 400 dollars to replace a motherboard etc. which won't fix the true problem, is there a site where I can buy the power membrane for my laptop, then take the computer and a part to a repair shop and they will do it?

  • Need Help Determining Least Common Demoninator for Frame Rate, Codec, and Workflow

    I need help determining the best timeline setting and Compressor workflow to integrate footage with varying frame rates and codecs that I'm currently upres'ing for a multi-camera concert performance destined for HD broadcast output. I'm assuming the network needs 29.97.
    Thus far, I've been working with Apple ProRes Proxy files to create lo-res edits. Now, I've started the task of offlining and ingesting new, HD clips from the proxy references. The content originates from either Panasonic HVX200 or Panasonic GH1 cameras.
    Looking at the material, it appears the cameras were not shooting with the same settings and, somehow, a PAL GH1 got into the mix. Some of the performances have the PAL GH1 and other do not.
    Here's the breakdown of the varying sources. I got this info from the Log & Transfer columns.
    HVX Cameras
    Format: 1080p24
    Source Format: DVCPRO HD 1080i60
    Shooting Rate: 24
    Vid Rate: 29.97
    TC Format: Non-Drop
    GH1 NTSC
    Format: 1080i60
    Source Format: AVCHD 1080i60
    Shooting Rate: 30
    Video Rate: 29.97
    TC Format: Drop
    GH1 PAL
    Format: 1080i50
    Source Format: AVCHD 1080i50
    Shooting Rate: 25
    Video Rate: 25
    TC Format: Non-Drop
    ANOTHER GH1 NTSC
    Format: 1080p24
    Source Format: AVCHD 1080p24
    Shooting Rate: 24
    Video Rate: 23.98
    TC Format: Non-Drop

    Call the TV station/network and get their spec sheet first. You need to know more than frame rate.
    Once you have that, you can work backwards to arrive at a workflow.
    As a general priniciple, you'll get a more seamless translation of format when you add frames rather than removing them. (eg 24p to 27.97 rather than 29.97 to 24p)
    At least all the material starts out in the 1080 world.
    Do all your conversions before you start editing. (I'd use ProRes or ProRes LT for the editing codec).
    Budget a bunch of time to sync the material or figure out a quick cutting style that minimizes sync drift.
    What a nightmare.
    x

  • HT5312 Guys, I have forgotten my security question answers, and the rescue email I placed in with my apple id has been closed down as well (it was a university id, when I graduated, the email service expired). I need help changing my password.

    Guys, I have forgotten my security question answers, and the rescue email I placed in with my apple id has been closed down as well (it was a university id, when I graduated, the email service expired). I need help changing my password.

    The Three Best Alternatives for Security Questions and Rescue Mail
        1. Use Apple's Express Lane.
              Go to https://expresslane.apple.com ; click 'See all products and services' at the
              bottom of the page. In the next page click 'More Products and Services, then
              'Apple ID'. In the next page select 'Other Apple ID Topics' then 'Forgotten Apple
              ID security questions' and click 'Continue'.
         2.  Call Apple Support in your country: Customer Service: Contact Apple support.
         3.  Rescue email address and how to reset Apple ID security questions.
    A substitute for using the security questions is to use 2-step verification:
    Two-step verification FAQ Get answers to frequently asked questions about two-step verification for Apple ID.

  • Beginner: Need Help : Label Frame

    Beginner: Need Help : Label Frame
    Hi everyone, 
    I am trying to find a way to get my menu bar working. Little info, I am a beginner in Flash just learned the essential DVD from Adobe.
    My menu bar has the following:
    (About Us) (Services) (Quality) (Projects) (Contact Us)
    Each page will have a motion shape tween and slide the page down.
    I have type in this actions :
    stop();
    import flash.events.MouseEvent;
    //---aboutus Button Timeline change---\\
    aboutus_btn.addEventListener(MouseEvent.CLICK, aboutusClick);
    function aboutusClick(event:MouseEvent):void{
    gotoAndPlay("aboutus");
    //---services Button Timeline change---\\
    services_btn.addEventListener(MouseEvent.CLICK, servicesClick);
    function servicesClick(event:MouseEvent):void{
    gotoAndPlay("services");
    //---quality Button Timeline change---\\
    quality_btn.addEventListener(MouseEvent.CLICK, qualityClick);
    function qualityClick(event:MouseEvent):void{
    gotoAndPlay("quality");
    //---projects Button Timeline change---\\
    projects_btn.addEventListener(MouseEvent.CLICK, projectsClick);
    function projectsClick(event:MouseEvent):void{
    gotoAndPlay("projects");
    //---contactus Button Timeline change---\\
    contactus_btn.addEventListener(MouseEvent.CLICK, contactusClick);
    function contactusClick(event:MouseEvent):void{
    gotoAndPlay("contactus");
    This actions only works when I click to the next labels but doesn't work when I want to click back to the previous labels. For example, if I click onto (About Us) to (Services) and (Services) to (Quality) and (Quality) to Projects and (Projects) to (Contact Us)... it all works. If I then click from (Contact Us) back to (Projects) or even any previous buttons... it does NOT work??
    Anyone? Please help!

    This is my timeline structure. The code for the action frame is in hi-lite in yellow.
    Is this clear enough?
    I also tried rewriting the action like below, but still have the same problem.
    stop();
    aboutus_btn.addEventListener(MouseEvent.CLICK, onaboutusClick, false, 0, true);
    services_btn.addEventListener(MouseEvent.CLICK, onservicesClick, false, 0, true);
    quality_btn.addEventListener(MouseEvent.CLICK, onqualityClick, false, 0, true);
    projects_btn.addEventListener(MouseEvent.CLICK, onprojectsClick, false, 0, true);
    contactus_btn.addEventListener(MouseEvent.CLICK, oncontactusClick, false, 0, true);
    function onaboutusClick(evt:MouseEvent):void {
    gotoAndPlay("aboutus");
    function onservicesClick(evt:MouseEvent):void {
    gotoAndPlay("services");
    function onqualityClick(evt:MouseEvent):void {
    gotoAndPlay("quality");
    function onprojectsClick(evt:MouseEvent):void {
    gotoAndPlay("projects");
    function oncontactusClick(evt:MouseEvent):void {
    gotoAndPlay("contactus");

  • Need help on returning input

    Hi. I'm making a DateTimePicker (DTP), and I need help on getting a method to return a Date only when the DTP is closed, and I want this to be done in the DTP class itself.
    For now, I've used an infinite loop and it seems to work fine without lagging the computer (my computer is above average), but I'm not sure if there's another more efficient way.
    I would prefer not to use threads, but if that's the only option then I suppose it's unavoidable.
    I'm using:
    while(true){
        switch(returnState){
        case UNINITIALIZED: continue;
        case SET: return cal.getTime();
        case CANCELED:
            default:
            return null;
    }Screenshots:
    http://i34.tinypic.com/53rb7n.png
    http://i33.tinypic.com/2nsxct4.png
    Azriel~

    You could put any component in a JOptionPane or a JDialog and then easily query the component for results once it has returned.
    For example:
    QueryComponent.java creates a component that can be placed in a JOptionPane and then queried.
    import java.awt.GridLayout;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JComponent;
    import javax.swing.JTextField;
    * A simple component that has two JTextFields and two
    * corresponding "getter" methods to extract information
    * out of the JTextFields.
    * @author Pete
    public class QueryComponent
      private JPanel mainPanel = new JPanel();
      private JTextField firstNameField = new JTextField(8);
      private JTextField lastNameField = new JTextField(8);
      public QueryComponent()
        mainPanel.setLayout(new GridLayout(2, 2, 5, 5));
        mainPanel.add(new JLabel("First Name: "));
        mainPanel.add(firstNameField);
        mainPanel.add(new JLabel("Last Name: "));
        mainPanel.add(lastNameField);
      public String getFirstName()
        return firstNameField.getText();
      public String getLastName()
        return lastNameField.getText();
      // get the mainPanel to place into a JOptionPane
      public JComponent getComponent()
        return mainPanel;
    }QueryComponentTest.java places the component above into a JOptionPane, shows the pane, and then queries the QueryComponent object for the results.
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JComponent;
    public class QueryComponentTest
      private JPanel mainPanel = new JPanel();
      public QueryComponentTest()
        JButton getNamesBtn = new JButton("Get Names");
        getNamesBtn.addActionListener(new ActionListener()
          public void actionPerformed(ActionEvent e)
            getNamesAction();
        mainPanel.add(getNamesBtn);
      // occurs when button is pressed
      private void getNamesAction()
        // create object to place into JOptionPane
        QueryComponent queryComp = new QueryComponent();
        // show JOptionPane
        int result = JOptionPane.showConfirmDialog(mainPanel,
            queryComp.getComponent(), // place the component into the JOptionPane
            "Get Names",
            JOptionPane.INFORMATION_MESSAGE);
        if (result == JOptionPane.OK_OPTION) // if ok selected
          // query the queryComp for its contents by calling its getters
          System.out.println("First Name: " + queryComp.getFirstName());
          System.out.println("Last Name:  " + queryComp.getLastName());
      public JComponent getComponent()
        return mainPanel;
      private static void createAndShowUI()
        JFrame frame = new JFrame("QueryComponentTest");
        frame.getContentPane().add(new QueryComponentTest().getComponent());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args)
        java.awt.EventQueue.invokeLater(new Runnable()
          public void run()
            createAndShowUI();
    }Edited by: Encephalopathic on Sep 29, 2008 8:16 PM

  • Warning "RAM Preview needs 2 or more frames" after scrubbing audio in After Effects CC 2014 (13.0)

    The After Effects team are investigating a bug in After Effects CC 2104 (13.0) where a memory leak occurs while scrubbing audio (holding down the CTRL or Command key while scrubbing). This memory leak can eventually consume all free RAM, which can lead to the warning message "After Effects error: RAM Preview needs 2 or more frames to playback" when you try to initiate a RAM preview.
    While we investigate this problem, you can avoid the bug and memory leak by not scrubbing with audio. When the problem occurs you can resolve it by closing and restarting After Effects.
    http://blogs.adobe.com/aftereffects/2014/07/warning-ram-preview-needs-2-or-more-frames-aft er-scrubbing-audio-in-after-effects-cc-2014-13-0.html

    Hi all, just wanted to say, I am currently working on an award show for TV and have been scrubbing audio in AE CC 2014 13.0.2.3 without issue. Why am I not having the memory leak problem?
    Would like to help if I can.
    Hardware Overview:
      Model Name: Mac Pro
      Model Identifier: MacPro6,1
      Processor Name: 12-Core Intel Xeon E5
      Processor Speed: 2.7 GHz
      Number of Processors: 1
      Total Number of Cores: 12
      L2 Cache (per Core): 256 KB
      L3 Cache: 30 MB
      Memory: 64 GB
      Boot ROM Version: MP61.0116.B05
      SMC Version (system): 2.20f18
      Illumination Version: 1.4a6
    System Software Overview:
      System Version: OS X 10.9.4 (13E28)
      Kernel Version: Darwin 13.3.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name:
      User Name:
      Secure Virtual Memory: Enabled
      Time since boot: 1 day7:24

Maybe you are looking for