Results 1 to 3 of 3
  1. #1
    tiro is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default How to remove border in JComboBox

    Hi i got a JComboBox with a border I need to remove.
    I tried:
    JConboBox combo = new JComboBox();

    combo .setBorder(BorderFactory.createEmptyBorder());

    and

    combo .setBorder(null);
    But that didn't work. Any idea?
    I want to remove exactly the border around the JConboBox.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,305
    Rep Power
    20

    Default

    If the appearance of the arrow button isn't an issue, the one-liner to achieve this is
    Java Code:
    comboBox.setUI(new BasicComboBoxUI());
    db

  3. #3
    tiro is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

Similar Threads

  1. Textfield border problem
    By jurka in forum AWT / Swing
    Replies: 2
    Last Post: 08-31-2008, 09:15 AM
  2. JComboBox
    By Fosters in forum AWT / Swing
    Replies: 0
    Last Post: 08-10-2008, 01:22 PM
  3. Displaying a Button with a Border
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 06-26-2008, 07:40 PM
  4. Border Layout
    By mark-mlt in forum Java Applets
    Replies: 5
    Last Post: 05-12-2008, 09:48 AM
  5. jcombobox
    By Freddie in forum AWT / Swing
    Replies: 4
    Last Post: 05-11-2007, 12: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
  •