Results 1 to 4 of 4
  1. #1
    ravjot28 is offline Member
    Join Date
    Jun 2008
    Posts
    87
    Rep Power
    0

    Default Interesting JButton Query

    Well i am trying on my project and i have completed it

    But looking it as per GUI application i want to hide the JButton's text and only Image Icon should be visible
    And the interesting clause is that the JButton name should not be NULL or "" it shud be the name that i have entered

    Eg:

    JButton b=new JButton("Button",new ImageIcon("m.png"));

    Now the button should only contain m.png and not the text "Button"


    Help plzz as soon as possible

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,457
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by ravjot28 View Post
    Well i am trying on my project and i have completed it

    But looking it as per GUI application i want to hide the JButton's text and only Image Icon should be visible
    And the interesting clause is that the JButton name should not be NULL or "" it shud be the name that i have entered

    Eg:

    JButton b=new JButton("Button",new ImageIcon("m.png"));

    Now the button should only contain m.png and not the text "Button"


    Help plzz as soon as possible
    What's wrong with:

    Java Code:
    b.setText(null);
    ?

    kind regards,

    Jos

  3. #3
    ravjot28 is offline Member
    Join Date
    Jun 2008
    Posts
    87
    Rep Power
    0

    Default

    Basically i am making a Dock using java

    and my Dockl Items are JButtons so i want to show only the IconImage and hide the text or button's name

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

Similar Threads

  1. Interesting CS problem. Need help.
    By xtrmi in forum New To Java
    Replies: 1
    Last Post: 05-02-2009, 03:51 AM
  2. [SOLVED] Interesting question about Semaphore
    By l_m_b in forum Threads and Synchronization
    Replies: 4
    Last Post: 02-13-2009, 06:35 AM
  3. Interesting Experiment
    By uncommon in forum Advanced Java
    Replies: 13
    Last Post: 12-20-2008, 11:30 PM
  4. Interesting topic in JComboBox
    By success21061985 in forum NetBeans
    Replies: 0
    Last Post: 08-21-2008, 12:43 PM
  5. Tricky but very interesting problem
    By ravjot28 in forum New To Java
    Replies: 4
    Last Post: 06-26-2008, 01:43 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
  •