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
Hi everyone, I just received 2 brand new iPod Nanos for my kids for Christmas, thought I'd be smart and sync them both now before wrapping them so I don't have to be messing around with them on the day. One synced without a problem, then using the sa [More]
I've been using iPods for awhile, and besides the usual iTunes for Windows glitches, I haven't had many problems. Yesterday I tried to transfer an album I had added to my iTunes library over to my iPod (will play in itunes, did not buy from Apple sto [More]
Hi All Experts, I want to carry forward a ONLY single GL balance to next year so can one tell me T.code for it ? Your help is highly appreciated. Thanks in advance ! Regards, Pankaj.the report is SAPF011.Read other 2 answers [More]
Hi all, I have the JNI code integrated to the servlet .The servlet works fine at first time.but when i modified some source code of servlet (not native library) and redeploy it,then reload the same servlet in web browser ,i get "Native library alread [More]
Here is screenshot demonstraiting the problem: [http://wstaw.org/m/2012/07/17/snapshot2.png Screenshot] Main Toolbar is disabled Bookmark toolbar contains a few folders and located at the top row along with the navigation buttons and page tabs. The p [More]
On my calendar on my 3GS  my dates are not in color how do I get that?Try ejecting your iphone from iTunes and then close iTunes. Now retry. Hope this helps.Read other 2 answers [More]
Dear gurus, While creating invoice from SD, SAP assigns posting date as document date. Is there any way to set posting date as pricing date? Is there any routine for it? Or should I do it in user exit? Kind RegardsHi, Please consider revising your de [More]
How can we create an A/R Invoice + Payment using DI API ?Hello, You (should) create a A/R invoice first, then you can create a payment based on the invoice. or If you create the payment first later the invoice you should reconsile the 2 transactions. [More]
Hi, i have IDoc2IDoc Scenario. I already checked IDx1 and IDx2 for IDoc Metadata and in SXMB_MONI the Inbound IDoc looks like it should with right Basic and MessageType of the IDoc. But when i check WE02 in reciever system the Message type is cut. In [More]
Hello community! I would like to know what's the best way to put overlay images on videos, like ads ( actually ads ) I'd like to animate them and all that stuff, the thing is I believe I know how to do it, but I'm not sure. On the one side I image th [More]