Execution time how can i fast

dear java guroos;
i make an application with 15 JInternalFrame which is add into the JDesktop
sample is
class my extends JInternalFrame
//rest of code
setVisible(true);
//then i add as
class amain extends JFrame
JDesktopPane pane=new JDesktopPane();
//rest of class variables
//then declare the JInternalFrame Objects
my m1;
//same like 15 Frames
amain()
//rest of code
create frames();
public void createframes()
//like 15 frmes add into the pane
m1=new my();
m1.setVisible(false);
pane.add(m1);
}after compilation i run it takes 12 seconds to show up the maininterace
can i fast them or minimize the time ?
actually i want that the main frame is visible immediatly
and frames inilize at the backend.
in other meanings i want to make fast it.
how can i do
plz help me

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
public class Example {
    public static void main(String[] args) {
        JDesktopPane pane = new JDesktopPane();
        JFrame f = new JFrame("Example");
        attachListener(f, pane);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(pane);
        f.setSize(800,600);
        f.setLocationRelativeTo(null);
        f.setExtendedState(Frame.MAXIMIZED_BOTH);
        f.setVisible(true);
    static void attachListener(JFrame f, final JDesktopPane pane) {
        f.addWindowListener(new WindowAdapter(){
            public void windowOpened(WindowEvent e) {
                launchWindows(pane, new File(".").listFiles());
    static void launchWindows(final JDesktopPane pane, final File[] files) {
        final int PANE_WIDTH = pane.getWidth();
        final int PANE_HEIGHT = pane.getHeight();
        final int w=400, h=300;
        Runnable r = new Runnable(){
            public void run() {
                int x=0, y=0;
                for(int i=0; i<files.length; ++i) {
                    File file = files;
String filename = file.getName();
if (filename.endsWith(".java")) {
try {
JTextArea area = new JTextArea();
area.read(new FileReader(file), file);
JInternalFrame frame = new JInternalFrame(filename, true, true, true, true);
frame.getContentPane().add(new JScrollPane(area));
frame.setBounds(x, y, w, h);
x += 20;
if (x > PANE_WIDTH-w)
x = 0;
y += 20;
if (y > PANE_HEIGHT-h)
y = 0;
show(pane, frame);
} catch (IOException exc) {
exc.printStackTrace();
new Thread(r).start();
static void show(final JDesktopPane pane, final JInternalFrame frame) {
SwingUtilities.invokeLater(new Runnable(){
public void run() {
pane.add(frame);
frame.setVisible(true);

Similar Messages

  • HT204053 Hello I found someone using My Apple ID for face time how can I disable it

    Hello I found someone using My Apple ID for face time how can I disable it

    Welcome to the Apple community.
    Change your password..

  • HT204053 If I have an apple ID for myself and my wife has just got a iPhone for the first time how can she get the same apps as I have for my iPhone and iPad

    If I have an apple ID for myself and my wife has just got a iPhone for the first time how can she get the same apps as I have for my iPhone and iPad by getting it off my iCloud?

    She can't from iCloud without setting up your iCloud account on her phone. But just sync the same apps from your iTunes Library on your computer to her phone.
    Your wife should setup her own iCloud account - which is separate to the iTunes Store accounts.

  • TS4268 I am trying to facetime on my mac but keep getting the message "The server encountered an error processing registration. Please try again later." I have gotten this multiple times. how can I get around this?

    priority:
    I am trying to facetime on my mac but keep getting the message "The server encountered an error processing registration. Please try again later." I have gotten this multiple times. how can I get around this?
    i also have tried downloading "FaceTap" application to get facetime on my ipad and failed too. i thought i failed because i couldnt download latest 6.0 iOS or later. i downloaded latest software update for iOS but was 5.8 I think

    Wait until Apple fix it. See: http://www.apple.com/support/icloud/systemstatus/

  • My mac is freezing all the time, how can I fix this?

    My mac is freezing all the time, how can I fix this?

    Run Disk Utility to verify/repair your drive(s).  Boot from your installer dvd to repair the boot drive.  If the repair reports that it fixed anything then see if your problem is fixed.

  • I ask the third time: How can I enlarge the menue symbols and the text of the menue in Photoshop CS6 vers.13 so that I can read them??? My laptop has Win 8.1 and a screen resolution of 3840x2160

    I ask the third time:
    How can I enlarge the menue symbols and the text of the menue in Photoshop CS6 vers.13 so that I can read them??? My laptop has Win 8.1 and a screen resolution of 3840x2160.
    It is unbelievable that such an expensive software does not provide a proper lay out wit a high screen resolution!
    It is also unbelivable that it is not possible to get a qualified employee of ADOBE on the phone in Germany.
    hope of feed back: e-mail: [email protected]

    Chris Cox answered your question here:
    I have PS cs6 extended and a new laptop with screen resolution of 3840x2160. Now all control elements and menues are so small that I can not reed them. How can I make them readable without reducing the resolution of the schreen?

  • HT4858 My iphone5 was stolen (second time) :( How can I recover my photos and videos on icloud? Last time they did not all come back

    My iphone5 was stolen (second time) How can I recover my photos and videos on icloud? Last time they did not all come back. Specifically I need photos I took 1 day before it was stolen.

    If they are in photo stream and your computer meets the minimum system requirements (OS X 10.7.2 or higher and iPhoto '11 9.4 or later or Aperture 3.4 or later; or Vista SP2 or later if you have a PC), set up iCloud on your computer and enable photo stream, as explained here: http://www.apple.com/icloud/setup/.  You'll get any photo stream photos from the last 30 days.
    Camera roll photos are stored in your iCloud backup, and can only be recovered by restoring the entire backup to another iPhone or iPod Touch that is running the same or higher version of iOS as the phone you backed up.

  • Apple TV- How can I fast forward through commercials while watching movies on Crackle?

    How can I fast forward thru commercials while watching movies on Crackle.
    I have done it during my first nigh of watching but now in my second evening, I can'r replicate.

    Hey koko3052,
    If you are having playback issues or questions for a specific 3rd party content provider on your Apple TV, you may find the steps and contact infomation outlined in the following article helpful:
    Apple TV: Troubleshooting third-party content providers - Apple Support
    Cheers,
    - Brenden

  • The conection on my ipod has 3 bars and i am able to connect safari and seach on google but when i try youtube it says "cannot connect to youtube" every time, how can i fix this?

    the conection on my ipod has 3 bars and i am able to connect safari and seach on google but when i try youtube it says "cannot connect to youtube" every time, how can i fix this?

    try to exit out of the youtube app with the multitasking feature. if this doesnt work then try to do a manual restart by holding down the home and power/sleep button all the way past the "slide to unlock" screen until the ipod will power off and the apple symbol will appear when the ipod tuens back on

  • Address book has same entries multiple times how can I go back to original cesium

    Address book has same entries multiple times how can I go back to original cesium

    After a couple of days, I'm noticing that the repeat(ing) offenders have more than 10 episodes, and seem to keep repeating them every time I sync.
    They only show once in my phone and in the iTunes Podcasts, but through iTunes and looking at what's in my phone is when I see the repeats.
    Even after I've marked a podcast as played, and deleted it from within my phone, as well as telling iTunes to delete the played episodes, it still shows multiples of the played episodes.
    There doesn't seem to be any rhyme or reason to it either. They aren't the newest ones either.

  • I am traveling out of state every time ,how can i unlocked my i phone 4 to using overseas

    i am traveling out of state every time,how can i unlocked my i phone 4 to use outside u.s ??

    All iPhones sold in the US are locked to either AT&T or Verizon with no offical way to unlock them.

  • HT204053 I have a phone number associated with face time. how can I delete it?

    I have a phone number associated with face time. how can I delete it?

    You mean from your iPhone?  Don't think this is possible.

  • My iphone without face time how can i added ?

    my iphone without face time how can i added ?

    iDevices purchased in Saudi Arabia and several other countries have FaceTime disabled.
    Sorry... But... This cannot be changed.
    https://discussions.apple.com/message/15858866

  • HT5622 i have intered my visa security pin code ronge three times how can i use it again

    i have entered my visa security code wronge three times. how can i reset &amp;use it again?

    Thanks for that. Much more constructive than the last comment. It's only the restriction code I can't recall, not the access passcode. So I can currently access the device, just not age restricted content. Does that's make a difference? I also wondered if anyone knew how many attempts you get to try to get it right. Now tried 21 times and so far nothing bad has happened but I am concerned I'll eventually be completely locked out of the device. That doesn't seem in the spirit of things though. Surely it's foreseeable that a child could repeatedly try to guess the code so I can't see that it would be right to lock the device down completely in that circumstance, particularly if the access code is being typed in correctly every time.
    Thanks

  • When using imovie for Ipad, how can I fast forward a project to cut the length down?

    When using imovie for Ipad, how can I fast forward a project to cut the length down to fit under the 15 minutes required for Youtube? My current project is 23 minutes, and need to cut it down below 15 minutes. I was hoping to speed up the video. The content would actually be better viewed in at a faster speed anyhow.

    Jon,
    It sounds like you did, just as you should, Save_As and Delete everything that is unwanted. If you did the Deletion from the Timeline, there should be nothing from the old Project, that should be included. A DVD is Transcoded and burned from the Timeline. If the Assets are not there, they will not included in the DVD, even if you did not Delete anything from the Project Panel.
    Tell us about the Clips now on your Timeline. Also, can you check the Timeline, by hitting the \ (Backslash key), and looking near the end of the Timeline. Do you have any "orphans" out there? Check all Video Tracks, even if you have to scroll to see them all. Does the Duration of the Timeline (viewed in the Program Monitor) match what you think that it should? If not, then you most likely have orphans, that you missed Deleteing.
    Good luck,
    Hunt

Maybe you are looking for