This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JComboBox doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JComboBox doubt" Watch "JComboBox doubt" New topic
Author

JComboBox doubt

tadi raja
Ranch Hand

Joined: Jul 07, 2008
Posts: 109
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

Joined: Jun 13, 2009
Posts: 2152
    
    7
I think you can use:

tadi raja
Ranch Hand

Joined: Jul 07, 2008
Posts: 109
Hi Rob Camick,
you mentioned the comboBox.setMaximumSize(refComboBox.getPreferredSize()); method is not working ....
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2152
    
    7
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

Joined: Jul 07, 2008
Posts: 109

please find the attached screen shot when maximise the frame

thank you in advance ..


[Thumbnail for combobox.JPG]

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
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

Joined: Jul 26, 2007
Posts: 10167
    
    8

Michael Dunn,
Please check your private messages.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
 
subject: JComboBox doubt
 
Similar Threads
JcomboBox vanishing occasionally
Netbeans GUI Code Doubt
Jtable combo box issue
how to auto update jcombobox?
ComboBox Item Display