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
Hej, I cant save anything on intern or extern memory. Was about to write some file into a folder belonging to some application. Made this with a copy from external to internal memory alst friday without any problem. But I even could not save a file o [More]
I have a time machine backup of a mac with snow leopard that I made back in June. I want to put it on my new mac with Lion but it won't have this update - http://www.cultofmac.com/105225/if-you-want-to-migrate-from-snow-leopard-to-lion -tomorrow-you- [More]
Hello, I just bought an Imac, and jumped right in with creating a website. Everything is a dream come true except the photos i want to share are massive! 5 - 10 mb each. the problem is that when ever my friends try to download the pictures all they g [More]
I have the 5g ipod with the ipod brand AV cable. I'm doing a project in class in which I want to display pictures from my ipod on a TV, Ive done it before, but this time around, I cant get it to work I have the 'TV out' set to 'On', and the 'TV signa [More]
My I Phone is on silent mode i  cannot get it turned offGo to Settings-General-Accessibility scroll to the very bottom and turn on AssistiveTouch. In the top left corner of your screen a black box with a circle will appear. Select it then select devi [More]
Hi , I am writting a custom component which will add some action on documents and virtual folder. I am able to add the menu item for DocInfo, but not able to add Menu Item in Virtual Folders Actions Menu. Please help!! thanksI am able to add the menu [More]
We are delivering a digibeta of a spot we just created, I just got an email in regards of the delivery. "Please have them delievered to ** on digibeta tape with a beauty and mattes, and any effets should be on split audio tracks." What i dont' r [More]
Hi   I have a requirement. I get the PR date . I need to add the USR01 ,USR02 ,USR03 to the PR date to get the planned RFQ,Quotation ,PO dates. Can you please tell how? I also ned to make a check that it does not fall on a sunday and for the respecti [More]
I have a fct like public void fct(String inStr) { String str = "SELECT * FROM TABLE WHERE ROW IN" + inStr; // then I xecute the query using JDBC connection But I want to do the same thisn using SQLJ like: public void fct(String inStr) { #sql [nc [More]
Hi all, I have used page refresh code in PR of controller. String onLoadFunction = "\n function onLoadFunction (refTime){ " + "\n setTimeout(\"location.reload(true);\",refTime);" + "\n } " ; oapagecontext.putJavaScr [More]