Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JComboBox doubt

 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a small doubt in JComboBox. I want to add combo box to JPanel, here i am using BoxLayout to add combobox to the panel. here my doubt is that when i am maximise the frame, the combobox size automatically increasing in the panel , it occupies the entire panel, i don't how it is happening, it is the functionality of the JcomboBox ? please suggest me.

Thank You in Advance..
 
Rob Camick
Ranch Hand
Posts: 2612
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can use:

 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rob Camick,
you mentioned the comboBox.setMaximumSize(refComboBox.getPreferredSize()); method is not working ....
 
Rob Camick
Ranch Hand
Posts: 2612
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need further help then you need to create a SSCCE (Short, Self Contained, Compilable and Executable, Example Program), that demonstrates the incorrect behaviour.

Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.
 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

please find the attached screen shot when maximise the frame

thank you in advance ..
combobox.JPG
[Thumbnail for combobox.JPG]
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a doubt also.

can you read english?

in your numerous posts, you have been repeatedly asked to post a compilable program,
so we can see 'exactly' what you are doing, and can test possible solutions.

just posting snippets creates a '20 guesses' scenario, which most won't play.

so, if you really want a solution, read the link (provided 20 or so times in the past),
and post a small program that we can copy/paste/compile/run and see the problem for ourselves

(my crystal ball says it's gunna be 2000 lines)
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael Dunn,
Please check your private messages.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic