Progress bar after button click ------ code included . need help

Hi,
this is my code. i want the progress bar to move after i click the OK button but its not working. Need help urgently.
public class LoggenGUI extends JFrame implements ActionListener{
private JButton btnOk;
private JProgressBar current;
public LoggenGUI() {
super("Login");
this.setBounds(350,225,350,235);
// this.setSize(300,300);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false);
this.btnOk = new JButton("Ok");
// associating action event listener to it
this.btnOk.addActionListener(this);
this.current = new JProgressBar(0,2000);
this.current.setValue(0);
this.current.setStringPainted(true);
this.setContentPane(pane);
this.setVisible(true)
}// end constructor
public void iterate(){ 
while(this.num < 2000){
this.current.setValue(this.num);
try{
Thread.sleep(1000);
}catch(InterruptedException e)
this.num= this.num + 200;
if(this.num >= 2000)
this.dispose();
this.prgrBar = new ProgressBar();
this.current.setStringPainted(true);
public void actionPerformed(ActionEvent evt){
Object source = evt.getSource();
if(source == this.btnOk){    this.iterate();    }
} // end class

You keep posting this question every day. Do you
think you are going to get a different answer each
time you posted it without reading what others have
told you to do!"Insanity: doing the same thing over and over again and expecting different results." --- A. Einstein

Similar Messages

  • Progress Bar after clicking a link

    Hi,
    I would lilke to add a progress bar after clicking a link from the end user interface. I know we have to use onClick property to do this, I found a Java script code which generates a progress bar and included that java script code in the onClick property value but for some reason the java script is not executing.
    Can anybody please tell what I am missing?
    If anybody did this before, please give any thoughts and if possible with any sample code is highly appreciated.
    Thanks in advance.

    I found some info in the forum and did the following.
    Created a js function and copied it to includes folder and added that js function (e.g. myprogress) in the commonScripts.jsp file. In the form filed option for onClick called the java script function like this..
    <Property name='onClick' value='javascript:myprogress()'/>
    also tried with..
    <Property name='onClick' value='myprogress()'/>
    For some reason the java script function is not executing at all.
    I don't understand what I am missing, can anybody give some thoughts.
    Please help.
    Thanks in advance.

  • BSP code to open new page in new window after button click

    Hi expert,
    I have a requirement to write a BSP code to open new page in new window after button click. I have done the same for opening in same window but not for opening in new window.
    Can you please help me out with the code in which the page opens in new window and the menubar & Addressbar is displayed in hide mode.

    Hi,
    To add more with Anubhav...
                              onClientClick = "javascript:window.open( 'pop.htm' ) "
    You can create a pop.htm page, and call the same in another page using the above code.
    Refer standard BSP examples, SBSPEXT_HTMLB, SBSPEXT_PHTMLB, SBSPEXT_XHTMLB. You can run the default.htm pages and see what way you want to design your BSP.
    Thanks,
    Sreekanth

  • How can I display a new scene in JavaFX 2.2? For example after button click

    how to display new scene after button click in the main window, I want the main window and the new scene are in one stage. thx

    You can change the scene by calling stage.setScene(new Scene(newContentParent));
    I don't think you are quite asking for a complete scene change though as you "want the main window and the scene in one stage". The main window is a stage (as Stage extends Window). And a given stage can only contain one scene at a time (though you can swap it out by calling setScene as described earlier).
    What I think you are really asking for how can you replace some content part of the active Scene on the Stage. To do that you can set a layout manager like a HBox or a BorderPane as the root of your scene, then change out the content of the layout manager. For example:
    final BorderPane layout = new BorderPane();
    layout.setCenter(new Label("Dogbert");
    final Button nav = new Button("Next");
    layout.setLeft(nav);
    nav.setOnAction(new EventHandler<ActionEvent>() {
      @Override public void handle(ActionEvent actionEvent) {
        layout.setCenter(new Label("Dilbert"));       
    });In the above short sample code, if you wanted to change the scene rather than the a pane, then you would call stage.setScene rather than layout.setCenter.
    There is a complete executable example with multiple content panes and some styling here:
    http://stackoverflow.com/questions/13556637/how-to-have-menus-in-java-desktop-application

  • Captivate 2: Get rid of Progress bar, Play button, etc..

    Hello everyone,
    This is my first post. I am using Captivate 2 and this is my
    first project i'm working on. I am trying to find a way to leave
    off the progress bar after i've published the project in SWF
    format. I started the project as an "Image Project" and then
    inserted my image and built my project on top and when i go to
    publish the progress bar (with the play, pause, rewind, forward,
    closed captioning) is showing. I do not want that.
    In Captivate 1 it does give you the option to not display
    that when you're using the "Image Project". Has this option been
    removed in Captivate 2? Any help would be greatly apprciated.
    Dre

    Hi Dre and welcome to our community
    Try clicking Project > Skin... and DE-selecting the "Show
    playback control" check box. While you are there, you may as well
    click the Borders tab and DE-select the "Show borders" check box.
    This will force the movie into a single .SWF. Otherwise, you will
    end up with two .SWFs.
    Cheers... Rick

  • I get a black and white logo and a progress bar after upgrade ipad2 5.01

    i get a black and white logo and a progress bar after upgrade ipad2 5.01

    See this page : http://support.apple.com/kb/HT4097 - it covers :
    iPad stops responding, showing the Apple logo with no progress bar or a stopped progress bar, for over ten minutes.

  • Why is my Snow Leopard 10.6.8 suddenly giving me a gray screen and progress bar after I've turned it on? The progress bar takes 4-5 minutes to complete then signing on with my password and all other operations are normal. Solution? Many thanks.

    Why is my Snow Leopard 10.6.8 suddenly giving me a gray screen and progress bar after I've turned it on? The progress bar takes 4-5 minutes to complete then signing on with my password and all other operations are normal. Solution? Many thanks.

    It's starting in safe mode > http://support.apple.com/kb/HT1564
    First of all, do a PRAM reset. If it doesn't help, open Terminal and type:
    sudo nvram boot-args=""

  • Help needed please, with Iphone stuck with apple picture and progress bar after software update attempted

    Help needed please, everytime I try to update the software version on my iphone it comes up with a message saying it could not be completed and is now frozen with the apple picture and progress bar on it. Do I unplug it and hope the macbook pro sees it again, I also stupidly did not back up before starting the download which I realise I will have to go back to the previous back up. This keeps happening, everytime I do this type of update, I'm starting to think I should just give up on updating my software on the Iphone. I thought it was happening because I was using a window based computer to do the updates, this time I used my Macbook Pro. Please somebody help

    ljm17 wrote:
    ...This keeps happening, everytime I do this type of update, I...
    Then you should know what you need to do... If you don't remember...
    See Here  >  http://support.apple.com/kb/HT1808

  • Want to stay on same slide after button click - Captivate 5

    I've got a button I'm using to pop up a separate browser window for a glossary. I need this button on every page of the module. I've got click boxes to control the flow of the timeline from page to page. When the user clicks the glossary, he should stay on the current page, get his information and dismiss the glossary. When I run it, the timeline pauses for the button, and if the user clicks it, the timeline progresses to the pause for the click box, still on the same page. But if the user clicks again on the button, the pop up window works, but Captivate moves on to the next page. Is there any way to prevent this, so that a user could click any number of times on the button without having the timeline progress past that page?
    Thanks for any help anyone can provide.

    Hi DS,
    I use a javascript call to do what you describe all the time.
    Since I use this all the time I embed the actual full javascript in Captivate's "standard.js" file. This is the full script:
    function openBrWindow(theURL,winName,features)
       window.open(theURL,winName,features);
    I save the standard.js file. On my workstation this is the path to that file:
    C:\Program Files\Adobe\Adobe Captivate 5\Templates\Publish\standard.js
    Now I can call the script anytime.
    Here's how I configure the click-box:
    If you look at Rick's picture (thanks Rick) in the Properties control menu under Action, for On Success, choose Execute Javascript.
    Next Click the Script Window button, this opens up a blank window. Since you are just calling the javascript, you don't need to put the whole script in the window. Here is an example:
    javascript:openBrWindow('myURL.html','thewindowname','height=800px,width=1000px,scrollbars =yes');
    Ths example opens a window 800px tall and 1000 px wide with scrollbars. You can add additional attributes if you like. Make sure the URL is correct and has the correct path and if you have more that one of these on a slide the window name will need to be different. (If this persists from slide to slide you don't have to have them all as unique, only for more than one on a slide.
    Now, click the little down arrow beside the Script Window button. This produces a little drop menu (as illustrated on Rick's image). Make sure you select "Top" and turn off the "Continue Playing the Project".
    This control makes the newly spawned window appear on the top of the project and stops the playing of the slide. You can set other options in Properties to turn off or on captions as needed.
    I hope this helps,
    TPK

  • How to display another scene after button click

    In my Application, I've already create tool bar and menu bar at the top, a navigation panel on the left, and a working area in the center. I have an introduction page in opening my application, but I have a problem, when I click a new project button in my navigation panel to show a scene in working area.. a new scene display separately with main window.. I want that scene integrated with main window, can you help me to solve this problem?
    Edited by: 973863 on Dec 2, 2012 6:28 AM

    Has this question not already been answered?
    How can I display a new scene in JavaFX 2.2? For example after button click

  • Strange progress bar after waking from sleep

    This, i am experiencing for the first time.
    1. Ive put my mac pro 3,1 to sleep.
    2. Then, after some minutes (20+) i came back to wake it, but the white led next to the power button was not blinking, but wasnt on at all.
    3. Then i turned computer on (as waking him up) by pressing the power button - because the keys nor the mouse buttons wasnt doing the thing.
    4. THEN I SEE THIS SCREEN with progress bar.
    What does it mean ?
    Was my computer hibernating ?
    5. Then when the progress bar ended, the display went off. The computer power diode was on, but i couldnt do anything.
    'No signal' at display... no response on the keyboard/mouse.
    What was that?
    What should I do now?
    Thanks!

    This is the same, but with my MacBook Pro 9,2 running 10.8.2.
    It does the same, I'll leave it to sleep for an hour, or overnight and then when I open the lid again, I have to put my password in at the FileVault screen and then get this bar. Then my other login screen will come up (with my desktop background) but then, my Mac goes off. The screen goes black and I assume it is trying to sleep again.

  • I have a mac book pro still running mountain lion.I haven't powered it on in a few months. now when i try to turn it on all i get is the apple logo and the progress  bar after a few mins. of trying to load my laptop just turns off.can anyone help me

    I have a mac book pro with retina,I haven't turned it on in a couple of months.no problems then, now when I try to turn it on i only get apple logo and progress  bar. After a few mins the laptop just turns off and nothing eles.any help would be appreciated  thanks

    I linked to it above, but here is another link.
    http://support.apple.com/en-us/HT201262

  • Progress Bar after typing in password. OS X Yosemite

    I just updated to OS X Yosemite and it seems to be working fine but is any one else experiencing a progress bar appearing after entering in their password to access their computer?
    it seems like this progress bar should show when the apple logo appears and not after typing in password
    is it supposed to be like this?
    MacBook Pro with Retina Display, OS X Yosemite (10.10)

    After further investigation, it is not the displaying of "Today" files that is the issue.  It appears that Finder / Favorites / All My Files is not correctly finding & displaying files when using the View / Arrange By / Date Last Opened criteria.  If I switch the criteria to / Date Modified, it finds & displays the file correctly.  See attached screen shots.  (It is possible that this problem existed before Yosemite, as I don't recall which criteria Finder was using before the upgrade.)

  • PB G4 freeze at progress bar after OS DL failed

    Tried updating OS via Software Updater. Unspecified error occurred, the when trying again, "broken pipe" occurred. Now mac frozen at blue screen, and frozen at progress bar when using safe mode. fsck, though, says everything is well.
    I'm out of town and without recourse for the moment to OS discs. Any other thoughts?

    You wrote: "I copied to the Applications folder."That's where I'd say it should go. My concern was you may have dropped it in something like /Library/StartupItems.
    You might check /Library/StartupItems just to be sure there are no Dreamweaver-related startup items therein that may be "confused" given that you moved the application from an external drive to your internal drive, esp. if you had been using it previously from the external. It is a long shot, but worth a check.
    I don't use Dreamweaver, but some apps add either Startup Items, Login Items, or both. You can read my "Troubleshooting Startup and Login Items" FAQ for details about such.
    I suspect the Dreamweaver move isn't the case, but since it was the last change you made before this occurred (was it the last change?) it's worth investigating a bit.
    If the earlier Apple KB article I posted does not help, you can also try the steps in my "Resolving Disk, Permission, and Cache Corruption" FAQ. Perform the steps therein in the order specified.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • Yosemite keeps installing (progress bar) after every restart

    I've recently installed Yosemite and there are currently no more updates available. However every time I restart or reboot my computer I continue to see an install progress bar as if the OS is finishing up an install. Since this is happening every time I reboot or restart my computer I'm thinking something might have gone wrong with the install.
    Any suggestions as to what this anomaly might be? t

    Per PeterVL57 the progress bar is underneath the apple-logo and this process is identical on my two iMacs and MacBooks. Thanks everyone for the quick replies. I guess I was so accustomed to identifying the progress bar with software installs, it hadn't occurred to me that they'd use the same approach to the initial loading of the OS X.
    Thanks again everyone:-)
    All the best.

Maybe you are looking for

  • How do I change the opacity settings for photoshop imported files?

    I am importing a series of photoshop files into CS6 Premiere Pro. There is no background color on the photoshop images, and when I preview them in Premiere's import window, the background appears white. Once I import them into premiere, however, the

  • Replace token in an File

    Hi, I'm searching for an easy way to change specific tokens in a file. For instance an HTML file specify <img src="http://www.site1.com/images/img.gif"> I would like to replace all occurences by <img src="http://www.site2.com/imgs/old/img.gif"> for i

  • Schematool : Table '...' doesn't exist on MySQL

    I'm trying to use schematool to create the db tables that it has defined in various jdo files. When I run it I get the following schematool -action refresh target/classes/net/ajsoft/WebShop/Product/*.jdo Exception in thread "main" java.sql.Exception:

  • Getting started tab won't show info..it's all purple and my page doesn't look like the illustrations

    When I clicked on the getting started tab, the page illustrated does not look like the page I am currently getting. When I tried to click or roll over the various tabs, all I get is a purple box with no information. So far, I have found this site ver

  • Multi-user is disabled!

    Hi, I did something foolish by locking myself out of the system. Currently, I am only able to login as a single-user. Whenever I start the system, I am not able to login utilizing any of the user id's. I have tried serveral things including resetting