How to close JWindow and keep it front

my main opens a fullscreen jframe and then a smaller Jwindow.
i called toFront but the Jwindow is always hidden behind
the jframe. how do i keep jwindow in front ALWAYS.
also, i have a mouselistener in the jwindow (that works fine)
and im calling
window.setVisible(false);
window.dispose();
but the jwindow is never disappearing.
anybody have any suggestions? thanks!

I can't reproduce your problems. Here's my code.import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Test3 extends JFrame implements ActionListener {
  JWindow jw = new JWindow(this);
  JButton jb = new JButton("Show");
  public Test3() {
    jw.setBounds(100,100,100,100);
    jw.getContentPane().add(new JLabel("I am Window!", JLabel.CENTER));
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = getContentPane();
    content.add(jb, BorderLayout.SOUTH);
    content.setBackground(Color.pink);
    jb.addActionListener(this);
    setSize(300,300);
    setVisible(true);
  public void actionPerformed(ActionEvent ae) {
    if (jb.getText().equals("Show")) {
      jw.setVisible(true);
      jb.setText("Hide");
    } else {
      jw.setVisible(false);
      jb.setText("Show");
  public static void main(String[] args) { new Test3(); }
}

Similar Messages

  • How can I quit (close) Photoshop and keep all windows so that the next time I open Photoshop the fil

    How can I quit (close) Photoshop and keep all windows so that the next time I open Photoshop all the files that I had open are there already in the same position as when I closed Photoshop?
    I've been a Fireworks user for over 10 years and just switched to Photoshop. I cannot find a setting that will enable all my file windows to reopen when I quit Photoshop. This is really a problem since I often work on several files at the same time.
    Please let me know if the feature exists or point me to where I can post a message for a new feature to be implemented. The feature is a must for any designer working on large projects.
    Thanks!

    There is no such functionality. You could perhaps create a script that stores that info in a custom text file and arranges them accordingly in the workspace, but that's as good as it gets...
    Mylenium

  • When I try to upgrade, it tells me all that is on my iPad 1 is going to be erased. How to I upgrade and keep and backup what I already have. Thanks for any info.

    When I try to upgrade, it tells me all that is on my iPad 1 is going to be erased.
    How to I upgrade and keep and backup what I already have.
    Thanks for any info.
    Shirley

    Hello, alaute. 
    Thank you for visiting Apple Support Communities.
    If you are experiencing issues activating your device, see the article below.
    iPad: Troubleshooting activation issues
    http://support.apple.com/kb/ts3424
    Cheers,
    Jason H.

  • HT4099 How to change it and keep permanent?

    I have two accounts and changing between them changes Login panel back to US Layout. I would like to keep Colemak layout all the time. How to change it and keep permanent?

    I have this problem too. Any solutions?

  • How do I make and keep a copy of a photo in iPhoto so that I can edit the copy and keep the unedited original?

    How do I make and keep a copy of a photo in iPhoto (version 9.5.1) so that I can edit the copy and keep the unedited original?

    You don't have to. iPhoto does that automatically. Note the command in Photos menu to 'Revert to Original' and the original can be exported at any time using the Export command.
    Longer answer:
    All edits in iPhoto are virtual. The database records your decisions and then applies them to a copy of the original. So your original is untouched. Your edited version is never "fixed" until you export it.

  • How to change country and keeping all application upgraded ? thx

    how to change country and keeping all application upgraded ? thx

    you may change the userID/ passwd from menu or create conn segment for each of the userID/ passwd combination .

  • How to close jwindow

    hi,
    Can you tell me how to close JWindow. Please help
    thanks

    alt-F4 seems to work OK when the JWindow has a parent
    here's your previous post's code, modified
    import java.awt.*;
    import javax.swing.*;
    class demo extends JWindow
      int screenWidth;
      int screenHeight;
      public demo(JFrame f)//<------changed
        super(f);//<--------added
        screenWidth = Toolkit.getDefaultToolkit().getScreenSize().width;
        screenHeight = Toolkit.getDefaultToolkit().getScreenSize().height;
        JPanel pn = new JPanel();
        pn.setBackground(new Color(0x808000));
        getContentPane().add(pn);
        setSize(screenWidth,screenHeight);
        setVisible(true);
      public static void main(String args[])
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setUndecorated(true);
        f.setSize(0,0);
        f.setVisible(true);
        //demo d = new demo();
        demo d = new demo(f);
    }

  • How to format Leopard and keep Music, Docs, Photos, Movies, and Contacts

    I've recently acquired a macbook. I'm very familiar with PCs and I have recently converted.
    I used to format my PCs every 10 months or so to keep them healthy and keep the clutter of stuff away. The file structures and everything is different with macs and Leopard especially is different. I want to know what would be required of me to do the equivalent of a PC formatting on a mac. And how often do they have to be done on Macs anyway? I'm guessing it's about the same as it is for PCs, around 10 months or so?
    On my PC I'd just copy the My Documents folder, my iTunes, My Pictures folder, Microsoft Outlook (I'd make a backup and restore it after the format), and My Videos. I'd copy all these onto an external hard drive and then drop them all back onto my PC after the format.
    What is the equivalent procedure on a Macbook with Leopard? I have Time Machine with Time Capsule, if that makes a difference. But I heard that Leopard has it's own ways of formatting when you want to format? What are my options in terms of achieving the same sort of end product? Namely, getting rid of the clutter that accumulates on computers over time, and then restoring all my documents and media files back to the computer after the format.
    Thanks for the help. I'm glad I'm on a Mac now, but this is the one thing I haven't been able to figure out.

    Extended Hard Drive Preparation
    1. Open Disk Utility in your Utilities folder. If you need to reformat your startup volume, then you must boot from your OS X Installer Disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger or Leopard.)
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area. If it does not say "Verified" then the drive is failing or has failed and will need replacing. SMART info will not be reported on external drives. Otherwise, click on the Partition tab in the DU main window.
    3. Click on the Options button, set the partition scheme to GUID (only required for Intel Macs) then click on the OK button. Set the number of partitions from the dropdown menu (use 1 partition unless you wish to make more.) Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the volume(s) mount on the Desktop.
    4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
    5. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, check the button for Zero Data and click on OK to return to the Erase window.
    6. Click on the Erase button. The format process can take up to several hours depending upon the drive size.
    Steps 4-6 are optional but should be used on a drive that has never been formatted before, if the format type is not Mac OS Extended, if the partition scheme has been changed, or if a different operating system (not OS X) has been installed on the drive.
    Although the above is the procedure there's no reason to ever reformat the drive unless the drive or system files have been corrupted beyond repair.
    You can easily create a bootable clone of your system on an external Firewire drive. If you ever need to replace the system you can simply restore it from the clone. Using backup software the clone can even be kept current with incremental updates. This whole process can be automated via backup schedules provided the backup software supports scheduling (most decent ones do.) Individual files or folders can also be selectively restored from the backup.
    Basic Backup
    Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
    1. Retrospect Desktop (Commercial - not yet universal binary)
    2. Synchronize! Pro X (Commercial)
    3. Synk (Backup, Standard, or Pro)
    4. Deja Vu (Shareware)
    5. Carbon Copy Cloner (Donationware)
    6. SuperDuper! (Commercial)
    7. Intego Personal Backup (Commercial)
    8. Data Backup (Commercial)
    The following utilities can also be used for backup, but cannot create bootable clones:
    1. Backup (requires a .Mac account with Apple both to get the software and to use it.)
    2. Toast
    3. Impression
    4. arRSync
    Apple's Backup is a full backup tool capable of also backing up across multiple media such as CD/DVD. However, it cannot create bootable backups. It is primarily an "archiving" utility as are the other two.
    Impression and Toast are disk image based backups, only. Particularly useful if you need to backup to CD/DVD across multiple media.
    Also read How to Back Up and Restore Your Files.
    Although you can buy a complete FireWire drive system, you can also put one together if you are so inclined. It's relatively easy and only requires a Phillips head screwdriver (typically.) You can purchase hard drives separately. This gives you an opportunity to shop for the best prices on a hard drive of your choice. Reliable brands include Seagate, Hitachi, Western Digital, Toshiba, and Fujitsu. You can find reviews and benchmarks on many drives at Storage Review.
    Enclosures for FireWire and USB are readily available. You can find only FireWire enclosures, only USB enclosures, and enclosures that feature multiple ports. I would stress getting enclosures that use the Oxford chipsets (911, 921, 922, for example.) You can find enclosures at places such as;
    Cool Drives
    OWC
    WiebeTech
    Firewire Direct
    California Drives
    NewEgg
    All you need do is remove a case cover, mount the hard drive in the enclosure and connect the cables, then re-attach the case cover. Usually the only tool required is a small or medium Phillips screwdriver.
    Kappy's Personal Suggestions for OS X Maintenance
    For disk repairs use Disk Utility. For situations DU cannot handle the best third-party utilities are: Disk Warrior; DW only fixes problems with the disk directory, but most disk problems are caused by directory corruption; Disk Warrior 4.x is now Intel Mac compatible. TechTool Pro provides additional repair options including file repair and recovery, system diagnostics, and disk defragmentation. TechTool Pro 4.5.1 or higher are Intel Mac compatible; Drive Genius is similar to TechTool Pro in terms of the various repair services provided. Versions 1.5.1 or later are Intel Mac compatible.
    OS X performs certain maintenance functions that are scheduled to occur on a daily, weekly, or monthly period. The maintenance scripts run in the early AM only if the computer is turned on 24/7 (no sleep.) If this isn't the case, then an excellent solution is to download and install a shareware utility such as Macaroni, JAW PseudoAnacron, or Anacron that will automate the maintenance activity regardless of whether the computer is turned off or asleep. Dependence upon third-party utilities to run the periodic maintenance scripts had been significantly reduced in Tiger and Leopard.
    OS X automatically defrags files less than 20 MBs in size, so unless you have a disk full of very large files there's little need for defragmenting the hard drive. As for virus protection there are few if any such animals affecting OS X. You can protect the computer easily using the freeware Open Source virus protection software ClamXAV. Personally I would avoid most commercial anti-virus software because of their potential for causing problems.
    I would also recommend downloading the shareware utility TinkerTool System that you can use for periodic maintenance such as removing old logfiles and archives, clearing caches, etc.
    For emergency repairs install the freeware utility Applejack. If you cannot start up in OS X, you may be able to start in single-user mode from which you can run Applejack to do a whole set of repair and maintenance routines from the commandline. Note that presently AppleJack is not compatible with Leopard.
    When you install any new system software or updates be sure to repair the hard drive and permissions beforehand. I also recommend booting into safe mode before doing system software updates.
    Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
    1. Retrospect Desktop (Commercial - not yet universal binary)
    2. Synchronize! Pro X (Commercial)
    3. Synk (Backup, Standard, or Pro)
    4. Deja Vu (Shareware)
    5. Carbon Copy Cloner (Donationware)
    6. SuperDuper! (Commercial)
    7. Intego Personal Backup (Commercial)
    8. Data Backup (Commercial)
    The following utilities can also be used for backup, but cannot create bootable clones:
    1. Backup (requires a .Mac account with Apple both to get the software and to use it.)
    2. Toast
    3. Impression
    4. arRSync
    Apple's Backup is a full backup tool capable of also backing up across multiple media such as CD/DVD. However, it cannot create bootable backups. It is primarily an "archiving" utility as are the other two.
    Impression and Toast are disk image based backups, only. Particularly useful if you need to backup to CD/DVD across multiple media.
    Visit The XLab FAQs and read the FAQs on maintenance, optimization, virus protection, and backup and restore.
    Additional suggestions will be found in Mac Maintenance Quick Assist.
    Referenced software can be found at www.versiontracker.com and www.macupdate.com.

  • How to close appstore and camera ?

    app store and camera always running when i use system monitor even i close from the background ?
    how to close them from processes and what is the processes that usually work in system monitor ??
    it was mail also running but after i delete the iclould account it gone ...
    plz help ...

    Thank you for that link. I bought two tutorial programs for Iphone 4 and that's where I saw that it was adviced to close Safari and other Apps entirely as they were running in the background and in doing so were wearing down on the battery.
    As far as I understand the link you went me Safari and other Apps are kind of closed once I have clicked the Home button so that should be OK.
    However, when I opened a radio program it did not seem to be possible for me to close it down even though I was using the Home button. The music kept playing which of course many times would be great however I would like to know how to close a program when I do not want to use it any more.

  • How to close Safari and Apps entirely?

    I recently got Iphone 4 and have been reading through the manual where I noticed that Safari and other programs are still running in the background if I do not close the programs entirely. I thought all programs were closed once I clicked the 'home' button and opened another program.
    I am not sure exactly how to close Safari or the App programs so I would be grateful to learn about how to do that.
    Thank you.

    Thank you for that link. I bought two tutorial programs for Iphone 4 and that's where I saw that it was adviced to close Safari and other Apps entirely as they were running in the background and in doing so were wearing down on the battery.
    As far as I understand the link you went me Safari and other Apps are kind of closed once I have clicked the Home button so that should be OK.
    However, when I opened a radio program it did not seem to be possible for me to close it down even though I was using the Home button. The music kept playing which of course many times would be great however I would like to know how to close a program when I do not want to use it any more.

  • How to programmatically load and show the front panel of a vi but NOT run it?

    Is there a way to load and show the front panel of a vi but NOT run it?  I am starting with the AsynchronousCallAndForget.vi from the example finder and inserted an invoke node with the FP Open method call prior to the Start Asynchronous Call node. The vi I am loading has the "Run when opened" unchecked and the menu bar IS visible so I can manually click the run arrow. Thanks!
    Solved!
    Go to Solution.

    Why are you using the Async call? If you simply open the VI reference, then call the FP.Open method this works fine. You can then call the VI run method with Wait Until Done set to false if you wish to run it Asynchronously, this is how we did it in ye olde days before we had this new fangled "Start Asynchronous Call" stuff. 
    Charles Chickering
    Architecture is art with rules.
    ...and the rules are more like guidelines

  • New Computer... how to copy music and keep playlist linked?

    I have a new computer. Moved (using Windows) the "My Music" folder to a USB drive. When I copy it to the new computer and import the folder, the playlist is not linked.
    What are the steps to move the library and keep the playlists linked?

    When I copy it to the new computer and import the folder, the playlist is not linked.
    Don't import it.
    Quit iTunes.
    Copy the entire \iTunes\ folder inside \My Music\ on the extenal to \Music\ on the internal then launch iTunes.
    Everything should be there.

  • How to import photos and keep album structure?

    Hi all -
    I had to do a clean install of OS X, but beforehand, I backed up my entire hard drive using Super Duper.
    Now, I want to import all of my photos back into iPhoto, but is there a way for me to do this and keep the previous album structure that I have? I tried dragging the IPhoto library folder into iPhoto and it imported the photos, but my albums are gone.
    Thanks for your help!

    Hi.
    Trash the iPhoto Library folder that you created on your Mac, or rename it "iPhoto Library damaged" if you may need some of its contents. Copy the iPhoto Library folder from the backup into your Pictures folder. Hold down the Option key as you launch iPhoto and select "Choose Library" from the dialog. Navigate to the good iPhoto Library folder and open. iPhoto should launch and open your library in exactly the same condition it was in when the backup was made. If all goes well you don't have to import anything.
    If the library is still missing items, you can try a database rebuild. Hold Command and Option while you launch, select the first 3 options in the dialog, and rebuild. This can fix a library with a slightly damaged database.
    If the library still isn't working you may have to create a new library (Option-Launch, select "Create") and import your Originals folder from the backup library. This will give you the pictures back without creating duplicates, but your albums and other items will not be recovered.
    Regards.

  • Downsaving to version 10 rasterizes my gradients. How do I downsave and keep everything vector?

    I am trying to downsave my Illustrator work to version 10 AND keep all the shapes vector. I do a save copy and select the version of Illustrator I need (10), the result gives me rasterized images rather than vector for many of the gradient filled shapes. What do I do to make sure everything stays vector?
    Diane

    I'm using the most current CC version. It's not a drop shadow issue, its a gradient issue. I have gradients stacked on gradients and they contain transparency.
    I can save down to CS4, but once I try to save as CS3, the gradient rasterize.

  • FCPX: How to import, transcode and keep an Event on an external drive

    I was given 300 GB of media files, mostly Quicktime movies, on a read-only NTFS format Lacie drive. I tried importing into FCPX, checked the optimized and proxy transcoding options as well as import folders as Keyword Collections option, and it took hours for less than 1/3 of the media to render, then I got a warning that my startup disc was almost full.
    I assume the best thing to do is start over, and move my files to another read-and-write drive so that I can keep the transcoded files off my Mac.
    But my main question concerns the FCPX Events folder:
    If all media and other project-related info is stored in the Events folder on my Mac, how can I keep the transcoded media on an external drive? Do I just uncheck “Copy files to Final Cut Events folder” in the Import dialog? (If I uncheck it, where are the transcoded files copied to, and how are they organized? What stays in the Events folder on the Mac, and what goes on the external drive?)
    Also, should I not bother transcoding, or just select one of the options (which one, and why?) I’m editing a 12-15 minute narrative film – mostly cuts, probably no effects, but will color correct and add titles and sound fx/music.
    Any insight for this process, as well as practical advice, would be greatly appreciated, as I’m trying to fully understand and start off the right way before I dive into this edit. Thanks in advance! 

    I would create a new Event in FCPX first so that I can choose which drive those files are going to end up on.
    Then, Import your files.  Choose the Event they should be Imported to.  If you want it to copy the files to that Event onto the drive it was created on, then choose Copy Files to Events Folder.  It will only copy, not just move the files.  If you are copying them onto your MBP's hard drive...yeah, that's probably going to fill up unless you've upgraded that drive.  And yes, 300GB of media can take a while to process and copy, especially if you are Optimizing and creating Proxies.
    In my experience, Optimized files can get fairly large I'm not sure of the percentage) and Proxy files have ended up about 1/2 the size of the originals.  If you are creating Optimized files, Proxy files, AND copying the original media...you have three versions of the files and that 300GB may end up being about 1TB that FCPX is creating.
    If you want to work primarily with proxies, I would NOT copy the original file, but I would have FCPX create the proxies in the Event folder on your hard drive.  If you just gotta have Optimized files for your final output...I would wait until you are ready for output to create those.  If you only have the Proxy files on your laptop, with the original files on their original drive, then it should only take up 150-200GB on your laptop hard drive.  At that point, you can leave FCPX in proxy mode (got to FCXP>Preferences>Playback>Use proxy files
    If you detach the external hard drive, the original files will show up as missing, but proxy mode should recognize the Proxy files in the Event folder.
    If you still want to create Optimized files, Proxy files and copy the Original Media, get a separate external drive that will have the room you need and one you can edit from.
    For large projects where I have a lot of footage, I edit and add effects in Proxy mode and then switch to Original/Optimized>Highest Quality for final color grading, rendering and exporting.
    Hope that helps!  al the best!

Maybe you are looking for