Status bar question-applet !!

I wrote an applet (below) that is supposed (among other things) to write to the status bar but what happens is that "Applet started." always overwrites the text I'm trying to write to the status bar. Why is that and how can I fix that? The code is:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Multiplication extends JApplet implements ActionListener {
     JLabel showAnswer;
     JTextField answer;
     int usersAnswer, product, value1, value2;
     public void init()
               Container c=getContentPane();
               c.setLayout(new FlowLayout());
               showAnswer=new JLabel("Type in the answer: ");
               answer=new JTextField(10);
               answer.addActionListener(this);
               c.add(showAnswer);
               c.add(answer);
          public void actionPerformed(ActionEvent e)
               multiplication();
          public void multiplication()
               value1=0+(int) (Math.random()*9);
               value2=0+(int) (Math.random()*9);
               showStatus("How much is "+value1+" times "+value2+"?");
               product=value1*value2;
               usersAnswer=Integer.parseInt(answer.getText());
               if (usersAnswer==product) {
                    showStatus("Very good!");
               while (usersAnswer!=product) {
                    usersAnswer=Integer.parseInt(answer.getText());
                    showStatus("No.Please try again.");
}

I modified my code a little bit and now it works but I still can't figure out how to overwrite the initial string ("Applet started."). Can someone help me,please !!!
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Multiplication extends JApplet implements ActionListener {
     JLabel showAnswer;
     JTextField answer;
     int usersAnswer, product, value1, value2;
     public void init()
               Container c=getContentPane();
               c.setLayout(new FlowLayout());
               showAnswer=new JLabel("Type in the answer: ");
               answer=new JTextField(10);
               answer.addActionListener(this);
               c.add(showAnswer);
               c.add(answer);
               showStatus("");
          public void start()
               showStatusBar();
          public void actionPerformed(ActionEvent e)
               multiplication();
          public void multiplication()
               usersAnswer=Integer.parseInt(answer.getText());
               if (usersAnswer==product) {
                    showStatus("Very good!");
               if (usersAnswer!=product) {
                    showStatus("No.Please try again.");
          public void showStatusBar()
               value1=0+(int) (Math.random()*9);
               value2=0+(int) (Math.random()*9);
               showStatus("How much is "+value1+" times "+value2+"?");
               product=value1*value2;
}

Similar Messages

  • Status bar question !

    Hello out there !
    What is the little icon for that sits on the Photoshop CS6 (CC) Status Bar just to the right of the Zoom Level area ? How is it used ? I've tried clicking on it, right-clicking on it, shift-clicking on it and swearing at it, and nothing seem to happen whether one or multiple documents are displayed.
    Thanks for any help on this !
    Rafi

    Well, I was crazy curious so I did some rummaging around. With Adobe Drive, the files are hosted on a server so that a group can have access and edit files as needed. The icon in the status bar changes to let you know what is going on with that file.

  • Icon status bar question

    I had a button to turn my 3G on and off at the top of the notification bar...and after recent updates were installed i now have an airplane mode button in it's place and cannot figure out how to get that off and the 3G back on there..it's been a real nuissance..can anyone tell me how to get it back to normal?

    forgot to add it's for an LG Vortex

  • Removing the 'Warning Java Applet' Status Bar

    Hi,
    I've written an applet that does not require access outside the sandbox so doesn't need signing. However, it pops up an instance of Window, and because it's not signed the window has a status bar across the bottom which says 'Warning Java Applet' or something similar depending on the browser. Is there any way to remove this status bar without signing the applet or changing the security settings of the browser. I guess it must be added to the window so maybe it's just a component that can be removed, but how?
    Thanks in advance

    Today the Security Warning sign appeared at the bottom of my computer screen - how do I get rid of it. I do have Java whose icon used to be in the lower right hand section of my screen - along with all the other icon programs that I have.
    Now the icon is no longer down on the bottom right of the screen, but in the middle with a Security Warning -(the wording) next to the jave icon.
    This is really annoying me - how can I get rid of it, and - why did it appear here?
    Anxiously awaiting your reply.
    Donna

  • Can you disable the status bar on a web browser from an applet?

    I have a signed applet and am using plugin 1.3.1_02 with IE 5.5. I use the showStatus("text") method to display pertinent information to the user in the browser's status bar.
    Currently I see all types of messages being displayed (in IE's status bar) as my applet communicates with the server. I would like to restrict what is shown in the status bar to show my system messages only.
    Can I filter what is displayed or disable status bar functionality programmatically from the applet? Or possibly with a browser/plugin setting?
    Thanks

    Hi,
    I think you can do that with Java to JavaScript communication.
    thanks,
    Srinivas.

  • Status Bar at the bottom of applet

    Hi,
    How can I get rid of Status bar at the bottom of an applet?
    I dont' wana see word "Java Applet Started". I have called
    JFrame.setDefaultLookAndFeelDecorated(true);
    Everything is fine, but the unwanted status bar at the bottom.
    Any help is greatly appreciated.
    Regards

    Howdy.
    Not sure what you are trying to achieve here. The appletviewer sounds like it is working as designed. If you are writing an applet then I'd assume that you intend for it to be accessed via a web browser. The appletviewer is simply a test mechanism.
    However, your concern about the way in which the appletviewer presents itself leads me to think that you are intending all users to run your app. using the appletviewer. If this is the case then why not just create the frame directly? This code does just that.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class SimpleJFrame extends JFrame {
         public static void main(String[] a){
              SimpleJFrame cleanFrame = new SimpleJFrame();
         SimpleJFrame() {
              // user interface
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setTitle("SimpleJFrame");
              Container cp = getContentPane();
              cp.setLayout(new FlowLayout());
              cp.add(new JButton("Press"));
              cp.add(new JTextField(8));
              pack();
              show();
    }regards
    sjl

  • Status Bar and Title on Applet

    Hi,
    Is there any way I can get rid of the status bar from the applet that shows the form on the net ??? Also, I want to remove an oracle logo (title) which appears above the window. Anybody knows how to do it ???
    PJ.
    null

    If you remove console window name from your forms property, you can get rid of the status bar from the applet.
    Do you have web site using forms6i applet? If yes, please let me know the site name.
    null

  • Applet view Status bar

    Hi.
    How i can suppress the applet view status bar when deploying form6i on Web.
    Thanks.
    null

    Hi,
    i copied ur code and tested it on my system(win 98 se with IE 5.5) it works fine.
    I guess u might be using an older version of a browser thats why u r not able to view anything.it would be better if u mention the browser in which u tested ur code...
    maybe ur browser doesnot have the latest plugin for java installed.
    Regards,
    Partha

  • Applet Status Bar

    How do you put a name in the status bar of an applet?
    I have to put my name in there and i am wondering how to do it with an applet
    Thank you

    Ah that's different...that you can use javascript for...has nothing to do with java.
    "top.window.status=" is the property you set to whatever text you want to display down there.

  • Status bar of Oracle from runtime applet is not displaying all of a sudden

    Hello,
    The status bar of Oracle form runtime applet is not displaying all of a sudden..It was displaying before but now its not......It helps me to see errors......how can I restore it?

    My console was set to a specific window name..it was not null at all....but the status bar wont show...
    But I solved it ...by changing the applet size...
    Applet container size is controlled by the HEIGHT and WIDTH parameters in the formsweb.cfg. To maximize the applet area to the size of the browser, do the following:
    HEIGHT=100%
    WIDTH=100%
    Thank you all for your help and support...
    Edited by: user10746194 on Feb 11, 2010 6:33 AM

  • JFrames withous status bar with "Java Applet Window" ?

    Hello.
    I call a JFrame from JApplet. All my JFrames with a status bar where string "Java Applet Window" is showing. How can I creat JFrames without that status bar?
    Thank you in advance.

    This shows as a security measure because your applet isn't "signed". Your applet must be signed in order for this to not show.
    Refer to the following for a how-to:
    http://java.sun.com/developer/qow/archive/167/index.jsp

  • How do i have status bar and a back button  for applets?

    I have an applet which displays a set of panels in order. Is there any way that i can have a status bar like in an browser and a back button so that it can go back and go forward. What do i need to do? Is there any sample code to do so. I am new to java and learning.
    Thanks
    Ram

    Status-Bar -- a long thin panel with a long TextField. Perhaps use something from the BorderFactory class to seperate it from other parts of the screen...
    Back Button -- Keep track of your panels in a CardLayout, for example, then use a Button with an action listener that uses the CardLayout's previous() method to move back to the last panel.

  • How to customize the applet's status bar in Oracle Forms 9i

    I extended the statusBar class to include our own message in the applet's status bar. Using JDeveloper I compiled the class and jared the class file. Eventhough I placed that jar file in the classpath, it is not shown in the "import java classes" dialog box.Could anyone help me. Thanks in advance.

    Hi,
    it needs to be in the path configured in the Forms_Builder_Classpath registry variable.
    Frank

  • Previous page had this: Common Questions What happened to the Status Bar? t you start with telling us What is the Add-on Bar? How do I use bookmarks? What are App Tabs? How do I customize the toolbars?

    Don't assume people automatically know all your technical terms! Before you talk about, e.g., "status bar", it would be really helpful to show or tell us WHERE IT IS.
    Since you made basic things like "history" and "bookmarks" harder to find, I'm back to using "CTRL H" for history -- is there a keystroke method to get to the bookmarks?

    See:
    * [[Glossary]]
    * [[Browsing basics]]
    * [[Tabbed browsing]]
    * [/kb/how-do-i-use-bookmarks]

  • Question about safari status bar

    Hi All,
    I have a web application , mainpage contained an iframe . the Page in iframe will set data to status bar . And mainpage will scan status bar by a timer to get the update info . All the flow was controlled by JavaScript .
    It works fine with IE , but for Safari , i saw the status bar was updated and the data is correct , but window.status alway be empty .
    Did anyone know how to get the data ? if Safari can show the correct data in status bar , it should mean the browser contains the data , right?

    BTW , the version number of my Safari is 5.0.1

Maybe you are looking for