Implementing status bar functionality in Swing

How can I implement the functionality
of status bar in my application,
I did't find any class for that purpose in Swing
like say CStatusBar in MFC.

Nevermind, I misunderstood what you were looking for.
Use the border layout for the panel of the JFrame, and on the South area create another panel and customize it as you see fit. Then use a mouselistener and actionlisteners to change what the bar says and does...

Similar Messages

  • Displaying a status bar through swings

    Hi everybody,
    My problem is that i want to display a status bar, using Java Swings. In this regard i am facing somwe difficulty, and i would be really thankful to those, who in some way can help me.
    thanks

    Create a Static JLabel in the main application constructor and add it to the South position of your main window.
    Now set the text dynamically whereever u want to show a status message to this static label.
    I hope this can solve your problem

  • 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.

  • Where is the Status Bar in FF 7.0.1?

    I have just updated to FF 7.0.1 from FF 3.6.16. I am unable to find the status bar in the new version, to know the progress of my web page downloads. How do I get the FF 3.6.16 Status Bar like function in this new version?

    The Status Bar was removed in an earlier version of Firefox and replaced with the Add-on Bar.
    *See --> https://support.mozilla.com/en-US/kb/common-questions-after-updating-firefox#w_what-happened-to-the-status-bar
    *See --> https://support.mozilla.com/en-US/kb/what-happened-status-bar
    You can regain some Status Bar functions by installing the Status-4-Evar extension.
    *Install the '''''Status-4-Evar''''' extension: https://addons.mozilla.org/en-US/firefox/addon/status-4-evar/
    *After install,
    *#Be sure the Add-on Bar is displayed; Options > Add-on Bar (or View > Toolbars > Add-on Bar), click to check "Add-on Bar"
    *#In View > Toolbars > Customize drag any or all of the 3 items to the position you want them on the Add-on Bar:
    *#*Status text (this is the URL information you want)
    *#*Download status (will display No Downloads or number of downloads in progress)
    *#*Progress meter (meter of page loading)
    *#Set the options for Status-4-Evar in Tools > Add-ons > Extensions
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Used View menu to hide Status Bar...how get Status Bar back?

    Used View menu to hide Status Bar...how do I get the Status Bar back?

    to get back your status bar use this extension
    http://techdows.com/2010/10/bring-back-status-bar-functionality-to-add-on-bar-in-firefox-4-with-status-4-evar-extension.html
    hope this will help
    thank you..

  • How can I implement a status bar at the bottom of a resizable application?

    Hello all,
    I am a JavaFx newbie and I am implementing an application (a Sokoban game), with a menu at the top of the frame and a gaming area covering the rest of the frame. To support the game, I have to load images at certain positions in the gaming area.
    The game also includes a level editor with another menubar and where images are set to other positions.
    I implemented this in another view, swiching from the game mode to the level editor mode and vice versa is just done by setting the other view visible. Up to now this works, here the important statements building these details:
    Group root = new Group();
    gameView = new Group(); // for gaming mode
    le_view = new Group()   // for level editor mode
    MenuBar gameMenubar = new MenuBar();
    Menu menuGame = new Menu(bundle.getString("MenuGame"));
    ... building the menu items and menues ...
    gameView.getChildren().add(gameMenubar);
    ImageView buildingView[][] = new ImageView[22][22];
    for (nCol = 0; nCol < 22; nCol++) {
        for (nRow = 0; nRow < 22; nRow++) {
            buildingView[nCol][nRow] = new ImageView();
            buildingView[nCol][nRow].setX(nCol * 26 + 5);
            buildingView[nCol][nRow].setY(nRow * 26 + 40);
            gameView.getChildren().add(buildingView[nCol][nRow]);
    gameView.setVisible(true);
    root.getChildren().add(gameView);
    ... same stuff to build the le_view ...
    le_View.setVisible(false);
    root.getChildren().add(le_View);
    Scene scene = new Scene(root, 800, 600, Color.CORNSILK); Now I want to introduce a status bar at the bottom of the frame, which of course has to follow the bottom of the frame, if it is resized. And of course the menu and the status bar should not grow vertically, if the height of the frame is increased.
    The implementation seems to be easy with StackPane for the frame and one BorderPane for each mode.
    For the first step I only tried implementing the game mode with only one BorderPane (just setting the menu, the gaming area and the status bar each into a HBox and setting these three HBoxes at the top, into the center and at the bottom). I also tried this via GridPane and via VBox; I always get any erroneous behaviour:
    Either the menubar is visible, but the menus do not pop up the menu items, or the anchor point of the menu and of gaming area are set 100 pixels left of the left frame border and move into the frame when the frame width is increased, or the menu is set 20 pixels below the top of the frame, or HBox with the menu grows when the frame height is increased, so that the anchor point of the gaming area moves down.
    Can you describe me a correct construction of such a frame? Thanks in advance.
    Best regards
    Gerhard

    Hello Gerhard,
    Glad the code helped, thanks for a fun layout exercise.
    For the draft code I just pulled an icon off the internet over a http connection.
    If you haven't done so already place any icons and graphics you need local to your project, so that resource lookups like:
    Image img = new Image("http://www.julepstudios.com/images/close-icon.png");become
    Image img = new Image("close-icon.png");then performance may improve.
    Another possible reason for your performance problem could be that when you use a vbox, the vbox content can overflow the area of the borderpane center and might be sitting on top of the menu pane, making you unable to click the menu (which is what happens to me when I try that with the draft program with the vbox wrapping mod, then resize the scene to make it smaller). This was a trick which caught me and the reason that I used a Group originally rather than a vbox. I found a vbox still works but you need to tweak things a bit. The trick I saw was that the order in which you add stuff to the borderpane is important. The borderpane acts like a stack where the last thing added floats over the top of everything else if you size the scene small enough. For your project you want the menu on top always, so it always needs to be the last thing added to the borderpane, but when you swap in the level pane for the game pane, then back out again, the game pane can end up on top of the menu which makes the menu seem like you can't click it (only when the scene is sized small enough). It was quite a subtle bug which took me a little while to work out what was happening. For me the solution was to add just one vbox to the center of the border, and then swap the game pane and the level editor in and out of the vbox, that way the center of the layout always stayed behind the menu bar and the status bar.
    I added some revisions to reflect the comments above and placed some comments in the code to note what was changed and why.
    public class SampleGameLayoutRevised extends Application {
      public static void main(String[] args) { Application.launch(args); }
      public void start(Stage stage) throws Exception {
        final BorderPane gameLayout = new BorderPane();
        final Group gameView = new Group();
        final MenuBar gameMenubar = new MenuBar();
        final Menu gameMenu = new Menu("Mode");
        final VBox centerView = new VBox();
        centerView.setStyle("-fx-background-color: darkgreen");  // we set a background color on the center view to check if it overwrites the game menu.
        MenuItem playGameMenu = new MenuItem("Play Game");
        MenuItem levelEditMenu = new MenuItem("Edit Levels");
        gameMenu.getItems().add(playGameMenu);
        gameMenu.getItems().add(levelEditMenu);
        gameMenubar.getMenus().add(gameMenu);
        final StackPane levelEditView = new StackPane();
        levelEditView.getChildren().add(new Text("Level Editor"));
        ImageView buildingView[][] = new ImageView[22][22];
        Image img = new Image("http://www.julepstudios.com/images/close-icon.png");  // use of http here is just for example, instead use an image resource from your project files.
        for (int nCol = 0; nCol < 22; nCol++) {
          for (int nRow = 0; nRow < 22; nRow++) {
            ImageView imgView = new ImageView(img);
            imgView.setScaleX(0.5);
            imgView.setScaleY(0.5);
            buildingView[nCol][nRow] = imgView;
            buildingView[nCol][nRow].setX(nCol * 20 + 5);
            buildingView[nCol][nRow].setY(nRow * 20 + 40);
            gameView.getChildren().add(buildingView[nCol][nRow]);
        final VBox statusBar = new VBox();
        final Text statusText = new Text("Playing Game");
        statusBar.getChildren().add(statusText);
        statusBar.setStyle("-fx-background-color: cornsilk"); // we set a background color on the status bar,
                                                              // because we can't rely on the scene background color
                                                              // because, if the scene is sized small, the status bar will start to overlay the game view
                                                              // and if we don't explicitly set the statusBar background the center view will start
                                                              // to bleed through the transparent background of the statusBar.
        gameLayout.setCenter(centerView); // we add the centerview first and we never change it, instead we put it's changeable contents in a vbox and change out the vbox content.
        gameLayout.setBottom(statusBar);
        gameLayout.setTop(gameMenubar);   // note the game layout is the last thing added to the borderpane so it will always stay on top if the border pane is resized.
        playGameMenu.setOnAction(new EventHandler<ActionEvent>() {
          public void handle(ActionEvent event) {
            centerView.getChildren().clear();  // here we perform a centerview vbox content swap.
            centerView.getChildren().add(gameView);
            statusText.setText("Playing Game");
        levelEditMenu.setOnAction(new EventHandler<ActionEvent>() {
          public void handle(ActionEvent event) {
            centerView.getChildren().clear();  // here we perform a centerview vbox content swap.
            centerView.getChildren().add(levelEditView);
            statusText.setText("Editing Level");
        playGameMenu.fire();
        Scene scene = new Scene(gameLayout, 800, 600, Color.CORNSILK);
        stage.setScene(scene);
        stage.show();
    }Other than that I am not sure of a reason for the slowdown you are seeing. In my experience JavaFX has been quick and responsive for the tasks I have been using it for. Admittedly, I just use if for a bunch of small trial projects, but I've never seen it unresponsive for a minute.
    - John

  • A second non-functional progress bar is always visible on the status bar, how can I get rid of it?

    The second bar is inside of the sizing grip on the right side of the status bar. It does nothing, but take up space. The functional progress bar appears only when it is working inside of the message panel and outside of the authentication panel on the left side of the status bar. I've turned the status bar off and then on again--no luck. I've also tried disabling all add-ons--no luck. I've also changed themes--no luck. Do I need to re-install the browser?

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
    If you have many extensions then you can first enable half of the extensions to test which half has the problem.
    Continue to divide the bad half that still has the issue until you find which one is causing it.

  • Suppressing status bar message after function call?

    Hi,
    I'm calling a few functions in a program.
    After calling them, for example function "L_TO_CREATE_DN", I get a message in the status bar, in this case saying that a TO has been created successfully.
    How can I suppress all status bar messages for all the functions that are being called in the program?
    THX!

    Hi
    Try to use the default excption error_message
    CALL FUNCTION
    EXCEPTIONS
        error_message = 1
        OTHERS        = 2.
    Max

  • Status bar missing in Firefox 6.0, also Real player does not function with updated version, had to switch back to 3.6

    I've installed Firefox 6.0 about 3 times and each time I noticed that the status bar at the bottom of the page was missing. I relied upon the Norton Security "lock icon" which in version 3.6 would appear in the lower right hand corner of the status bar before signing in to websites or making transactions and found it very helpful. It was present in version 3.6 but not in 6.0. When I went back to 3.6 I suddenly had problems with the page freezing up so returned to 6.0 which corrected the problem but was not comfortable without the icon. I contacted Norton and via remote access the tech determined that the problem exists with Firefox's 6.0 version so he reinstalled 3.6 for me. Also I have a paid subscription to Real player Plus and it does not function with 6.0. I'm concerned because it seems you will soon phase out 3.6 and I will be without these functions which are important to me.

    I have a solution! Follow this link and download the older version. When I installed it, everything came back as it was before! Yay! Good luck to you all. And bad move, Mozilla, in not making it clearer what the system requirements were for the update!!!!
    http://www.macupdate.com/app/mac/10700/firefox

  • How to Insert a Status Bar to my application

    Hello all
    I use JBuilder v9 and would like to add a status bar at the bottom of the main
    frame in my program. I checked the manual pages but there is no such class as StatusBar or JStatusBar.
    When I type StatusBar (or JStatusBar) sb = new StatusBar (or JStatusBar) ();
    it gives errror message.
    Does anyone know how to add a status bar to a frame?

    A quick a dirty example:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    public class StatusBarDemo extends JFrame
      private JLabel statusBar;
      public StatusBarDemo()
        JMenu menu = new JMenu("File");
        JMenuItem item = new JMenuItem("Open");
        item.addMouseListener(new StatusBarUpdator("Open a new file"));
        menu.add(item);
        item = new JMenuItem("Print");
        item.addMouseListener(new StatusBarUpdator("Print the current file"));
        menu.add(item);
        item = new JMenuItem("Save");
        item.addMouseListener(new StatusBarUpdator("Save the current file"));
        menu.add(item);
        JMenuBar menuBar = new JMenuBar();
        menuBar.add(menu);
        setJMenuBar(menuBar);
        statusBar = new JLabel(" ");
        statusBar.setForeground(Color.black);
        statusBar.setBorder(new CompoundBorder(new EmptyBorder(2, 5, 2, 5),
                                               new SoftBevelBorder(SoftBevelBorder.LOWERED)));
        Container c = this.getContentPane();
        c.setLayout(new BorderLayout());
        c.add(statusBar, BorderLayout.SOUTH);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
      public static void main(String[] args)
        StatusBarDemo frame = new StatusBarDemo();
        frame.setSize(400,300);
        frame.setVisible(true);
      class StatusBarUpdator implements MouseListener
        private String hoverText;
        public StatusBarUpdator(String text)
          hoverText = text;
        public void mouseEntered(MouseEvent e)
          statusBar.setText(hoverText);
        public void mouseExited(MouseEvent e)
          statusBar.setText(" ");
        public void mouseClicked(MouseEvent e){}
        public void mousePressed(MouseEvent e){}
        public void mouseReleased(MouseEvent e){}
    }

  • 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;
    }

  • How create a tooltips in status bar icons

    the answer is in the title
    I want to create a tooltips on my application icon tray, in the status bar icon.
    I think that the solution is in the SDK, but i dont know to implement this code:
    source MSDN:
    #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
    NOTIFYICONDATA IconData = {0};
    IconData.cbSize = sizeof(IconData);
    IconData.hWnd = hwndNI;
    IconData.uFlags = NIF_INFO;
    HRESULT hr = StringCchCopy(IconData.szInfo, ARRAYSIZE(IconData.szInfo), TEXT("Your message text goes here."));
    if(FAILED(hr))
    // TODO: Write an error handler in case the call to StringCchCopy fails.
    IconData.uTimeout = 15000; // in milliseconds
    Shell_NotifyIcon(NIM_MODIFY, &IconData);

    If you're interested in the icons in the notification area, I think the easiest solution is to use the "System Tray Icons" functions in toolbox.fp.
    You can create a new icon calling InstallSysTrayIcon(), and you can also set the tooltip text.
    Vix
    In claris non fit interpretatio
    Using LV 2013 SP1 on Win 7 64bit
    Using LV 8.2.1 on WinXP SP3
    Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
    Using CVI 6.0 on Win2k, WinXP and WinXP Embedded

  • To create a status bar

    hai friends,
    how can we create a status bar in a window/frame/textbox.

    I got this answer. Any one have other choices..
    class MenuHelpTextAdapter implements ChangeListener
       private JMenuItem menuItem;
       private String helpText;
       private JLabel statusBar;
       public MenuHelpTextAdapter(JMenuItem menuItem, String helpText, JLabel statusBar)
          this.menuItem = menuItem;
          this.helpText = helpText;
          this.statusBar = statusBar;
          menuItem.addChangeListener(this);
       public void stateChanged(ChangeEvent evt)
          if (menuItem.isArmed())
             statusBar.setText(helpText);
          else
             statusBar.setText(" ");
    }The code that creates the adapters for the menu items is quite simple:
    new MenuHelpTextAdapter(item1, "Help text for item 1", statusBar);
       new MenuHelpTextAdapter(item2, "Item 2 info", statusBar);Using this adapter -- as an inner class in this case -- we can create a complete sample program:
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class StatusBarTest
       JLabel statusBar;
       JMenuItem item1;
       JMenuItem item2;
       private void init()
          JFrame frame = new JFrame("Status Bar Test");
          JMenuBar menuBar = new JMenuBar();
          frame.setJMenuBar(menuBar);
          JMenu fileMenu = new JMenu("File");
          menuBar.add(fileMenu);
          item1 = new JMenuItem("Item 1");
          item2 = new JMenuItem("Item 2");
          fileMenu.add(item1);
          fileMenu.add(item2);
          Container contentPane = frame.getContentPane();
          contentPane.setLayout(new BorderLayout());
          contentPane.add("Center", new JButton("Main application area"));
          statusBar = new JLabel(" ");
          contentPane.add("South", statusBar);
          new MenuHelpTextAdapter(item1, "Help text for item 1", statusBar);
          new MenuHelpTextAdapter(item2, "Item 2 info", statusBar);
          frame.setSize(400,400);
          frame.setVisible(true);
       public static void main(String[] args)
          StatusBarTest t = new StatusBarTest();
          t.init();
       class MenuHelpTextAdapter implements ChangeListener
          private JMenuItem menuItem;
          private String helpText;
          private JLabel statusBar;
           public MenuHelpTextAdapter(JMenuItem menuItem, String helpText,
           JLabel statusBar)
             this.menuItem = menuItem;
             this.helpText = helpText;
             this.statusBar = statusBar;
             menuItem.addChangeListener(this);
          public void stateChanged(ChangeEvent evt)
             if (menuItem.isArmed())
                statusBar.setText(helpText);
             else
                statusBar.setText(" ");
    }

  • Icon on the status bar

    Hello,
    How can place an image on the status bar?
    Also is possible to place it at any position on the status bar?
    -Kathik

    It's like BullJ says, if it's a JLabel you sure can. A status bar is not a Swing feature, you would have to implement it your self (e.g. using a JLabel). So it all depends on the component you're using.
    Rene'

  • Error message in a BADI getting displayed in a popup instead of status bar

    Hello All,
    I have implemented a BADI in ECC6 to prevent the change of formula in ERP from transaction O3I8.
    The BADI gets called on clicking 'Save' from transaction o3I8.
    Within the  BADI i am giving an error message using the following command:
    Message e000(ZABC) .
    However , the message gets displayed in a pop up instead of the status bar .
    The same is for information and warning messages.
    Any suggestions on how to display them in the status bar ?
    TIA
    Regards,
    Vartika

    Hi Brad,
    The checkbox to display messages in pop-up  is already switched off.
    Still themessages are getting displayed in pop-up.
    Regards,
    Vartika

Maybe you are looking for

  • S-video to composite adapter

    This may sound like a silly question, but I was reading the specs on the new PB's tonight and it says that they come with an S-video to composite adapter. I have a PB that I bought in July 2004 that looks exactly like the newest release, but can't fi

  • Reporting counts on multi-value lookup columns

    Hi, I have a list containing 2 columns - student, and subjects. Subjects is a multi-value lookup column. Students may study multiple subjects. What I'm trying to achieve is a simple pie chart (I don't care if it's done using SharePoint Web Part, Exce

  • .and suddenly java.io.IOException: Server returned HTTP response code: 500

    I have this code for a long time and it always works:      URL url = new URL("http://www.infoamistades.net/load.do");                     URLConnection urlConnection = null;           urlConnection = url.openConnection();           urlConnection.setR

  • I have the latest ipod nano version and my computer won't recognize it.  Why?

    My new ipod nano (7th generation) is not being recognized by my account.  Any idea why??? Cindy

  • Send FAX to file

    We currently run an enterprise FAX product but we receive so few FAXes anymore that we believe we can use Microsoft's FAX server solution now - can anyone please tell me what the file naming convention is for a file when you route FAX to file and are