8 Replies Latest reply: Apr 3, 2006 6:12 AM by 843805 RSS

    StatusBar Standard

    843805
      Is there a class / standard way of adding a status bar to a GUI (JPanel)?
        • 1. Re: StatusBar Standard
          843805
          Is there a class / standard way of adding a status bar to a GUI (JPanel)?
          Well, typically you would have one status bar for the entire frame. I've never seen a GUI where each panel had one (which isn't to say that you can't do this if you want).

          Anyway, the way I do it is pretty straightforward:

          1) make all of the panels, tabbedpanes, etc that I need and add them all to a single, content panel, using whatever LayoutManager you want to get the job done for each panel.

          2) add the content panel to a scrollpane

          3) my frame, using BorderLayout, has 3 parts: a JToolBar, the scrollpane containing the content panel, and a statusbar (which is a JLabel)

          4) add the 3 components to the contentPane of my frame:
          - the toolbar goes in BorderLayout.NORTH
          - the scrollpane goes in BorderLayout.CENTER
          - the statusbar goes in BorderLayout.SOUTH
          • 2. Re: StatusBar Standard
            843805
            What I was hoping for is a helper class for status bars that are more complex than just a JLabel. Where it can have multiple fields with or without separators and possibly having the field sizes be adjustable by the user (kinda like a split pane).
            • 3. Re: StatusBar Standard
              843805
              Or if that class does not exist, which I suspect is true, a place where I could find some guidance about what are good ways to accomplish the above.
              • 4. Re: StatusBar Standard
                843805
                The way I did in one of my GUIs is... I had a panel with a label which I made it singleton (this is the StatusBar control). And I had methods like setStatusMessage(), clear() etc. to update the messages from anywhere in the whole application.
                • 5. Re: StatusBar Standard
                  camickr
                  http://www.ftponline.com/archives/magazines/javapro/

                  Select June, 2000 and you will find an article by Claude Duguay on his JStatuBar component. His status bar allows you to add multiple components with his own custom LayoutManager that allows you to control the sizes of the various cells on the bar. Of course you have to register with the site read the article and download the code.
                  • 6. Re: StatusBar Standard
                    843805
                    You ROCK! That's perfect! Thanks.
                    • 7. how send new posts in this forum
                      843805
                      hello sir
                      i am new member of this foum . i dont know how post my question
                      please help me
                      thank you
                      • 8. Re: how send new posts in this forum
                        843805
                        i am new member of this foum . i dont know how post
                        my question
                        Posting a question is simple : write a sentence and add a question mark at the end.