Sitemap

Amicuk Programming Answers

Problem with JWindow

2015-10-11   Views:0

Advertisement

Hi all, I have a very important question.... I created a small application and when i launch it, i'd like to have a JWindow displayed on my screen only during 5 seconds.... So i run my application, my JWindow is displayed during 5 seconds and then th

Hi all,
I have a very important question....
I created a small application and when i launch it, i'd like to have a JWindow displayed on my screen only during 5 seconds.... So i run my application, my JWindow is displayed during 5 seconds and then the application "really" begins.
But how do i have to proceed to have my JWindow displayed only during 5 seconds and then close automatically???
Thanx very much for helping....

The replay answer
Advertisement
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.Timer;
public class SplashWindow
    public static void main(String[] args)
        JFrame f = new JFrame();
        showSplash(f);
        JPanel panel = new JPanel();
        panel.setBackground(Color.red);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(panel);
        f.setSize(400,300);
        f.setLocationRelativeTo(null);
    private static void showSplash(final Component c)
        JLabel label = new JLabel("hang on, it's coming...", JLabel.CENTER);
        final JWindow w = new JWindow();
        w.getContentPane().add(label);
        w.setSize(200,200);
        w.setLocationRelativeTo(null);
        w.setVisible(true);
        final Timer timer = new Timer(5000, new ActionListener()
            public void actionPerformed(ActionEvent e)
                w.dispose();
                c.setVisible(true);
        timer.setRepeats(false);
        timer.start();
}

Go to See the other 4 answers

Jpopupmenu visibility problem with JWindows

Category:DefaultRelease time:2015-10-11Views:130

Hello, BACKGROUND: I am attempting to implement a feature similar to one found in the netbeans IDE for a programming editor I am helping to write. The feature is an autocomplete/function suggestion based on the current word being typed, and an api po[More]

Two very STRANGE problems with JWindow and JTextField

Category:DefaultRelease time:-0001-11-30Views:130

I am having some trouble in the program that I am making. It is a Swing based GUI. I have a JWindow with a JPanel in it that holds JTextFields and JLabels. problem1----I can't see a caret in any of the textfields but I can still enter text. problem2-[More]

Problems with JWindow

Category:DefaultRelease time:-0001-11-30Views:130

Hello! I was trying to make a splash screen with JWindow class. But nothing but a blank JWindow is shown after the program is run. I've already searched the forum for solution to this kind of problem and I found that few had similar problems. Accordi[More]

AlwaysOnTop problem for JWindows

Category:DefaultRelease time:-0001-11-30Views:130

Hello everyone.I have the following problem I got an application that allows user to create multiple JWindows under one JFrame. The parent JFrame itself is not set to be AlwaysOnTop, neither are JWindows. This is optional. Each JWindow can be set to[More]

Problem with JWindow

Category:DefaultRelease time:2015-10-11Views:130

Hi all, I have a very important question.... I created a small application and when i launch it, i'd like to have a JWindow displayed on my screen only during 5 seconds.... So i run my application, my JWindow is displayed during 5 seconds and then th[More]

Problem with Mnemonic Alt F4 with JWindow in solaris OS urgent!......

Category:DefaultRelease time:-0001-11-30Views:130

hi all I have a problem with JWindow i created a menu where in i have all menuitems as i needed with a close MenuItem with Mnemonic ALT F4 i could not able to close the JWindow in solaris as iam not able to catch th e ALT F4 event please help guys an[More]

Multiple Threads Problem

Category:DefaultRelease time:2015-10-11Views:130

Hi, I am new to Java Threading and the current program that I am working is having problems. The program basically paints lines and dots or onto a JPanel which displays an image. There exists a thread here to suspend and resume the drawing at the use[More]

Help in jwindow

Category:DefaultRelease time:-0001-11-30Views:130

hi there i want to build an application with jwindow but i have a problem , the jwindow doesn't have a taskbar button how can i create oneI am not sure if there is no way (I am not an expert) but I would think that it might be easier to change JFrame[More]

JApplet to create Messenger like alert window

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I have a JApplet which allow users to perform daily business process, mostly using the whole container, without any JFrame and JWindow. JDK used: 1.5.0_09 Now, I need to implement some sort of Collaboration system, to alert the user whenever ther[More]

Using JWindow  problem..

Category:DefaultRelease time:2015-10-11Views:130

Hi I am using JWindow for showing a splash window before the application starts. First i use a JPasswordField for Login but i unable i type in it then i use progress bar and still it is unable to get any value for update. when i use JFrame it all wor[More]

I am having a crash problem

Category:DefaultRelease time:2015-10-11Views:130

and it seems to be getting worse. Specifically, I have a G4 AGP, with 8xxRAM 1.3giggle cpu three firewire devices, Maxtor HD, buffalo HD and lacie dvd burner (multi recorder). I upgraded the internal DVD to a Samsung burner a long while ago. This pro[More]

Hot
My voice memos in itunes are grayed out and won't let me play them. There is also a syn icon that appears next to the number of the memo. I tried syncing my phone but it doesn't do anything and the voice memos were deleted from my phone as well after [More]
I have been using Soundtrack Pro since I first installed Logic Studio last fall. Recently it wouldn't load. It says "the application Soundtrack Pro quit unexpectedly." I have no idea why this happened all of a sudden. I deleted all the plists an [More]
I am working on a site in Flash and the content is within a scrolling area. On one of the pages I am making a form using input text but when I publish the file you are not able to type anything in the input boxes. Does anyone have any idea why this c [More]
Hi experts, we are using Inventory Transfer for Consignment Stock in B1. When we print the document we get an inventory transfer document and a Delivery Note/Packing List that shows the batch numbers ("Batch Report in Document Structure"). Howev [More]
I am trying to connect and print to the printer wirelessly but not sure how to set it all up.  Here is my hardware setup Office jet 6600 printer Lenovo laptop. There is no internet connection available.  The printer is not connected to any network cu [More]
I have written a zip function that it's used on an ASP page. The java class has a main static function which is as follows: public static void main(String[] args) inside the main function I have calls to other functions which will perform the zipping [More]
I am using oracle 10G XE. When I have the following, it works fine.. ======================================== FOR report_c IN report_cur LOOP FOR i in 1 .. 62 loop INSERT INTO trip_stop (sc_v, r_id, b_id, code_id, terminal, seq_num, bs_id, flag, note [More]
In Tools - Options - Privacy....I cannot access the Privacy tab. I can open all the other Options tabs..just not Privacy. Am I being hacked/tracked? thanks.Try the Firefox SafeMode. <br /> ''A troubleshooting mode, which disables most Add-ons.'' < [More]
I tried uploading the LIFA_Base.ino to my Uno and got this error during compiling.  Has anyone seen this if so how do you fix it?  C:\\IRremoteTools.cpp:5:16: error: 'TKD2' was not declared in this scope  int RECV_PIN = TKD2; // the pin the IR receiv [More]
I have a Kollsman PPCM with IEEE-488-1978 standard communication card.  I am having problems getting any response from it.  It is setup such that the listener is on address 20 and talker is on address 23.  This is one of the most bizarre setups I've [More]