• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why is there a small gap at the top of the JCombo dropdown menu?

 
Greenhorn
Posts: 24
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

I have two JCombo boxes - one with more values then the other. The one with more values doesnt have a small gap at the top and bottom of the popup, the one with less items does. My question: how can I remove the extra space at the top and bottom of the left side JCombo box popup? And whats causing it?


Regards

package gui.customer.com;

 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Works fine for me using JDK8 on Windows 7.

Some basic debugging techniques:

1. First test with default classes. No need for a custom renderer to demonstrate a problem.
2. Use the default fonts.
3. Use the default sizes

In other words first make sure the code works with default classes and values before making changes.

Then if it stops working you know which change is causing the problem.

Also, don't use a JLabel to reserve space. You can use an EmptyBorder on the panel. Read the section from the Swing tutorial on How to Use Borders
 
Peter Lock
Greenhorn
Posts: 24
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rob

Thanks for the advice. I went ahead and checked an example from 'The Definitive Guide to Swing' page 495 'List Modal Controls' - and even with a simple copy paste I had the same problem after removing half of the arrays data. Im using JDK8 on OSX. Thanks again for taking a look.

Regards
Screen-Shot1.png
[Thumbnail for Screen-Shot1.png]
Screen shot 1
Screen-Shot2.png
[Thumbnail for Screen-Shot2.png]
Screen shot 2
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aha. So it's Windows vs OSX, in other words the two of you are using different look-and-feels.
 
Peter Lock
Greenhorn
Posts: 24
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul

Yep, thats it. And with your help I have started customizing this project look and feel. Thanks again for your help

Regards
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic