• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting X and Y of swing Object

 
Koh Khai Huat
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I need to ask if anyone know how to set the X and Y of the JTextField or any other object thx in advance. I need help urgently.

regards
KKH
 
Rajasekar Elango
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing components uses layout manager to layout the components
If you wish to specify location, you have to set absolute layout and set location using setBounds() method of the component.

Thanks,
Raja
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The basic answer is that you typically don't want to do that, as it compromises platform independence.

Can you tell us more about what you want to do?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!