Results 1 to 9 of 9

Thread: GUI - JLabel

  1. #1
    Azndaddy is offline Member
    Join Date
    Mar 2008
    Posts
    24
    Rep Power
    0

    Default 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

  2. #2
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    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?
    freedom exists in the world of ideas

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    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.

  4. #4
    Azndaddy is offline Member
    Join Date
    Mar 2008
    Posts
    24
    Rep Power
    0

    Default

    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

  5. #5
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    Ok, have a copy of that file...

    by using getName() method, set the returned value into your JLabel directly.....
    freedom exists in the world of ideas

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    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?

  7. #7
    Azndaddy is offline Member
    Join Date
    Mar 2008
    Posts
    24
    Rep Power
    0

    Default

    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

  8. #8
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    Yah... it does make sense.
    A user's guide if what file did he opened.... :)
    freedom exists in the world of ideas

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. JLabel append?
    By Jononomous in forum New To Java
    Replies: 0
    Last Post: 04-07-2008, 07:41 PM
  2. JLabel .setActionCommand
    By stevemcc in forum AWT / Swing
    Replies: 1
    Last Post: 03-28-2008, 04:16 AM
  3. Problems with JLabel 2
    By geork in forum New To Java
    Replies: 2
    Last Post: 02-03-2008, 08:40 PM
  4. JLabel
    By Jack in forum AWT / Swing
    Replies: 2
    Last Post: 07-02-2007, 01:55 PM
  5. JLabel
    By Freddie in forum AWT / Swing
    Replies: 2
    Last Post: 05-29-2007, 02:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •