Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Text in Jcombobox is too small, but why?

 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • 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:

 
D. Ogranos
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • 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?
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic