• 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

Text in Jcombobox is too small, but why?

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

As you can see the text in the JCombobox is to small, but I don't know why.
I also tryed jCombobox_test.setpreferedsize() and setSize() but it both doesn't work



And in another GUI of me I had this, and that is what I'm looking for:

 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably set a maximum size for the combo boxes somewhere. Can you post the code where you create them?
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You shouldn't need to set either the preferredSize or the size. However, the layout you use and the way you set the size (or don't) of the enclosing Window/Container may influence the displayted size of a contained component.

To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

Moving this thread to the GUIs forum.
 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

D. Ogranos wrote:You probably set a maximum size for the combo boxes somewhere. Can you post the code where you create them?



I have made a small other program, where the Combobox is also to small. Here is the code of that class. So you can see it by your own.



Thanks alot already!
 
D. Ogranos
Ranch Hand
Posts: 214
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't compile this, as DialogLayout is unknown (I can't find this in the API either, is this a class written by you?). Since the layout heavily influences how things are drawn, I'd suggest looking at that class
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the problem must be in the menu.

having read Darryl's link to the SSCCE, you obviously would not have included
the menu code if it was unrelated to the problem, ergo, it must be the problem.

 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

D. Ogranos wrote:Can't compile this, as DialogLayout is unknown (I can't find this in the API either, is this a class written by you?). Since the layout heavily influences how things are drawn, I'd suggest looking at that class



Hello,

Sorry, for my very very late response, but here is my small project, only with the 2 classes that are needed and a small code where you can see 1 combox!

Smaller Project with the wrong combobox
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are you required to use DialogLayout?

if not:
change jPanelRight3 to a BorderLayout
create a holdingPanel(new GridLayout(0,2,20,5))
add the comboBox and 3 x labels to the holdingPanel
add the holdingPanel to jPanelRight3 at BorderLayout.NORTH
 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michael Dunn wrote:are you required to use DialogLayout?

if not:
change jPanelRight3 to a BorderLayout
create a holdingPanel(new GridLayout(0,2,20,5))
add the comboBox and 3 x labels to the holdingPanel
add the holdingPanel to jPanelRight3 at BorderLayout.NORTH



Thanks alot! I used the Dialoglayout only to get two rows in the panel. But I see now it can also with the Gridlayout!

You are my hero! :)
 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michael Dunn wrote:are you required to use DialogLayout?

if not:
change jPanelRight3 to a BorderLayout
create a holdingPanel(new GridLayout(0,2,20,5))
add the comboBox and 3 x labels to the holdingPanel
add the holdingPanel to jPanelRight3 at BorderLayout.NORTH



I have still the problem here. And I now know what the problem is.

I have Java7, that is the problem.. Someone knows how I can fix this?

Because I distribute the program, and if some else has Java 7 whats going wrong?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic