Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with GridBagLayout  RSS feed

 
Kevin Onik
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends.
I have a funny problem:

In a panel with GridBagLayout ,I have a JTextField witch has bean added to panel by this parameters :

myPanel.add(myJTextField, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 0, 5), 1, 0));

It's set to be resized Horizontally when the form resizes! The problem is when the user types in this text field and reaches the end of in (Visualy I mean ) the myJTextField resizes itself to a bigger size !!!

what should I do to prevent this ? and I don't want to use setMax.... and such methods. I want it to be resized only when the panel resizes , not when the user types in it!!! ....

Thanks
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Kevin Onik
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks man !!! BUt the problem has changed!
Your code and mine are fine with default look and feel ! but ....
When I use Alloy lookAndFeel the problem arises as I mentioned before!

How cold this happen???
Test the code above with Alloy lookAndFeel !?!?!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!