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){}
}

Similar Messages

  • How to insert a space-bar in the Muse CC master slide page property metadata

    I'm using the latest version of Muse CC and need to know how to insert a space-bar in the master slide page property metadata page title suffix area

    I found it.  If anyone else has this problem press the shift and \ at the same time on a standard windows keyboard.

  • How to get a scroll bar to the applications popup by default?

    How to get a scroll bar to the applications popup by default when clicked the applications folder from the dock? If I have so many applications that they do not fit in the default area, I have to find out myselft that I have to scroll the content before the scroll bar appears. This leads to "where is my missing applications questions" by the novice users with Mountain Lion.

    System Preferences > General > Show scroll bars.
    Click the button by the side of "Always".
    Best.

  • How to make the status bar transparent

    can anyone help?

    Here it don`t make the status bar transparent...
    I`m trying to make UINavigationBar transparent too like Photo App and trying it but get nothing:
    [navigationController.navigationBar setBarStyle:UIBarStyleBlackTranslucent];
    [navigationController.navigationBar setTintColor:[UIColor colorWithWhite:0.2 alpha:0.6]];
    Some other idea how they do this? An application called Style.com do the same..
    Thank you

  • How to remove white status bar (or navigation panels) in photo app

    Since I downloaded the new iOS7, the status bar (or navigation bars on top and bottom) in the photo app stays and is white. With the older OS version, it was black and disappeared after a couple of second.  Now the white bar stays and you do not have a full view of the picture (top and bottom is cut off when holding it lengthwise)  Any idea how to remove this?  Thanks

    Not sure what you mean by "status bar". There are two navigation panels, one at the top and one at the bottom. No, you can't remove those if that is what you mean.

  • How to show/hide status bar programatically in openGL ES app?

    Ok, I started with an openGL ES app and can draw my window where I want to display it.
    However, even though the xib file says <<no status bar>>, when I run my app, I get a status bar with a white background which overlays the top part of my graphics. In my app. I want to use all 320x480 pixels for the background tableau and have no need for a status bar...
    How can I enable or disable this programmatically?
    Thanks!

    The best way to hide the status bar for the life of your program is in Info.plist:
    1) Expand the Resources folder in the Xcode Group & Files tree and open Info.plist;
    2) If you already have a key named "UIStatusBarHidden", continue with step 5;
    3) Ctrl-click in the last row of the Key column and select Add Row from the floating menu;
    4) Copy and Paste UIStatusBarHidden into the edit cell for the new row and hit Return;
    5) Ctrl-click on UIStatusBarHidden and select Value Type->Boolean from the menu;
    6) A check box should now appear in the Value column; check that box;
    7) If unsure about what you've done, close the Info.plist window, select Don't Save, and start over;
    8) Cmd-S (File->Save from the top Xcode menu) to save Info.plist.
    If you want the status bar to return at some point:
    [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
    If you don't wish to change any of your OpenGL files to .m, just wrap the above in an extern C function (e.g. in main.m).
    - Ray

  • How to disable tiny status bar from grabbing touches

    My app runs in landscape mode. I have done some tests on detecting touches, and in my view, which covers the entire screen, there is a sliver of the screen that is not returning touch events; this sliver of the screen corresponds to top say 24 pixels of the screen, where the batter life indicator and other things go. my view covers the entire screen and I want to have full screen control, but am losing these touches, probably because some higher priority listener is getting the events; how can I disable this status bar so I can get the touches?

    Same problem.
    After testing on the device the problem persists.
    I know from testing other applications that it IS possible to use the WHOLE screen for your own application.
    Just I don`t know whats going wrong here.
    Will probably check back tomorrow with my view-hierarchy and more details, maybe together we can find out what the problem is.

  • How to create a status bar in Forms 6i

    Hi,
    I am using Forms6i. I am calling a C application which takes some time to execute...So I would like to display a status bar in forms saying....Processing..Please Wait...
    And, once the control comes back to forms from the C program, this status should say complete.....
    Is there a way to do this ?..
    Please give some example /link for this
    thanks

    Hi
    Y cant u have a text item, ENABLED before the that C code with DEFAULT value 'Pleae wait....' and even u could have cursor style also set to BUSY.. then after process DISABLE the text item and bring back cursor style to DEFAULT.
    Regards

  • 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 bring back status bar when opening Excel doc mail attachment?

    I have an iPad updated to 6.1.3.  When I open up an Excel document from mail it opens the attachment fine and the status bar across the top with the 'Done' option to close the doc appears then disappears altogether after a few seconds giving you full screen access to the file.  No problem there, but bringing it back to be able to close the document is tricky.  Tapping along the top works only sometimes....I haven't been able to find a consistent way to bring it back to close the document.  I can slide down across the top to bring up the notification center but tapping across the top to bring the bar back to close the file will only work after playing around with it for about 20 touches or so.  Is there a trick to this or a way to keep the status bar there?  Thanks in advance!!

    Then quit the mail app completely and reboot your iPad, then try again. What we are describing is the way that it is done. Your mail app might be just acting a little hinky now.
    Go to the home screen first by tapping the home button. Double tap the home button and the recents tray will appear with all of your recent apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button or anywhere above the task bar.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • How to capture the Status code in Web application Transcation monitoring if we are using multiple Request

    Hi Team
    We would like to monitor 12 url,s which requires Authentication. Hence i have added the same in one Single Web application transcation template.
    i have added the below info to the get the Stats code displayed in Alert
    Status code is $Data/Context/RequestResults/RequestResult["1"]/BasePageData/StatusCode$
    when i recived a alert it gave the Status code of the 1st Request
    hence i changed the same as
    Status code is $Data/Context/RequestResults/RequestResult["12"]/BasePageData/StatusCode$
    But still i am facing the same issue .
    My first request shows me a status code of 200, and my 12th Request comes with 500 but in the alert i get 200 but it should be 500.
    Kindly help me in how i can get the Status code for the multiple  Request.
    Regards
    Sriram

    Hi Sriram,
    Please run the test of your 12th Request, view full result and check if Status Code is 200.
    Meanwhile, you can run the URL manually to check the result.
    Niki Han
    TechNet Community Support

  • ADF mobile : How to insert new rows in shopping cart application

    Hi All,
    I'm developing a shopping cart sample application.
    The first page shows 3 rows(with item and quantity columns) and "Add Row" & "save to shopping cart " buttons . On clicking add row button i want to add 4th row to the table  and on clicking "save" button all the items should add to cart.
    Can somebody tell me how to add dynamic rows in adf mobile and access the data in DC to save the data.
    Thanks,
    Prashanth.

    Are you talking about working with the local SQLite database on the device or with a remote database on the server?
    For local DB - check out the HR ADF Mobile sample.
    http://www.oracle.com/technetwork/developer-tools/adf/adf-mobile-samples-1865088.html

  • How to save status bar background color in local settings(Windows Phone 8.1)

    I have given the user the freedom to change background colour and save it in local settings. But I am confused on how to save the status bar colour settings because I want to give the user the freedom to choose from 4-5 colours where background of status bar
    can be changed.
    public static void SaveStatusBarColor()
    // get status bar color
    var statusBar = StatusBar.GetForCurrentView();
    var color = statusBar.BackgroundColor;
    // convert color to hex string
    var hexCode = color.HasValue ? color.Value.ToString() : "";
    // store color in local settings
    ApplicationData.Current.LocalSettings.Values["StatusBarColor"] = hexCode;
    public static void LoadStatusBarColor()
    // get color hex string from local settings
    var hexCode = ApplicationData.Current.LocalSettings.Values["StatusBarColor"] as string;
    if (string.IsNullOrEmpty(hexCode))
    return;
    // convert hexcode to color
    var color = new Color();
    color.A = byte.Parse(hexCode.Substring(1, 2), NumberStyles.AllowHexSpecifier);
    color.R = byte.Parse(hexCode.Substring(3, 2), NumberStyles.AllowHexSpecifier);
    color.G = byte.Parse(hexCode.Substring(5, 2), NumberStyles.AllowHexSpecifier);
    color.B = byte.Parse(hexCode.Substring(7, 2), NumberStyles.AllowHexSpecifier);
    // set the status bar color
    var statusBar = StatusBar.GetForCurrentView(); // Exception Line
    statusBar.BackgroundColor = color;
    }This is what was suggested to me. Initially the app runs and saves the settings.But when the app is closed and restarted again it crashes.

    Hi shriyansh,
    Where did you call the method SaveStatusBarColor() and LoadStatusBarColor()?
    I have called your SaveStatusBarColor() in the OnNavigatedFrom method and called the LoadStatusBarColor() in the OnNavigatedTo method, it worked very well in my side.
    So I can not reproduce your issue.
    Here are my code and result, please try to check it:
    public class test
    public Color colors { get; set; }
    public sealed partial class MainPage : Page
    List<test> testdemo = new List<test>();
    public MainPage()
    this.InitializeComponent();
    testdemo.Add(new test() { colors = Colors.Red });
    testdemo.Add(new test() { colors = Colors.Green});
    testdemo.Add(new test() { colors = Colors.Gray});
    testdemo.Add(new test() { colors = Colors.Blue });
    this.NavigationCacheMode = NavigationCacheMode.Required;
    public static void SaveStatusBarColor()
    // get status bar color
    var statusBar = StatusBar.GetForCurrentView();
    var color = statusBar.BackgroundColor;
    // convert color to hex string
    var hexCode = color.HasValue ? color.Value.ToString() : "";
    // store color in local settings
    ApplicationData.Current.LocalSettings.Values["StatusBarColor"] = hexCode;
    public static void LoadStatusBarColor()
    //get color hex string from local settings
    var hexCode = ApplicationData.Current.LocalSettings.Values["StatusBarColor"] as string;
    if (string.IsNullOrEmpty(hexCode))
    return;
    // convert hexcode to color
    var color = new Color();
    color.A = byte.Parse(hexCode.Substring(1, 2), NumberStyles.AllowHexSpecifier);
    color.R = byte.Parse(hexCode.Substring(3, 2), NumberStyles.AllowHexSpecifier);
    color.G = byte.Parse(hexCode.Substring(5, 2), NumberStyles.AllowHexSpecifier);
    color.B = byte.Parse(hexCode.Substring(7, 2), NumberStyles.AllowHexSpecifier);
    var statusBar = StatusBar.GetForCurrentView();
    statusBar.BackgroundColor = color;
    statusBar.BackgroundOpacity = 1;
    protected override void OnNavigatedTo(NavigationEventArgs e)
    LoadStatusBarColor();
    protected override void OnNavigatedFrom(NavigationEventArgs e)
    SaveStatusBarColor();
    private void ChangeColorButton_Click(object sender, RoutedEventArgs e)
    var statusBar = StatusBar.GetForCurrentView();
    statusBar.BackgroundColor = testdemo[Convert.ToInt32(Mytextbox.Text)].colors;
    statusBar.BackgroundOpacity = 1;
    The result:
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to put Status bar

    How to put a status bar in a JFrame by which some informations that will be done in the application should be displayed in the status bar.

    Add a JPanel to your JFrame and tell the program this is your contentPane
    Next you set the contentPane's Layout a BorderLayout.
    Last you've to add a JLabel to the contentPane.
    Now you can set a statusText or an Icon...
    hope it helps,
    Thof

  • Trapping KeyEvents anywhere in a JFrame for a status bar

    Hi all,
    There are a few examples of how to implement a status bar in the archives, but I haven't seen anything that tells you how to trap KeyEvents (e.g. pertaining to CapsLock etc.) which occur anywhere in a JFrame: once you start adding focusable components (particularly but not exclusively JTextComponents) to a JFrame the JFrame itself is often not sent the KeyEvents, so a rudimentary addKeyListener() is not the answer.
    Could this involve the use of KeyboardFocusManager or sthg? NB to experts: I have read the tutorial on the focus subsystem to no avail. The key seems to be to trap the event thread in some way, perhaps??
    All help greatly appreciated...
    Mike

    Add a AWTEventListener on Toolkit.getDefaultToolkit() with appropriate mask. See javadocs of addAWTEventListener method.

Maybe you are looking for