Open only one frame

Hi, I want to open a frame when I run an application. The problem is that that frame is opened always that I run the application, so you can have several opened frames.
How can I make to open only one frame, and that no frame is opened until I close the first one?
thanks

This is with useing a button
first class
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class ball extends JFrame implements ActionListener{
  ballball bebe = new ballball();
  public ball() {
  super("My button");
  setSize(400,400);
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  Container pane = getContentPane();
  FlowLayout flow = new FlowLayout();
  pane.setLayout(flow);
   pane.add(bebe.button);
  bebe.button.addActionListener(this);
  setContentPane(pane);
  setVisible(true);
  public void actionPerformed(ActionEvent me){
   Object ob = me.getSource();
   if(ob == bebe.button) {
     bebe.Myothergui();
     bebe.button.setEnabled(false);
public static void main(String[] args) {
     ball ba = new ball();
Second class
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class ballball {
   JFrame frame;
   JButton button = new JButton("my butto");
public void Myothergui() {
   frame = new JFrame();
  frame.setSize(300,300);
  frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                 button.setEnabled(true);
                frame.setVisible(false);
   frame.setVisible(true);
GOOD LUCK and learn to use the http://java.sun.com/j2se/1.4/docs/api/ most of your ? can be answered there.Anyways have a good one and STUDY STUDY STUDY

Similar Messages

  • I have just downloaded Elements 11 & there is only one frame (basic) in collage, how do I get more?

    I have just upgraded from Elements 7 to Elements 11 but find in the photo Collage there is only one frame, how do I get more, my old 7 had a good variety???

    Hi Wobygong5,
    I am afraid PSE11 has just one theme, ie. Basic.
    However you can go to Expert mode, and then create a new image of the size you want, and then insert frames from the Graphics panel. You can insert as many frames as you want.
    But Photo Collage will offer you just one theme.
    -Rahul.

  • Help--How can I open only one java program at one time?

    How can I open only one java program(same program) in Windows at one time?

    In Java 1.5, you can use the JVM's own monitoring APIs to examine what other JVMs are running on the system, and what applications they're running.
    It's general and powerful, but complex. The socket/file/whatever approach is cleaner, and probably more suited to your usage.
    Don't bother trying to use the Windows task manager for this sort of thing. You have to write messy native code, and it isn't reliable after all that anyway.

  • I want to open only one JInternalFrame

    How do I control the MainGUI (JDeskTopPane) to open only ONE listenInputWindow (JInternalFrame)? There is my wrony code, but I do not know how to correct. I can open another listenInputWindow even one is already on Desktop.
    public class MainGUI extends javax.swing.JFrame {
    InputMenuFrame listenInputWindow;
    /** Creates new form MainGUI */
    public MainGUI() {
    initComponents(); //Method to create the MainGUI
    private void inputMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
    if (listenInputWindow == null) { //suppose this line to control the opening
    InputMenuFrame listenInputWindow = new InputMenuFrame();
    listenInputWindow.setLocation(600, 0);
    listenInputWindow.setVisible(true);
    desktopPane.add(listenInputWindow);
    }

    Great :)
    Please try to be more specific - generally you do not want to have your GUI driven by embedded code.
    Consider structuring your app to use the GUI to trigger events in Observerable objects.... this does a number of things, prevents write/paint lockups, permits changing the GUI without affecting the underlying code and vice versa....
    If you could provide more detail as to what you need perhaps I could offer a couple of hints...

  • How to close only one frame

    Hi!
    How do i close only one frame?
    I know this close everything:
    private void exitActionPerformed(java.awt.event.ActionEvent evt) {                                       
    Component panel = null;
    System.exit(0);
    But i tried this: but dos'nt work ....
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new configuration().setVisible(false);
    }

    r035198x wrote:
    Enojado wrote:
    Sorry, i tried this:
    private void confexitActionPerformed(java.awt.event.ActionEvent evt) {
    new NewJFrame().setVisible(false);
    }Which frame are you hiding here? You are creating a new one and hiding it before it has a chance to say or show anything. That's incredibly rude.
    P.S setVisible(false) just hides. dispose() throws the frame and its components into the trash bin.Yep, that was the answer. :] thanks

  • Suddenly I can open only one Firefox window at a time. I can have multiple tabs in that window, but I can suddenly no longer open another window. What happened?

    Suddenly I can open only one Firefox window at a time. I can have multiple tabs in that window, but I can suddenly no longer open another window. What happened?

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How to open only one clip at a time in the source monitor?

    Ok the answer to this question may be simple.. hopefully...
    At the moment each time I open a clip in the source monitor it adds it to the dropdown list.
    Fine... but I am opening and closing hundreds of clips in a day and after a while I noticed it seemed to be slowing down the whole PPCS5.5 system.
    It appears that PP seems to be keeping each clip I open... active.
    Is there a way to allow only one clip to be open at a time in the source monitor... other than having to close them all first??? (would be ideal if there was some kind of shortcut like shift-doubleclick)

    SonyZ7's can record to compact flash cards as well as tape, so I generally log and transfer from the cards.
    So I guess I should do a bit more research on workflow's in Pr
    No probs, here's a bunch of MediaInfo...
    General
    Complete name                            : /Volumes/Rugged 1TB/Business/WAPLES 10.October/Check It 2011 Event/Check It 2011 event footage/001 CheckIt2011.mov
    Format                                   : MPEG-4
    Format profile                           : QuickTime
    Codec ID                                 : qt 
    File size                                : 195 MiB
    Duration                                 : 1mn 0s
    Overall bit rate                         : 26.9 Mbps
    Encoded date                             : UTC 2011-09-08 21:37:37
    Tagged date                              : UTC 2011-10-28 11:50:04
    Writing library                          : Apple QuickTime
    Original source medium                   : Check It event CF2
    ©TSC                                     : 2500
    ©TSZ                                     : 100
    Video
    ID                                       : 1
    Format                                   : DV
    Codec ID                                 : hdv3
    Duration                                 : 1mn 0s
    Bit rate                                 : 25.0 Mbps
    Width                                    : 1 416 pixels
    Original width                           : 1 440 pixels
    Height                                   : 1 062 pixels
    Original height                          : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 25.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:2
    Scan type                                : Interlaced
    Scan order                               : Top Field First
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 0.665
    Stream size                              : 181 MiB (93%)
    Language                                 : English
    Encoded date                             : UTC 2011-09-08 21:37:37
    Tagged date                              : UTC 2011-09-08 21:37:37
    Material_Duration                        : 61560
    Material_StreamSize                      : 192330610
    Material_FrameCount                      : 1539
    Audio #1
    ID                                       : 2
    Format                                   : PCM
    Format settings, Endianness              : Little
    Format settings, Sign                    : Signed
    Codec ID                                 : sowt
    Duration                                 : 1mn 0s
    Bit rate mode                            : Constant
    Bit rate                                 : 768 Kbps
    Channel(s)                               : 1 channel
    Channel positions                        : Front: L
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 16 bits
    Stream size                              : 5.57 MiB (3%)
    Language                                 : English
    Encoded date                             : UTC 2011-09-08 21:37:37
    Tagged date                              : UTC 2011-09-08 21:37:37
    Material_Duration                        : 61560
    Material_StreamSize                      : 5909760
    Audio #2
    ID                                       : 3
    Format                                   : PCM
    Format settings, Endianness              : Little
    Format settings, Sign                    : Signed
    Codec ID                                 : sowt
    Duration                                 : 1mn 0s
    Bit rate mode                            : Constant
    Bit rate                                 : 768 Kbps
    Channel(s)                               : 1 channel
    Channel positions                        : Front: R
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 16 bits
    Stream size                              : 5.57 MiB (3%)
    Language                                 : English
    Encoded date                             : UTC 2011-09-08 21:37:37
    Tagged date                              : UTC 2011-09-08 21:37:37
    Material_Duration                        : 61560
    Material_StreamSize                      : 5909760
    Menu
    ID                                       : 4
    Language                                 : English
    Encoded date                             : UTC 2011-09-08 21:37:37
    Tagged date                              : UTC 2011-09-08 21:37:37

  • Browser will open once and open only one page. It closes but then won't open again. How do i fix it?

    In the last 24 hours my browser will open only once and go to only one site i choose. after that , i can go to another site but links won't open or anything else. After i close the browser , so i can restart it, it tells me firefox is already open. Problem is it never shuts down in the background. I have to use the task manager to shut it off so i can open it again. Funny thing is that internet explorer, works fine but i don't want to use it. I even tried reinstalling firefox but it did not work. I had to post this on a different computer as well.

    https://support.mozilla.com/en-US/kb/Firefox%20hangs#w_hang-at-exit

  • When I click on the icon to open Firefox I get an error message " A copy of Firefox is already open, only one copy of Firefox can be open at a time".

    I have tried to download and run Firefox on my MAC OS 10.6.7 several times and have run into this error message every time:
    "A copy of Firefox is already open. Only one copy of Firefox can be open at a time". A search through the computer does not fine another copy of Firefox and there is no window open or evidence of the program open.
    When I got this computer a year ago I copied the hard drive from the old computer onto the new and the old computer had a copy of Firefox on it and the program worked on that computer. It would not run on the new computer so I thought maybe it was due to the Intel chip so I deleted the program and downloaded the newest version at the time. This is when I started getting the error message and subsequent attempts have yielded the same results.
    Can you be of help?

    See:
    * https://support.mozilla.com/kb/Firefox+is+already+running+but+is+not+responding

  • Error on Mac- A copy of firefox is already open. only one copy of firefox can be open at a time.

    error message on mac - a copy of firefox is already open. Only one copy of firefox can be open at a time.

    This worked, I used the method described in this link http://forums.mozillazine.org/viewtopic.php?t=365156, and opened the Mozilla profile screen with the terminal on my mac, using the language given in the links. Then I duplicated my original profile to save the bookmarks, etc. Put them in a folder listed Duplicate profile with the date. With the open profile screen, I deleted my original profile, created new profile folder and then a new profile. Note that profile cannot be created in the system library, it must be created on the disc, because the library will not allow writing into it. After I created my new profile folder, I dragged all my old information into it, and it worked. Firefox closed and the error disappeared. You must be VERY careful to make sure Firefox is closed anytime you are doing anything with the profile folders. I think that is what caused my original problem.

  • How to open only one web page at a time?

    I used to have it set so when I opened a new web page, the previous one closed. Now, nothing closes automatically and I have about 50 pages open that I have to close. How do I set it so that only one page opens at a time?

    HI Janice,
    You can use a keyboard shortcut to close all windows in Safari. CommandShiftW.
    To close one window, Command + W.
    Carolyn

  • Ae cs5 importing seq images all blacked out or only one frame - help

    I created a pan background and keyframed it and it is working fine. I then brought in pngs with transparent background as a seq and the image is all black when they imported into ae cs5 once one image was brought in correctly (the first image of the seq). I have batch converted to psds with same results. What am I doing worng importing in seq to work over the pan background?
    And I have tried PSD image sequence file - it only brings in one frame.
    Message was edited by: l1o1t1r1

    I just did some tests. If you export the png's using the save for web and other devices and png 24 then things work fine with grayscale images. If you save grayscale images as png's directly then the png's are aparently saved as png 8's so they won't work properly in After Effects. Any pixel not completely white is rendered black.
    To be honest I've never run into this before. It may be worthy of a bug report.
    I'm not sure what technique you're using to remove the background from the originals but a jpg made from the original png file can be used as an Luma Inverted matte on a black solid to create the transparency. A little adjustment to the jpg sequence with levels will clean up most of the garbage. This would give you an acceptable result without resorting to a bunch of processing to try and create transparent pngs.

  • Function do work in only one frame

    this function showing in all frame on stage....i want to it within a perticular frame
    function callThumbs() {
        _root.createEmptyMovieClip("sliderBox",_root.getNextHighestDepth());
        sliderBox._x = _root.gallery_x=30;
        sliderBox._y = _root.gallery_y=30;
    sliderBox.addEventListener(MouseEvent.CLICK);
        var clipLoader = new MovieClipLoader();
        var preloader = new Object();
        clipLoader.addListener(preloader);
        for (i=0; i<myImagesTotal; i++) {
            thumbURL = myImages[i].attributes.thumb_url;
            myThumb_mc = sliderBox.createEmptyMovieClip(i, sliderBox.getNextHighestDepth());
            myThumb_mc._x = _root.thumb_height*i;
            clipLoader.loadClip("thumbs/"+thumbURL,myThumb_mc);
            preloader.onLoadStart = function(target) {
                target.createTextField("my_txt",target.getNextHighestDepth(),0,0,1,1);
                target.my_txt.selectable = false;
            preloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
                target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
            preloader.onLoadComplete = function(target) {
                new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
                target.my_txt.removeTextField();
                target.onRelease = function() {
                    callFullImage(this._name);
                target.onRollOver = function() {
                    this._alpha = 100;
                target.onRollOut = function() {
                    this._alpha = 100;

    In what way do you mean the function is in all frames?  If you write the function on a layer of its own and only provide one frame for it, it will only exist in that one frame.
    If you mean that what the function creates lives throughout the timeline, then that is because you are creating content dynamically without securing it to an object that has a home in the timeline.  Dynamically created content does not have a home in  the timeline unless you make it a opart of something that has been manually affixed to the timeline, like a movieclip.
    So what you might try is to manually add an empty movieclip in the frame where this code is (on a separate layer) and assign it an instance name, let's say you name it "container".  Then you can change the following line from...
    _root.createEmptyMovieClip("sliderBox",_root.getNextHighestDepth());
    to
    container.createEmptyMovieClip("sliderBox",container.getNextHighestDepth());
    and that should end up retsricting the dynamically created movieclip to the frame where the container is.  If there is any other content being added to the _root, that too should be retargeted to the container.

  • Copy/Paste Clip between Sequences - Only one frame appears?

    Hi all. A strange thing has started happening in FCP 7...not always but frequently. When I have two sequences open, I go to the first sequence and copy a clip. I go to the second and paste the clip and it shows up as very thin (one frame). I can then drag the end of it to make it longer but why doesn't it just paste the same length that it was copied?
    Thanks for any help.
    ~shiva

    Do you have any In and Out points marked in the timeline? When you do the copy function what area is highlighted in the timeline or selected?

  • Acrobat will open only one pdf at a time.

    Hi. Can someone please clarify for me why Adobe Acrobat will open allow one pdf to be visible at a time. If addtional pdf's are opened they display as black. Means I cannot stitch multiple pdfs together.
    Am using Windows 7 Pro and Acrobat X Pro. Attached below is screen shot of 2 pdfs open at same time. The one behind is fine while the one in front appears black but if was opened on its own would open fine.
    Thanks

    That looks like a graphics driver bug - try turning off/on hardware acceleration under Acrobat's preferences, and ensure your drivers are up to date.
    Acrobat doesn't tend to play well with multiple-monitor setups, but it shouldn't do what you're seeing.

Maybe you are looking for

  • 2007B AR downpayment request (no invoice) acct setup for Payment Advance

    I compared 2007A and 2007B.  In 2007B there has AR downpayment REQUEST not invoice and the Admin>Setup>Financials>GL Account Determination>tab Sales there is no "Payment Advance" account field need to be setup like 2007A.   I found it from GL Acct De

  • Creation of Remote Cube on a view

    Hi, How do you create a remote cube on R/3 view? Thanks Suchitra

  • Attaching Target Groups in the Webshop admin in R3/CRM scenario

    Hi Gurus, I am trying to attach Target Group in the marketing tab in the webshop admin. We have R/3 and CRM in landscape. I have created a target group in CRM Backend. Now when i go to webshop admin and try to assign this target group in the Marketin

  • Userprefs don't depend on primary group?

    I have users (student1, student2, etc) setup in two groups each, (their grade: ie, "Grade3", and "Students")   For this problem, it doesn't matter what primary group I set for them.  They are asked upon logon, to choose "grade3" or "students" as thei

  • Several handles to the same database in a single thread

    I have a single-threaded program where several db handles are created with db_create() and they're all opened to the same database in the same file. The handles will be used serially, in quite random order for reads and writes, and each of them will