|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

05-02-2008, 08:13 AM
|
|
Member
|
|
Join Date: Mar 2008
Posts: 24
|
|
|
GUI - JLabel
Hi
Does any one know how to design a Jlabel where it will take the file name and display it on a status bar.
I don't have a problem coding it as a normal status bar,
but i can't code it where when a file is open, or view, it would show the file name.
help would be great
Thanks
|
|

05-02-2008, 08:20 AM
|
 |
Senior Member
|
|
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 527
|
|
|
JLabel that will take the filename? and display it on a status bar?
Can you show more informations? What's that status bar? Is that part of your program? or in another program?
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

05-02-2008, 08:31 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,376
|
|
|
Yes give more details.
May be he wants to add label on the status bar of an application. But not sure what he looking for.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

05-02-2008, 08:32 AM
|
|
Member
|
|
Join Date: Mar 2008
Posts: 24
|
|
|
it for an assignment i am doing. which require this.
eg, when i open up a file, called java.txt in a text editor, at the button of the window, it would have a status bar with the filename shown as java.txt
--------------------------------------------------
Text Area
---------------------------------------------------
java.txt <----- status bar
---------------------------------------------------
hope this help
|
|

05-02-2008, 08:46 AM
|
 |
Senior Member
|
|
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 527
|
|
|
Ok, have a copy of that file...
by using getName() method, set the returned value into your JLabel directly.....
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

05-02-2008, 08:50 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,376
|
|
|
Ok, you want to display the name of a file on a application. Do you know how to get the file name. Is that where you stuck or displaying the text on a label?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

05-02-2008, 08:56 AM
|
|
Member
|
|
Join Date: Mar 2008
Posts: 24
|
|
|
this is complicated to explain.
Well its pretty much just displaying the name of the current file that is currently open, on the status bar.
A good example would be. if you look at internet explorer, when the page finish loading, it will say "Done" at the bottom left hand corner.
But in this case, it should say "fileName" the current file that is open.
does that make sense?
sorry for making it so complicated
|
|

05-02-2008, 08:59 AM
|
 |
Senior Member
|
|
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 527
|
|
Yah... it does make sense.
A user's guide if what file did he opened.... 
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

05-02-2008, 09:03 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,376
|
|
|
Yep, first you have to find that which file is opened.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|