This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Status bar - dynamic prompt text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Status bar - dynamic prompt text" Watch "Status bar - dynamic prompt text" New topic

Status bar - dynamic prompt text

Krishna Alladi

Joined: Jun 16, 2011
Posts: 1
I have a requirement to change status bar prompt text at run-time on tab-out event.
I am using the following code for that. But I don't see the text changing dynamically.
Rather it creates another status bar object at the top and displays that. Please help.

Darryl Burke

Joined: May 03, 2008
Posts: 5115

Hi Krishna and welcome to the Ranch!

If that's Swing or AWT, you shouldn't be using getGraphics() of a component, nor should you ever call a painting method from client code -- call repaint() instead. That said, your code snippet doesn't make much sense in isolation. To get better help sooner, post a SSCCE that clearly demonstrates your problem.

Again, if that's Swing, why aren't you using JLabel and its setText(...) method instead of messing around with custom painting? And what's a tab-out event?

luck, db
There are no new questions, but there may be new answers.
I agree. Here's the link:
subject: Status bar - dynamic prompt text
It's not a secret anymore!