• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to specify X and Y position of a ComboBox?

 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you specify X and Y postions of a ComboBox? By using combobox.setBounds(x, y, l, h)?

Thanks,
cc11rocks aka John Price
 
Rob Camick
Ranch Hand
Posts: 2619
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should learn to use Layout Managers.
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This isn't working. And the way I have things set up, setBounds would work WAY better than Layout Managers. setBounds is not working.
Please help,
John Price aka cc11rocks
 
Rob Camick
Ranch Hand
Posts: 2619
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And the way I have things set up, setBounds would work WAY better than Layout Managers.


That was my point. You have things set up wrong. You need to design for layout managers from the beginning. So take the time to learn how to use them properly now so you don't get into bad habits.

Anyway we can't tell why your 4 lines of posted code don't work because we don't know how they are used in the context of you program.

And you still haven't changed the variable name.
 
Rob Spoor
Sheriff
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick wrote:Anyway we can't tell why your 4 lines of posted code don't work because we don't know how they are used in the context of you program.

Probably because there is a layout manager at work which re-positions and re-sizes the combo box.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic