Results 1 to 6 of 6
  1. #1
    a_elalaily is offline Member
    Join Date
    Apr 2009
    Posts
    3
    Rep Power
    0

    Default [SOLVED] Changing a JButton's border

    Hi,

    I want to change the border of a JButton if it is clicked.

    Java Code:
    button.setBorder(BorderFactory.createLineBorder(Color.green));
    This gets me an error. Is there any way of getting this done?

    Thanks.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    what error message is shown?

  3. #3
    a_elalaily is offline Member
    Join Date
    Apr 2009
    Posts
    3
    Rep Power
    0

    Default

    Oh, sorry the error was in another thing. But it showed that it was that line. Found that out after getting it fixed.
    Is there a way to delete this thread?

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    just mark it "solved", and that will be good enough.

  5. #5
    a_elalaily is offline Member
    Join Date
    Apr 2009
    Posts
    3
    Rep Power
    0

    Default

    Hehe, I'm sorry but I don't know how to do this. I looked for a button, couldn't find one. Tried to edit the title of the thread, again couldn't. Excuse my ignorance, but how do you do that?

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Just above your thread there's a "Thread Tools" menu. Click on that, and you'll see.

Similar Threads

  1. How to remove border in JComboBox
    By tiro in forum AWT / Swing
    Replies: 2
    Last Post: 03-08-2009, 05:45 PM
  2. Changing the Jframe
    By Nemo1959 in forum New To Java
    Replies: 13
    Last Post: 09-19-2008, 03:58 PM
  3. Textfield border problem
    By jurka in forum AWT / Swing
    Replies: 2
    Last Post: 08-31-2008, 09:15 AM
  4. Displaying a Button with a Border
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 06-26-2008, 07:40 PM
  5. Border Layout
    By mark-mlt in forum Java Applets
    Replies: 5
    Last Post: 05-12-2008, 09:48 AM

Posting Permissions

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