Opening existing jFrame on click

I have got two different jFrames in a project using netBeans. I want my SHOP.java to open when I click a button on my LOGIN.java. In the login i have a jFrame with two buttons. And the SHOP has a jFrame. Perhaps there is just a different way to do it all together but I am not a strong programmer and new to java. Basically we are designing a POS type app. And I want the login frame to show a button to "SHOP" and to "LOGIN" the shop is obviously for users and login for employees. Thank you in advance.

Not really sure but is setVisible what you want?

Similar Messages

  • Opening/Closing JFrames

    Hi all,
    I am a bit confused as to what is the best (most effecient) way to call a window from another window (or a JFrame from another JFrame).
    Let us assume that you have a JFrame with many buttons. One of these buttons opens another JFrame. However, the calling frame should hang until the second frame is closed or exited. What is the best way to implement this thing? Also, what is the best way to close this second window and releasing all memory associated with it.
    Currently, when the second Jframe is to be opened, i am doing the following:
    JFrame frame2 = new JFrame (this);
    this.setEnabled (false);I am constructing a new JFrame and passing the first frame as an argument. and then i am disabling the first window.
    Now in the second window, the windowClosing method looks like this:
    this.setVisible (false);
    frame1.setEnabled (true); //frame1 is the first frame that was passed as an argument
    this.dispose ();Please inform me if there exists a better way of doing this. Mainly, I want to know how can I make the first frame wait on the second frame (same when two threads are joined). How can I do this with frames?
    Thanks in advance.

    Use a modal JDialog.

  • I have photos on a cd which I'm trying to open .  If I click on them I can see the picture in the preview, but when I double click it doesn't recognise the picture.  They are all in .jpg format.  Tried copying them but it said some data cannot be read.

    I have photos on a cd which I'm trying to open .  If I click on them I can see the picture in the preview, but when I double click it doesn't recognise the picture.  They are all in .jpg format.  Tried copying them but it said some data cannot be read.  The files exist but I just can't seem to view them

    Select one and hit the Space bar to view it in QuickLook. Use the forward arrow keys to move from file to file.   If the file can't be viewed in the QuickLook mode then the file is damaged and probably can't be copied or moved.
    You could try a photo file recovery application like  MediaRECOVER which can scan the memory card and tell you what files, if any, can be recovered before you have to purchase it.
    OT

  • Adobe Reader XI won't launch, can't download or open existing PDF files.

    Running Windows 7 and have had no trouble with PDF files until few weeks ago.  Now Adobe Reader Xi won't execute and I can't download or open existing PDF files using Adobe.  Interesting that I can open existing PDF files unsit PaintShop Pro X4 but not in Adobe.  Have unistalled and reinstalled Adobe Reader XI several times with no change in problem.

    You can try using Windows Explorer to navigate to C:\Program Files (x86)\Adobe\Reader 11.0\Reader, then double-click on Eula.exe and accept the license agreement

  • Snow leopard  will no open existing files in Pages, Numbers, Appleworks etc

    I have installed Snow Leopard, after wiping the hard drive of my Mac Pro.
    I can open existing files, [ Pages, Numbers, Appleworks etc ] which display the outlines but not the text of document, although some file references and e mail address are shown in faded pale blue. Photos, .pngs display correctly. I have run full disc repair with no visible problems.
    Have reverted to OS X 10.5.8 to use the machine. Any help appreciated

    Read here >   Apple Safari 5.1 and Adobe Reader/Acrobat Advisory
    Use Preview instead.
    Right or control click a PDF file you have on the hard drive then click Get Info.
    Click the pop up button where you see: Open with
    Select Preview  (or if it's not available click "other" then navigate to the Applications folder then select Preview)
    Then click Change All

  • I cannot open FF when I click on the desk top icon.

    I cannot open FF when I click on the Icon. I have reinstalled it, and done everything that I know ot do. I have restored my computer to a earlier date. I can get to Gmail through E-, but cannot open FF.

    It's possible that the desktop shortcut is corrupt. To create a new one, please follow these steps.
    #Right click the existing shortcut and go to Properties.
    #Then click the button called ''Find Target'' which will take you to '''firefox.exe'''.
    #Delete the existing desktop shortcut.
    #Right click and hold down the right mouse button while you drag firefox.exe out of its folder and onto the desktop. When you let go of the right mouse button, you'll get a menu. Choose '''Create Shortcut Here'''.
    I believe the "Find Target" button has changed in Windows 7, but I can't recall what it's called now.

  • Open Multiple JFrame in one window

    hi all.......
    I've developed one Java-Swing application with Menubar. If i click each menu item Im opening new JFrame. But i want to open this each JFrame in a parent JFrame. For example If i Click File->Open it will open new JFrame as separate, if i again click File->New , it will open another new JFrame for new. likewise it will open each JFrame for each menu item. But I want to open it in a parent window itself. My problem is same like MDI in VB.
    Kindly help me to proceed.........
    thankx.........
    kalai.

    I think you have to use JInternalFrame
    First declare
    JDesktopPane() desktopPane=new JDesktopPane();
    mainFrame.getContentPane().add("Center",desktopPane);
    mainFrame.setVisible(true);
    Simple way is to use Container
    if mnuNew is clicked
    JFrame templateFrame=new JFrame();
    Container container= templateFrame.getContentPane();
    the above frame is object of your <template> frame
    it will add everything in to Container including controls with actListeners
    Now call
    public void createInternalFrame(String title)
         try
         JInternalFrame iFrame=new JInternalFrame();
         iFrame.getContentPane().add(container);
    desktopPane.add(iFrame);
         iFrame.addNotify();
    iFrame.setMaximum(true);
         iFrame.setVisible(true);
    iFrame.setClosable(true);
         iFrame.setTitle(title);
    iFrame.setDefaultCloseOperation(iFrame.DISPOSE_ON_CLOSE);
         }//Try
         catch(Exception E)
    System.out.println("Error "+E);
    }//CreateInternalFrame

  • Open Multiple JFrame in a single Window

    hi all.........
    Im developing one application using Java&Swing. I've used JFrame for Home window, That window with JMenubar and Jpanel for backround image. If i click one menuitem then it will open that JFrame in one new window, then if i click one more menuitem then i'll open that JFrame in another window, like if i click n no.of times it is opening n JFrame in n separate window.
    im using like this..........
    void menuitem2_ActionPerformed(ActionEvent e)
    First jf= new First();
    jf.setSize(200,300);
    jf.setVisible(true);
    this.getContentPane().add( jf, new XYConstraints(0, 0, 790, 545));
    for each menuitem. In each menuitem event - ActionPerfomed im calling the corresponding Java file which extends JFrame and im adding that in "this " constuctor.So it is opening each window for each event.
    But i want to open it in a same window. For this how should i declare home window JFrame and Other Java file JFrame.
    Kindly help anyone to proceed....
    thanking you,
    Koks.

    Do you have any intentions of making a patch? I see from other forums that your users are all frustrated about this.

  • Opening existing animated GIF in Fireworks CS6

    When opening existing animated GIF in Fireworks CS6, it always flattens it, opening it in its first frame. All other frames (states) are lost. What am I doing wrong?

    That's perplexing. I haven't used Dreamweaver in a while. Even though Fireworks is listed in Preferences as my primary image editor, I'm seeing Photoshop on the Edit button, at least with an animated GIF on the page. If I ctrl-click on the image, I can choose to edit it in Fireworks, in which case it opens normally, with all the states preserved.

  • Can't Open Existing Projects

    Hello, I'm using GarageBand 3.0.4, and i'm having a heck of a time trying to understand why this is happening:
    I have GB projects (music projects) made (only 2 of them). I click on the GarageBand icon in the dock, the window that gives you an option of what file you want to create pops up (after initializing). The last option says "Open Existing File". I click on it, brings me to the window to select the file I want to open. I select the one I want, click open, then....frustration.
    What happens is, it just takes me back to the window that asks me what type of file I want to create (and the "open existing file" option at the bottom). I've tried opening up the other file, and still the same thing.
    I even tried making a new project, saving it, and then try opening it up again, but does the same thing.
    What's going on here?!
    -Thanks

    Well, YAY! and Gah!
    At least we have you up and running, but I'm not sure what the actual problem is.
    It makes me think that some kind of support file is munged (technical term), but I wouldn't expect that to affect opening a file, just creating one (I've seen this and been able to recreate it, so it makes sense to me)
    About the only thing that I can think off at the moment is reinstalling GB from the original DVD. I would probably search for everything with the name "GarageBand" and delete it/them (except, obviously, files or folders I created) and then do the install.

  • Unable to open existing Illustrator documents

    Help! I cannot open existing Illustrator documents! I haven't changed anything. All of a sudden when I go to File and choose to open a document it just freezes the application. I can create new documents, but not open old ones. This is a big problem.
    I have tried uninstalling and reinstalling the application. I have tried opening the documents using my Finder window or through the application. Regardless of my method the existing documents will not open and cause the application to freeze. It doesn't give me an error message it just says "application not responding." I then can click to report the problem to Apple, which I have.
    Any ideas? Suggestions? Solutions?

    Post you problem in the Illustrator forum here http://forums.adobe.com/community/illustrator/illustrator_general. They will be able to help you.

  • QT 7.6 fails to open when movie icon clicked

    I just downloaded and installed the new update to Leopard (10.5.7) and now, something seems to have gone wrong with Quicktime's - to be exact QT Pro 7.6 - ability to recognize files. Until this morning, I could open a movie file (say, .mov, .MPEG, etc.) or audio file (e.g. MP3) with a control-click on the icon and choosing QT from the various players offered for opening the file. Or, as usual, I could simply double-click on a QT icon. Either way, the file would open in QT and be ready to play.
    Now, suddenly, this no longer works. If I double-click on a QT icon or try to Open it with the control-click move, I see QT appear for an instant - its name appears in the menu bar at top of desktop - but it disappears just as quickly and the file is not presented in a player window.
    I can still open Quicktime as a program first and then use its "Open File ...." menu command to pick a file and play it, no problem. And once the program is open, I can do the double-click move and QT files will open normally for playing.
    I have re-downloaded and re-installed QT, but no luck. I am repairing disk permissions and will see if that helps. (No luck; nothing has changed.)
    If anyone could enlighten me as to how OS X or its apps recognize file types, I'd be grateful. I know that in the Info pane, one can assign an app to a specific file or to all files of a certain type, but I don't quite understand where this linkage could get broken - if that is indeed what has happened on my machine.
    I don't see any other problems of this sort with other kinds of files or apps.
    Thanks in advance.
    John

    I had not repaired permissions, but I will try that. And in response to a suggestion from someone on the Leopard/Finder & Files discussion, I installed the 10.5.7 update and my experience is explained there, like so:
    First, thanks, Baltwo, much for the response and suggested fix. I did set up another admin account and logged-in there, the problem did not seem to exist there, so I went back and installed the 10.5.7 Combo Update, as suggested, and ... well, things have become slightly more mysterious.
    For instance, I have a couple of .MOV files I'd downloaded from the Web. I double-clicked on one of them and I got the same problematic behavior: Quicktime flashed open momentarily, then disappeared, and the .MOV file is left unopened. I tried the other movie file, and same thing. Then, I picked an MP3 file and control-clicked it and chose from the pop-up menu to Open it with Quicktime. Voila, it opened. And now, with that MP3 still open, I went back to the .MOV files and they both opened in Quicktime with a standard double-click.
    I now closed QT and tried to double-click one of the .MOV files. Sure enough, it opened just fine. And the second one, too. I closed QT and tried this again, to confirm. But no, now these files would not open the right way.
    Puzzle No. 1: In my Finder's list of Recent (App) Items, the name Quicktime shows up twice. This is downright strange, and makes me wonder if the OS is confused or seeing some set of mismatched QT components from different releases of the program.
    I can erase the Recent Items list and then, even if I my trying to open a QT file fails, the name Quicktime shows up in the list. If I then do get another QT file to open, there will be a second listing of QT in the Recent Items list - as if two distinct programs had been called upon.
    Puzzle No. 2: When I did open that MP3, it seemed to take considerably longer than usual, as if the computer were having to sort something out before it opened the file. And when MP3 data is loading into QT, it takes much longer than it used to - maybe 5 times slower or more. This new sluggishness in Quicktime actually has been evident to me ever since I first installed Leopard a few weeks ago. I got to live with it, but it was certainly annoying at first - and still is, if I think about it, because it makes me suspect that QT, or more likely, supporting code within Leopard, has been diddled in some way that's highly optimized for the Intel processor and in so doing treats Power PC as a lesser chip, or even an afterthought. My further trouble with opening QT files seems to point to the same thing. Certainly, I hope I'm wrong.
    Puzzle No. 3: I tried to open some .DV movie files that I'd made with iMovie awhile back. Their icon shows the QT logo and they've always opened by default with QT. A double-click wouldn't open them, no matter if the QT was already open or not. With QT already open to an MP3 file, one of these .DVs opened with the Control-click-Open move, but not the others. Otherwise, nothing doing.
    Maybe some of this evidence points to another possible fix, or offers insight into changes we're not being told about or that were unanticipated. I hope Apple is listening and will offer some advice or a fix.
    Thanks all, John

  • When I open up iphoto and click on the events tab then double click on an event, it used to show minis of all the photos in that event.  Now it shows only one photo at a time.  How do I get it back? Can you help?

    When I open up iphoto and click on the events tab then double click on an event, it used to show minis of all the photos in that event.  Now it shows only one photo at a time.  How do I get it back? Can you help?

    On the bottom bar of the window (on the left iPhoto 11, on the right in other versions) note the slider. Drag it left.
    Regards
    TD

  • I just updated to Firefox 17.0.1 and now I can't click on a bookmark to open it or open new tab when clicking new tab button.

    In FF 17.0.1 I have several bugs to mention. I am only able to open bookmarks by right clicking them and selecting Open In New Tab from the drop down menu. I am unable to open a new tab by clicking on the new tab button or by clicking open new tab from the FF drop down menu at top of browser. Also, none button work in FF, such as Home, Back, Forward, or refresh. This is so aggravating!!

    After I posted this, I restarted with add ons disabled and it worked..deleted a cpl of addons for compatibility checking and that fixed it.

  • FF 6.0 doesn't open pdf-links, after clicking on "open pdf" error message says file not supported or damaged. IE opens file all right. Please advice.

    Firefox 6.0 doesn't open pdf-links after clicking on "open pdf". I frequently need to do literature searches and I need to view pdf files in the browser. After clicking on the pdf - link of a file the main options are to open or download the pdf. Every time I try to open a pdf-file a blank page and an error message appears saying the file would not be supported or is damaged. IE, however, opens the file all right. I tried various changes in the security and cookie settings without success. Please advice.

    Hi SGckc,
    This document is almost certainly a dynamic XFA form. Unfortunately, our mobile Reader does not support displaying or filling such forms. The application that produces this form embeds this message into the document so that non-supportive viewers (like ours) will display this "error" page when the document opens. I do realize that this is confusing and I would like to add some additional detection to our Reader for this case. However, we've avoided doing this for fear of confusing users even further. Your feedback helps though. Hopefully we'll find a way to detect this case and present a better message to the user like: This form is not supported by the mobile version of the Adobe Reader. Please open and fill it on the non-mobile version of the Adobe Reader for Windows, Linux or Mac OSX.
    Thank you for contacting us!
    Pat

Maybe you are looking for